qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, pkrempa@redhat.com, qemu-devel@nongnu.org,
	mreitz@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema
Date: Mon, 15 Jan 2018 13:51:46 +0000	[thread overview]
Message-ID: <20180115135146.GJ8218@redhat.com> (raw)
In-Reply-To: <20180115133848.GD32271@localhost.localdomain>

On Mon, Jan 15, 2018 at 02:38:48PM +0100, Kevin Wolf wrote:
> Am 12.01.2018 um 11:53 hat Daniel P. Berrange geschrieben:
> > On Thu, Jan 11, 2018 at 08:52:17PM +0100, Kevin Wolf wrote:
> > > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > > ---
> > >  qapi/block-core.json | 33 ++++++++++++++++++++++++++++++++-
> > >  1 file changed, 32 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > > index 1749376c61..9341f6708d 100644
> > > --- a/qapi/block-core.json
> > > +++ b/qapi/block-core.json
> > > @@ -3320,6 +3320,37 @@
> > >  { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
> > >  
> > >  ##
> > > +# @BlockdevQcow2CompatLevel:
> > > +# @0_10:    The original QCOW2 format as introduced in qemu 0.10 (version 2)
> > > +# @1_1:     The extended QCOW2 format as introduced in qemu 1.1 (version 3)
> > > +#
> > > +# Since: 2.10
> > > +##
> > > +{ 'enum': 'BlockdevQcow2CompatLevel',
> > > +  'data': [ '0_10', '1_1' ] }
> > > +
> > > +
> > > +##
> > > +# @BlockdevCreateOptionsQcow2:
> > > +#
> > > +# Driver specific image creation options for qcow2.
> > > +#
> > > +# TODO Describe fields
> > > +#
> > > +# Since: 2.12
> > > +##
> > > +{ 'struct': 'BlockdevCreateOptionsQcow2',
> > > +  'data': { 'size':             'size',
> > > +            '*compat':          'BlockdevQcow2CompatLevel',
> > > +            '*backing-file':    'str',
> > > +            '*backing-fmt':     'BlockdevDriver',
> > 
> > For anything non-trivial, the caller is going to have to stuff a
> > JSON string into 'backing-file' value. It feels like we should
> > be referencing 'BlockdevOptions' here in some manner.
> 
> Hm, that's an interesting question. For the image creation, this is
> really treated as a string that is directly written into the image file,
> without being parsed, so 'str' is the more correct type in this context.
> However, when the backing file gets loaded, that string is in fact
> parsed and we expect it to describe the same thing as BlockdevOptions.
> 
> If we get BlockdevOptions here, qemu would have to convert them into a
> json:{...} string before writing the header of the new image.
> Compatibility code would become a bit more complex because we'd have to
> convert the existing string into BlockdevOptions, only to convert it
> back to a string before we write it to the image file. And finally, the
> 1023 character limit of qcow2 becomes kind of unpredicatble when you
> don't pass the string yourself.
> 
> So considering all of that, I still think that 'str' is the better
> option here.

Hmm, when we write the backing chain into the qcow2 header, we only want to
write the 1st level of the backing chain.

When we are creating the new qcow2 image, we could be pointing to a backing
chain that goes many levels deep. So the actual creation process potentially
needs to be given the full arbitrarily deep backing file eg in order that
we can set 'encrypt.secret' for any encrypted images at at arbitrary level.

IOW, I think we need to be able to pass BlockdevOptions here to specify the
full deep chain, but then only the 1st level of these BlockdevOptions should
get written into the qcow2 file header.

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-01-15 13:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 19:52 [Qemu-devel] [RFC PATCH 00/10] x-blockdev-create for qcow2 Kevin Wolf
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 01/10] block/qapi: Introduce BlockdevCreateOptions Kevin Wolf
2018-01-16 18:54   ` Eric Blake
2018-01-16 19:58     ` Kevin Wolf
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema Kevin Wolf
2018-01-12 10:53   ` Daniel P. Berrange
2018-01-15 13:38     ` Kevin Wolf
2018-01-15 13:51       ` Daniel P. Berrange [this message]
2018-01-15 14:07         ` Kevin Wolf
2018-01-15 14:11           ` Daniel P. Berrange
2018-01-16 18:59   ` Eric Blake
2018-01-16 20:11     ` Kevin Wolf
2018-01-16 20:27       ` Eric Blake
2018-01-29 16:57   ` Max Reitz
2018-01-29 18:06     ` Kevin Wolf
2018-01-29 18:06       ` Max Reitz
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 03/10] qcow2: Let qcow2_create() handle protocol layer Kevin Wolf
2018-01-16 19:03   ` Eric Blake
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2() Kevin Wolf
2018-01-16 19:21   ` Eric Blake
2018-01-29 17:12   ` Max Reitz
2018-01-29 18:10     ` Kevin Wolf
2018-01-29 18:11       ` Max Reitz
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 05/10] qcow2: Use BlockdevRef in qcow2_create2() Kevin Wolf
2018-01-16 19:35   ` Eric Blake
2018-01-29 17:30   ` Max Reitz
2018-01-29 18:14     ` Kevin Wolf
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 06/10] qcow2: Use QCryptoBlockCreateOptions " Kevin Wolf
2018-01-16 19:37   ` Eric Blake
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 07/10] qcow2: Handle full/falloc preallocation " Kevin Wolf
2018-01-16 19:40   ` Eric Blake
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered() Kevin Wolf
2018-01-16 19:45   ` Eric Blake
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 09/10] qcow2: Use visitor for options in qcow2_create() Kevin Wolf
2018-01-16 19:59   ` Eric Blake
2018-01-11 19:52 ` [Qemu-devel] [RFC PATCH 10/10] block: x-blockdev-create QMP command Kevin Wolf
2018-01-16 20:06   ` Eric Blake
2018-01-17 17:50   ` Kevin Wolf
2018-01-11 20:40 ` [Qemu-devel] [RFC PATCH 00/10] x-blockdev-create for qcow2 no-reply
2018-01-11 20:40 ` no-reply
2018-01-16 10:23 ` Kevin Wolf
2018-01-29 18:23 ` Max Reitz

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=20180115135146.GJ8218@redhat.com \
    --to=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pkrempa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).