From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blxQr-0008I3-16 for qemu-devel@nongnu.org; Mon, 19 Sep 2016 08:12:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blxQm-0003p0-7o for qemu-devel@nongnu.org; Mon, 19 Sep 2016 08:12:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blxQm-0003ol-2L for qemu-devel@nongnu.org; Mon, 19 Sep 2016 08:12:16 -0400 Date: Mon, 19 Sep 2016 13:12:11 +0100 From: "Daniel P. Berrange" Message-ID: <20160919121211.GN15201@redhat.com> Reply-To: "Daniel P. Berrange" References: <1474286310-6922-1-git-send-email-berrange@redhat.com> <1474286310-6922-7-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1474286310-6922-7-git-send-email-berrange@redhat.com> Subject: Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Max Reitz , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Paolo Bonzini , Andreas =?utf-8?Q?F=C3=A4rber?= , Kevin Wolf On Mon, Sep 19, 2016 at 12:58:30PM +0100, Daniel P. Berrange wrote: > The current -object command line syntax only allows for > creation of objects with scalar properties, or a list > with a fixed scalar element type. Objects which have > properties that are represented as structs in the QAPI > schema cannot be created using -object. > > This is a design limitation of the way the OptsVisitor > is written. It simply iterates over the QemuOpts values > as a flat list. The support for lists is enabled by > allowing the same key to be repeated in the opts string. > > It is not practical to extend the OptsVisitor to support > more complex data structures while also maintaining > the existing list handling behaviour that is relied upon > by other areas of QEMU. > > Fortunately there is no existing object that implements > the UserCreatable interface that relies on the list > handling behaviour, so it is possible to swap out the > OptsVisitor for a different visitor implementation, so > -object supports non-scalar properties, thus leaving > other users of OptsVisitor unaffected. Urgh, I've just discovered that this is not in fact true. The 'memory-backend' object type uses uint16List which has the hacky list syntax -object memory-backend-ram,\ id=ram-node2,size=24578621440,policy=bind,\ host-nodes=1-2,host-nodes=5,host-nodes=7, So I'll need to figure out a way to preserve this syntax... Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|