From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Christoph Hellwig <chellwig@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>, Avi Kivity <avi@redhat.com>
Subject: [Qemu-devel] Re: RFC: blockdev_add & friends, brief rationale, QMP docs
Date: Fri, 04 Jun 2010 16:16:12 +0200 [thread overview]
Message-ID: <m3aarayjbn.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <m34ohryjib.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Fri, 28 May 2010 20:21:48 +0200")
Discussion with Christoph and Kevin uncovered yet another issue:
protocols. I find it pretty confusing, but let me try to describe it
anyway; Christoph and Kevin, please correct my errors.
A host block device has a format. A format has a name.
Below the format, it has a stack of protocols. A protocol has a name
(with one exception), and may have protocol-specific arguments.
The most basic (and most commonly used) protocol is for accessing a
file. Its argument is a file name. It doesn't have a name. Which
makes for ugly prose, so I'll call it "file".
Stacking protocols is somewhat exotic. Think of stacking blkdebug on
top of another protocol, say nbd.
Our abstraction for formats is struct BlockDriver.
Our abstraction for protocols is also struct BlockDriver. Except for
the special protocol "file", but that's detail.
Examples:
-drive file=foo.qcow2,format=qcow2
Format "qcow2", protocol "file" with argument filename "foo.img"
-drive file=nbd:unix:/tmp/my_socket,format=raw
Format "raw", protocol "nbd" with arguments domain "unix", filename
"/tmp/my_socket"
-drive blkdebug:/tmp/blkdebug.cfg:fat:floppy:rw:/tmp/dir
Format not specified (system guesses one), protocol "blkdebug" with
argument filename "/tmp/blkdebug.cfg" stacked onto protocol "fat" with
arguments floppy true, dirname "/tmp/dir"
You see that -drive has a separate option for format, but has protocols
encoded in option file, in their own mini-language. Doesn't work for
arbitrary filenames. Besides, mini-languages to encode options in
strings are quite inappropriate for QMP.
So we need something cleaner for QMP. Here's a sketch. Instead of
- "file": the disk image file to use (json-string, optional)
- "format": disk format (json-string, optional)
- Possible values: "raw", "qcow2", ...
have
- "format": disk format (json-string, optional)
- Possible values: "raw", "qcow2", ...
- "protocol": json-array of json-object
Each element object has a member "name"
- Possible values: "file", "nbd", ...
Additional members depend on the value of "name".
For "name" = "file":
- "file": file name (json-string)
For "name" = "nbd":
- "domain": address family (json-string, optional)
- Possible values: "inet" (default), "unix"
- "file": file name (json-string), only with "domain" = "unix"
- "host": host name (json-string), only with "domain" = "inet"
- "port": port (json-int), only with "domain" = "inet"
...
You get the idea.
Comments?
next prev parent reply other threads:[~2010-06-04 14:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 18:21 [Qemu-devel] RFC: blockdev_add & friends, brief rationale, QMP docs Markus Armbruster
2010-05-28 19:13 ` [Qemu-devel] " Kevin Wolf
2010-05-28 19:17 ` Anthony Liguori
2010-05-28 19:24 ` Luiz Capitulino
2010-05-30 9:11 ` Avi Kivity
2010-05-31 11:05 ` Markus Armbruster
2010-05-31 13:48 ` Luiz Capitulino
2010-05-31 14:04 ` Kevin Wolf
2010-05-30 9:09 ` Avi Kivity
2010-05-31 10:54 ` Markus Armbruster
2010-05-31 11:23 ` Avi Kivity
2010-05-31 11:50 ` Markus Armbruster
2010-06-04 14:16 ` Markus Armbruster [this message]
2010-06-04 14:32 ` Kevin Wolf
2010-06-04 15:53 ` Markus Armbruster
2010-06-04 16:20 ` Kevin Wolf
2010-06-06 8:23 ` Avi Kivity
2010-06-08 9:41 ` 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=m3aarayjbn.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=avi@redhat.com \
--cc=chellwig@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@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.