All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 12/22] block: Allow recursive "file"s
Date: Fri, 13 Dec 2013 22:21:39 +0100	[thread overview]
Message-ID: <20131213212139.GK3916@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <52AB6FE2.2070903@redhat.com>

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

Am 13.12.2013 um 21:36 hat Eric Blake geschrieben:
> On 12/13/2013 01:19 PM, Kevin Wolf wrote:
> > Am 13.12.2013 um 18:10 hat Max Reitz geschrieben:
> >> It should be possible to use a format as a driver for a file which in
> >> turn requires another file, i.e., nesting file formats.
> >>
> >> Signed-off-by: Max Reitz <mreitz@redhat.com>
> > 
> > Hm, does this do what I think it does?
> 
> That depends on what you think it's doing :)
> 
> > 
> > $ ./qemu-img convert -O qcow2 /home/kwolf/images/hd.img /tmp/hd.qcow2
> > $ ./qemu-img convert -f raw -O qcow2 /tmp/hd.qcow2 /tmp/hd.qcow2.qcow2
> > $ x86_64-softmmu/qemu-system-x86_64 -drive driver=qcow2,file.driver=qcow2,file.file.driver=file,file.file.filename=/tmp/hd.qcow2.qcow2
> > 
> > I can't decide whether this is awesomeness or insanity, but in any case
> > it works with this patch. :-)
> 
> So if I understood your example, you just created a qcow2 file, where
> the non-metadata contents of that file are themselves a qcow2 data format.
> 
> Oh my.

Hehe, that was exactly my first thought as well.

But if we're serious about the direction that we're taking with
blockdev-add - that is, letting the user build his graph of block
drivers - then this is something we have to allow. It's just a proof
that we do provide the flexibility we had in mind.

> This could get nasty if someone ever wanted to try to get
> libvirt to feed the nested contents to a guest (right now, libvirt has a
> hard-coded assumption that qcow2 files only ever wrap raw data in the
> non-metadata portion; there's no easy way to represent in the libvirt
> storage volume XML a file where you want the nested guest contents of
> qcow2 data wrapped inside the non-metadata portion of an outermost qcow2
> file).

I don't think there's a good use case for nested qcow2, so I wouldn't
expect libvirt to implement this. Until the first user comes up with a
use case, of course. And like with everything scary that we assume
nobody will ever do, someone will turn up eventually...

> I guess it's not much different from a raw block device that has a
> partition table, then in the first partition, you recursively add
> another partition table (which is what you get when you hand one
> partition of a host block device to the guest, and the guest then
> partitions what it thinks is a full disk).  And libguestfs is able to
> see through nested partition tables, so on that front, the functionality
> is similar.
> 
> Of course, the recursion has its use for blkverify and blkdebug, but
> maybe (for our sanity) it would be worth preventing nesting across any
> format that has metadata wrapping contents.

I don't think qemu should prevent it. The architecture we want to have
in the end doesn't really distinguish between formats and filters, there
are only drivers. And technically there is nothing that allowing this
breaks.

libvirt, on the other hand, can probably expose something simpler. But
as we discussed on KVM Forum, it's not unlikely that you'll have to have
your own blockdev project sooner or later because users will want to
have some of the flexibility - and then maybe nesting qcow2 falls out as
naturally as it does in qemu now.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-12-13 21:21 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 17:10 [Qemu-devel] [PATCH v3 00/21] blkdebug/blkverify: Allow QMP configuration Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 01/22] blkdebug: Use errp for read_config() Max Reitz
2013-12-13 18:59   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 02/22] blkdebug: Don't require sophisticated filename Max Reitz
2013-12-13 19:00   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 03/22] qdict: Add qdict_array_split() Max Reitz
2013-12-13 19:00   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 04/22] qapi: extend qdict_flatten() for QLists Max Reitz
2013-12-13 19:01   ` Kevin Wolf
2013-12-13 20:04   ` Eric Blake
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 05/22] qdict: Remove delete from qdict_flatten_qdict() Max Reitz
2013-12-13 18:58   ` Kevin Wolf
2013-12-14  0:05     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 06/22] qemu-option: Add qemu_config_parse_qdict() Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 07/22] blkdebug: Always call read_config() Max Reitz
2013-12-13 19:04   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 08/22] blkdebug: Use command-line in read_config() Max Reitz
2013-12-13 19:48   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 09/22] block: Allow reference for bdrv_file_open() Max Reitz
2013-12-13 19:54   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 10/22] block: Pass reference to bdrv_file_open() Max Reitz
2013-12-13 19:56   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 11/22] block: Allow block devices without files Max Reitz
2013-12-13 20:06   ` Kevin Wolf
2013-12-14  0:10     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 12/22] block: Allow recursive "file"s Max Reitz
2013-12-13 20:19   ` Kevin Wolf
2013-12-13 20:36     ` Eric Blake
2013-12-13 21:21       ` Kevin Wolf [this message]
2013-12-14  0:16     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 13/22] qemu-iotests: Fix output of test 051 Max Reitz
2013-12-13 20:21   ` Eric Blake
2013-12-13 20:21   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 14/22] blockdev: Move "file" to legacy_opts Max Reitz
2013-12-13 20:27   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 15/22] blkdebug: Allow command-line file configuration Max Reitz
2013-12-13 20:36   ` Kevin Wolf
2013-12-13 23:57     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 16/22] blkdebug: Make filename optional Max Reitz
2013-12-13 20:43   ` Kevin Wolf
2013-12-14  0:27     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 17/22] blkverify: Allow command-line configuration Max Reitz
2013-12-13 20:46   ` Kevin Wolf
2013-12-14  0:22     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 18/22] blkverify: Don't require protocol filename Max Reitz
2013-12-13 20:47   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 19/22] blkdebug: Alias "errno" as "error" Max Reitz
2013-12-13 20:49   ` Kevin Wolf
2013-12-13 21:00     ` Eric Blake
2013-12-13 21:23       ` Kevin Wolf
2013-12-13 23:59       ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 20/22] qapi: QMP interface for blkdebug and blkverify Max Reitz
2013-12-13 20:54   ` Kevin Wolf
2013-12-13 21:03     ` Eric Blake
2013-12-14  0:20     ` Max Reitz
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 21/22] qemu-io: Make filename optional Max Reitz
2013-12-13 20:57   ` Kevin Wolf
2013-12-13 17:10 ` [Qemu-devel] [PATCH v5 22/22] iotests: Test new blkdebug/blkverify interface Max Reitz
2013-12-13 21:08   ` Kevin Wolf
2013-12-14  0:01     ` Max Reitz
2013-12-13 17:15 ` [Qemu-devel] [PATCH v3 00/21] blkdebug/blkverify: Allow QMP configuration 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=20131213212139.GK3916@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.