All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v1 01/10] qdict: implement a qdict_crumple method for un-flattening a dict
Date: Mon, 7 Mar 2016 08:49:46 -0700	[thread overview]
Message-ID: <56DDA31A.4010503@redhat.com> (raw)
In-Reply-To: <20160307150629.GD13034@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]

On 03/07/2016 08:06 AM, Daniel P. Berrange wrote:

> So looking at the current usage of qdict_flatten,  qdict_extract_subqdict,
> qdict_array_split and qdict_array_entries, it is basically only the block
> layer.
> 
> The root cause of this usage all stems from that fact that historically
> the block layer was driven off QemuOpts CLI args which are a flat data
> structure. Over time we've tried to bolt on recursive data structure
> support, but the main APIs are still accepting QDicts whose contents are
> flat. Increasingly I see the internal code is based on QAPI which is an
> inherantly nested data structure, as a result the block layer is getting
> more & more places where it has to process the flat data structure to
> extract nested bits (qdict_extract_subqdict, qdict_array_entries and
> qdict_array_split). Conversely when fed data coming from QMP it has to
> flatten the data structure with qdict_flatten.
> 
> With this new qdict_crumple() method (or equivalently you qdict_unflatten)
> it strikes me we can significantly simplify the block layer to always use
> a nested QDict internally. All that would be required is to call the
> qdict_crumple() method in the places which have the flat QemuOpts derived
> QDict. At that point we would potentially be able to delete all of
> qdict_flatten, qdict_extract_subqdict, qdict_array_split and
> qdict_array_entries
> 
> Of course I'm not suggesting we do that for 2.6, but it actually doesn't
> look like it would be that hard todo this conversion.

Agreed that it's too late for 2.6, but would make a good project for
2.7.  For that matter, rather than passing a QDict around, I'd like to
see if we could just directly use the QAPI types instead (the way you
just recently converted from QDict to SocketAddress).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-03-07 15:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 16:47 [Qemu-devel] [PATCH v1 00/10] Provide a QOM-based authorization API Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 01/10] qdict: implement a qdict_crumple method for un-flattening a dict Daniel P. Berrange
2016-02-19 17:01   ` Eric Blake
2016-02-19 17:08     ` Daniel P. Berrange
2016-03-02 16:13   ` Max Reitz
2016-03-03 11:01     ` Daniel P. Berrange
2016-03-05 15:15       ` Max Reitz
2016-03-07 15:06         ` Daniel P. Berrange
2016-03-07 15:49           ` Eric Blake [this message]
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 02/10] qapi: allow QmpInputVisitor to auto-cast types Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 03/10] qom: support arbitrary non-scalar properties with -object Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 04/10] util: add QAuthZ object as an authorization base class Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 05/10] util: add QAuthZSimple object type for a simple access control list Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 06/10] acl: delete existing ACL implementation Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 07/10] qemu-nbd: add support for ACLs for TLS clients Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 08/10] nbd: allow an ACL to be set with nbd-server-start QMP command Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 09/10] chardev: add support for ACLs for TLS clients Daniel P. Berrange
2016-02-19 16:47 ` [Qemu-devel] [PATCH v1 10/10] vnc: allow specifying a custom ACL object name Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DDA31A.4010503@redhat.com \
    --to=eblake@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.