From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aShUl-0004Ad-2p for qemu-devel@nongnu.org; Mon, 08 Feb 2016 03:48:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aShUh-0007NK-Pw for qemu-devel@nongnu.org; Mon, 08 Feb 2016 03:48:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aShUh-0007NE-Jr for qemu-devel@nongnu.org; Mon, 08 Feb 2016 03:48:27 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id AD83E3A1171 for ; Mon, 8 Feb 2016 08:48:26 +0000 (UTC) References: <20160207123001-mutt-send-email-mst@redhat.com> From: Laszlo Ersek Message-ID: <56B85657.4070900@redhat.com> Date: Mon, 8 Feb 2016 09:48:23 +0100 MIME-Version: 1.0 In-Reply-To: <20160207123001-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] command line error handling broken? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Markus Armbruster , qemu-devel@nongnu.org, Eduardo Habkost , Marcel Apfelbaum On 02/07/16 11:32, Michael S. Tsirkin wrote: > ./x86_64-softmmu/qemu-system-x86_64 -M q35-1.5 -redir tcp:8022::22 > > qemu-system-x86_64: -redir tcp:8022::22: unsupported machine type > Use -machine help to list supported machines > > It should say q35-1.5 is unsupported, of course. > > Anyone knows what's going on? > Don't know what triggered it (and when), but the following should fix it: > diff --git a/vl.c b/vl.c > index c581e39..0830f98 100644 > --- a/vl.c > +++ b/vl.c > @@ -4031,7 +4031,12 @@ int main(int argc, char **argv, char **envp) > opts = qemu_get_machine_opts(); > optarg = qemu_opt_get(opts, "type"); > if (optarg) { > + Location loc; > + > + loc_push_none(&loc); > + qemu_opts_loc_restore(opts); > machine_class = machine_parse(optarg); > + loc_pop(&loc); > } > > if (machine_class == NULL) { The problem is probably that the last location has moved farther due to the option parsing loop, by the time we realize this error. So the location should be restored for error reporting. Thanks Laszlo