From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwnOm-00008P-SY for qemu-devel@nongnu.org; Wed, 19 Oct 2016 05:43:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwnOl-0000st-VL for qemu-devel@nongnu.org; Wed, 19 Oct 2016 05:43:00 -0400 Date: Wed, 19 Oct 2016 10:42:50 +0100 From: "Daniel P. Berrange" Message-ID: <20161019094249.GJ11194@redhat.com> Reply-To: "Daniel P. Berrange" References: <1475246744-29302-1-git-send-email-berrange@redhat.com> <1475246744-29302-14-git-send-email-berrange@redhat.com> <87fuo0a0kl.fsf@dusky.pond.sub.org> <20161013144640.GN5803@noname.redhat.com> <87a8e3av2r.fsf@dusky.pond.sub.org> <20161018093423.GA4706@noname.str.redhat.com> <87eg3dk6u9.fsf@dusky.pond.sub.org> <20161019092527.GD5336@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161019092527.GD5336@noname.redhat.com> Subject: Re: [Qemu-devel] [PATCH v14 13/21] qdict: allow qdict_crumple to accept compound types as values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Markus Armbruster , Paolo Bonzini , Max Reitz , Andreas =?utf-8?Q?F=C3=A4rber?= , qemu-block@nongnu.org, qemu-devel@nongnu.org On Wed, Oct 19, 2016 at 11:25:27AM +0200, Kevin Wolf wrote: > Am 18.10.2016 um 17:35 hat Markus Armbruster geschrieben: > > Kevin Wolf writes: > > > Of course, you could argue that flat QDicts are the wrong data structure > > > in the first place and instead of flatting everything we should have > > > done the equivalent of qdict_crumple from the beginning, but they were > > > the natural extension of what was already there and happened to work > > > good enough, so this is what we're currently using. > > > > We didn't "flatten everything", because QemuOpts is and has always been > > flat to begin with. Rather we've started to crumple a few things, and > > in a separate layer. > > That's the QemuOpts point of view. > > I was talking from a block layer view. There we get data in two > different formats, QMP and the command line. The first is structured, > the second is flat. We need to make both uniform before we can pass them > to the actual block layer functions. > > The current code chose to flatten what we get from QMP blockdev-add and > use that throughout the block layer. We could instead have decided that > we leave the blockdev-add input as it is, crumple what we get from > QemuOpts and use nested QObjects throughout the block layer. I would very much like to see BlockdevOptions structs passed around the block drivers, instead of QemuOpts - I think it'd lead to much clearer code than the QemuOpts stuff we have today IMHO Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|