From patchwork Wed Jul 31 07:04:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Novotny X-Patchwork-Id: 263608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8F8002C00BE for ; Wed, 31 Jul 2013 17:04:50 +1000 (EST) Received: from localhost ([::1]:48959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4QSm-0007Tz-CN for incoming@patchwork.ozlabs.org; Wed, 31 Jul 2013 03:04:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4QSR-0007TQ-Be for qemu-devel@nongnu.org; Wed, 31 Jul 2013 03:04:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4QSJ-00027X-HJ for qemu-devel@nongnu.org; Wed, 31 Jul 2013 03:04:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4QSJ-00027J-8Y for qemu-devel@nongnu.org; Wed, 31 Jul 2013 03:04:19 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6V74IK4011432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Jul 2013 03:04:18 -0400 Received: from miglaptop.brq.redhat.com (dhcp-26-175.brq.redhat.com [10.34.26.175]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6V74H7n023872 for ; Wed, 31 Jul 2013 03:04:17 -0400 From: Michal Novotny To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2013 09:04:15 +0200 Message-Id: <0dadf52d6235d364e4e81d6b8b7c8d22ab029bdc.1375254226.git.minovotn@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5] vl.c: Output error on invalid machine type provided X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Output error message using qemu's error_report() function when user provides the invalid machine type on the command line. This also saves time to find what issue is when you downgrade from one version of qemu to another that doesn't support required machine type yet (the version user downgraded to have to have this patch applied too, of course). Signed-off-by: Michal Novotny Reviewed-by: Eric Blake --- vl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vl.c b/vl.c index f422a1c..9b4a3f9 100644 --- a/vl.c +++ b/vl.c @@ -2671,6 +2671,11 @@ static QEMUMachine *machine_parse(const char *name) if (machine) { return machine; } + + if (name && !is_help_option(name)) { + error_report("Unsupported machine type"); + } + printf("Supported machines are:\n"); for (m = first_machine; m != NULL; m = m->next) { if (m->alias) {