From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqqBU-0007Ia-Vo for qemu-devel@nongnu.org; Mon, 16 Jul 2012 14:38:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqqBU-0003a6-02 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 14:38:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqqBT-0003Wg-OV for qemu-devel@nongnu.org; Mon, 16 Jul 2012 14:38:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6GIc0Op016659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Jul 2012 14:38:06 -0400 Date: Mon, 16 Jul 2012 14:30:57 -0300 From: Luiz Capitulino Message-ID: <20120716143057.0b1d1cbd@doriath.home> In-Reply-To: <5000A5DA.9050904@redhat.com> References: <1339575768-2557-1-git-send-email-lersek@redhat.com> <1339575768-2557-6-git-send-email-lersek@redhat.com> <20120713135136.049b9e54@doriath.home> <5000A5DA.9050904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: Paolo Bonzini , qemu-devel@nongnu.org On Sat, 14 Jul 2012 00:48:58 +0200 Laszlo Ersek wrote: > On 07/13/12 18:51, Luiz Capitulino wrote: > > On Wed, 13 Jun 2012 10:22:36 +0200 > > Laszlo Ersek wrote: > > >> Repeating an optarg is supported; > > > > I see that the current code supports this too, but why? Something > > like this should fail: > > > > -netdev type=tap,vhost=on,vhost=off,id=guest1,script=qemu-ifup-switch > > > Also, you're using a queue to support the repeating of optargs, > > right? I think this could be simplified if we just don't support > > that. > > I hate repeated options with a passion, but SLIRP's hostfwd and guestfwd > depend on repetition. Oh, I see. I think it would be nicer to have a flag for this in QemuOptsList, but that's unrelated to this series. > > This doesn't insert the opts id into the hash, so opts_type_str() > > will fail to find the id when the generated code visits it here: > > > > void visit_type_Netdev(Visitor *m, Netdev ** obj, const char *name, Error **errp) > > { > > if (!error_is_set(errp)) { > > Error *err = NULL; > > visit_start_struct(m, (void **)obj, "Netdev", name, sizeof(Netdev), &err); > > if (!err) { > > assert(!obj || *obj); > > visit_type_str(m, obj ? &(*obj)->id : NULL, "id", &err); <--------- > > [...] > > > > *groan* > > You're right. opts_do_parse() makes an exception with "id" and doesn't > call opt_set() for any occurrence of it. Would you accept the attached > fix, split up and squashed into previous parts appropriately? I've glanced at it and it looked fine, but I'll wait for v3 to do a full review again.