All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, kwolf@redhat.com, jdurgin@redhat.com,
	jcody@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH] rbd: Don't convert keypairs to JSON and back
Date: Wed, 25 Jul 2018 17:01:44 +0100	[thread overview]
Message-ID: <20180725160144.GJ12855@redhat.com> (raw)
In-Reply-To: <5e713599-997f-7dda-917c-80902f6ef328@redhat.com>

On Wed, Jul 25, 2018 at 10:56:48AM -0500, Eric Blake wrote:
> On 07/25/2018 10:10 AM, Markus Armbruster wrote:
> > qemu_rbd_parse_filename() builds a keypairs QList, converts it to JSON, and
> > stores the resulting QString in a QDict.
> > 
> > qemu_rbd_co_create_opts() and qemu_rbd_open() get the QString from the
> > QDict, pass it to qemu_rbd_set_keypairs(), which converts it back into
> > a QList.
> > 
> > Drop both conversions, store the QList instead.
> > 
> > This affects output of qemu-img info.  Before this patch:
> > 
> >      $ qemu-img info rbd:rbd/testimg.raw:mon_host=192.168.15.180:rbd_cache=true:conf=/tmp/ceph.conf
> >      [junk printed by Ceph library code...]
> >      image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "testimg.raw", "conf": "/tmp/ceph.conf", "driver": "rbd", "=keyvalue-pairs": "[\"mon_host\", \"192.168.15.180\", \"rbd_cache\", \"true\"]"}}
> >      [more output, not interesting here]
> > 
> > After this patch, we get
> > 
> >      image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "testimg.raw", "conf": "/tmp/ceph.conf", "driver": "rbd", "=keyvalue-pairs": ["mon_host", "192.168.15.180", "rbd_cache", "true"]}}
> > 
> > The value of member "=keyvalue-pairs" changes from a string containing
> > a JSON array to that JSON array.  That's an improvement of sorts.  However:
> > 
> > * Should "=keyvalue-pairs" even be visible here?  It's supposed to be
> >    purely internal...
> 
> I'd argue that since it is supposed to be internal (as evidenced by the
> leading '=' that does not name a normal variable), changing it doesn't hurt
> stability. But yes, it would be nicer if we could filter it entirely so that
> it does not appear in json: output, if it doesn't truly affect the contents
> that the guest would see.

If it appears in the json: output, then that means it could get written
into qcow2 headers as a backing file name, which would make it ABI
sensitive. This makes it even more important to filter it if it is supposed
to be internal only, with no ABI guarantee.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2018-07-25 16:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 15:10 [Qemu-devel] [RFC PATCH] rbd: Don't convert keypairs to JSON and back Markus Armbruster
2018-07-25 15:44 ` no-reply
2018-07-25 15:56 ` Eric Blake
2018-07-25 16:01   ` Daniel P. Berrangé [this message]
2018-07-28  4:32     ` Jeff Cody
2018-07-29 14:51       ` Max Reitz
2018-08-15  8:12         ` Markus Armbruster
2018-08-15 13:39           ` Jeff Cody
2018-08-16  6:13             ` Markus Armbruster
2018-08-15 23:55           ` Max Reitz
2018-08-16  6:40             ` Markus Armbruster
2018-08-17 20:17               ` Max Reitz
2018-08-20  6:38                 ` Markus Armbruster
2018-08-20 12:24                   ` Max Reitz
2018-07-28  4:23   ` Jeff Cody
2018-07-30  8:20     ` Markus Armbruster
2018-07-25 16:20 ` no-reply

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=20180725160144.GJ12855@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jdurgin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.