From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
mreitz@redhat.com
Subject: Re: [Qemu-devel] Review of ways to create BDSes (was: Review of monitor commands identifying BDS / BB by name)
Date: Fri, 19 Dec 2014 13:18:01 +0100 [thread overview]
Message-ID: <20141219121801.GA3724@noname.str.redhat.com> (raw)
In-Reply-To: <87mw6l9e04.fsf@blackfin.pond.sub.org>
Am 18.12.2014 um 16:25 hat Markus Armbruster geschrieben:
> = Introduction =
>
> BDSes can be opened in various ways. Some of them don't provide for
> user configuration. Some of them should.
>
> Example: -drive format=qcow2,file=foo.qcow2 where foo.qcow2 has a raw
> backing file foo.raw. This creates the the following tree of BDSes:
>
> (qcow2,foo.qcow2)
> / \
> (file,foo.qcow2) (raw,foo.raw)
> |
> (file,foo.raw)
>
> Before Kevin added driver-specific options, -drive let you configure
> basically just the root. Configuration for the others was inferred from
> the root's configuration and the images. Driver-specific options let
> you configure all the nodes. Defaults are still inferred as before.
>
> Example: blockdev-snapshot-sync provides only a small subset of the full
> configuration options for the BDS it creates. Could be fixed by
> duplicating the full options, i.e. blockdev-add's. But a command that
> just snapshots and leaves BDS creation to blockdev-add would be cleaner.
>
> This is a systematic review of all the ways you can open BDSes in qemu
> proper, i.e. not in qemu-{img,io,nbd}. I tracked them down by following
> the call chains leading to bdrv_open().
Possibly also interesting for a followup: All the ways you can reopen
BDSes with different options/flags.
> = QMP Commands =
>
> * block-commit
>
> I figure this clones the @base BDS initially, and replaces it by the
> clone finally. Is support for user configuration for this clone
> wanted?
I don't think such a clone exists. Data is directly committed to @base.
The command looks to me as if it could be okay.
> * blockdev-add
>
> Boils down to a bdrv_open(), which is discussed in the next section.
>
> * blockdev-snapshot-sync
>
> Creates a new image and a new BDS with only a few configuration
> options: @snapshot-file (the filename), @snapshot-node-name,
> @format=qcow2, @mode. Conflates three operations: create image, open
> image, snapshot. I guess we want to replace it by a basic snapshot
> operation that can be used with with blockdev-add and some command to
> create images.
Yes. We should have called this one drive-snapshot, it fits better in
the drive-* family of commands. We can call the real blockdev-style
command blockdev-snapshot - it is still synchronous technically, but it
doesn't do anything like bdrv_open() that could be blocking.
> * change
>
> Closes, then opens a BDS with just two configuration options: @target
> (the filename) and @arg (the format). Needs replacing.
Max (added to CC) is working on it.
> * drive-backup
>
> Similar to blockdev-snapshot-sync, except the filename is called
> @target, and the node name can't be configured. I guess we want to
> replace it by a basic backup operation.
>
> * drive-mirror
>
> Similar to blockdev-snapshot-sync, except the filename is called
> @target, and the node name @node-name. I guess we want to replace it
> by a basic mirror operation.
Yes. We called these drive-* instead of blockdev-* intentionally, so
that the latter names would be free for operations working on existing
BDSes.
> * transaction
>
> This is a wrapper around a list of transaction-capable commands.
> Thus, nothing new here.
>
>
> = Generic block layer =
>
> bdrv_open() opens a BDS and possibly children "file" and "backing"
> according to its configuration.
>
> Subtypes of BlockdevOptionsGenericFormat have configuration for "file".
>
> Subtypes of BlockdevOptionsGenericCOWFormat additionally have
> configuration for "backing" (defaults to "infer from COW image").
>
> bdrv_open() can additionally splice in a QCOW2 BDS to implement
> snapshot=on. No way to configure, but that's okay, because it's a
> convenience feature, and to configure you simply do the splicing
> explicitly.
>
>
> = Block driver methods =
>
> == bdrv_create() ==
>
> The BDSes created here are all internal temporaries of the method, hence
> user configuration isn't needed. Correct?
Filenames ought to be enough for everyone. Not.
But at the moment all the callers can't deal with non-filename
specifications of the image location, so that's a larger problem.
> == bdrv_file_open() ==
>
> * quorum_open()
>
> Creates / connects to its children according to configuration in
> BlockdevOptionsQuorum.
>
> * blkdebug_open()
>
> Creates / connects to its children according to configuration in
> BlockdevOptionsBlkdebug.
>
> * blkverify_open()
>
> Creates / connects to its children according to configuration in
> BlockdevOptionsBlkverify.
>
> * vvfat's enable_write_target()
>
> You don't want to know.
This would have been an interesting one for a change. ;-)
> == bdrv_open() ==
>
> * vmdk_open()
>
> Creates BDSes for its extents, configuration inferred from images.
> Looks like this needs work.
Very much so.
> = Xen =
>
> blk_connect() calls bdrv_open() under a /* setup via xenbus */ heading.
> Looks like backward compatibility crap to me.
Are you sure? But Xen is another "you don't want to know" for me.
Kevin
next prev parent reply other threads:[~2014-12-19 12:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 19:06 [Qemu-devel] Review of monitor commands identifying BDS / BB by name Markus Armbruster
2014-12-03 5:52 ` Fam Zheng
2014-12-03 11:13 ` Paolo Bonzini
2014-12-04 15:59 ` Markus Armbruster
2014-12-03 10:30 ` Kevin Wolf
2014-12-03 13:59 ` Eric Blake
2014-12-03 14:51 ` Markus Armbruster
2014-12-04 16:56 ` Markus Armbruster
2014-12-04 15:56 ` Markus Armbruster
2014-12-04 19:44 ` Eric Blake
2014-12-05 9:19 ` Kevin Wolf
2014-12-05 12:19 ` Markus Armbruster
2014-12-05 9:34 ` Markus Armbruster
2014-12-05 9:46 ` Kevin Wolf
2014-12-05 12:08 ` Markus Armbruster
2014-12-16 18:12 ` [Qemu-devel] Can we make monitor commands identify BDS / BB by name consistently? (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
2014-12-17 14:12 ` Kevin Wolf
2014-12-17 16:17 ` [Qemu-devel] Can we make monitor commands identify BDS / BB by name consistently? Markus Armbruster
2014-12-19 18:27 ` Markus Armbruster
2014-12-18 15:25 ` [Qemu-devel] Review of ways to create BDSes (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
2014-12-19 12:18 ` Kevin Wolf [this message]
2014-12-19 14:02 ` [Qemu-devel] Review of ways to create BDSes Markus Armbruster
2014-12-19 14:24 ` Markus Armbruster
2014-12-19 15:52 ` [Qemu-devel] Review of ways to reopen BDSes (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
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=20141219121801.GA3724@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@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 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).