qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Christoph Hellwig <chellwig@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] RFC v2: blockdev_add & friends, brief rationale, QMP docs
Date: Tue, 15 Jun 2010 12:04:14 +0300	[thread overview]
Message-ID: <4C17420E.40601@redhat.com> (raw)
In-Reply-To: <m3iq5qye65.fsf@blackfin.pond.sub.org>

On 06/10/2010 08:45 PM, Markus Armbruster wrote:
> QMP command docs
> ================
>
> blockdev_add
> ------------
>
> Add host block device.
>
> Arguments:
>
> - "id": the host block device's ID, must be unique (json-string)
> - "format": image format (json-string, optional)
>      - Possible values: "raw", "qcow2", ...
> - "protocol": image access protocol (json-object, optional)
>      - Has a member "type" (json-string), and depending on its value
>        additional members
>      - For "type" = "file", [...]
>        - "file": name of image file (json-string)
>      - For "type" = "nbd":
>        - "domain": address family (json-string, optional)
>            - Possible values: "inet" (default), "unix"
>        - "file": name of socket file (json-string), only with "domain" =
>          "unix"
>        - "host": host name (json-string), only with "domain" = "inet"
>        - "port": port (json-int), only with "domain" = "inet"
>      - For "type" = "blkdebug":
>        - "config": name of config file (json-string)
>        - "protocol": image access protocol (json-object), as above
>      [...]
> - "aio": host AIO (json-string, optional)
>      - Possible values: "threads" (default), "native"
> - "cache": host cache usage (json-string, optional)
>      - Possible values: "writethrough" (default), "writeback", "unsafe",
>                         "none"
> - "readonly": open image read-only (json-bool, optional, default false)
> - "rerror": what to do on read error (json-string, optional)
>      - Possible values: "report" (default), "ignore", "stop"
> - "werror": what to do on write error (json-string, optional)
>      - Possible values: "enospc" (default), "report", "ignore", "stop"
> - "snapshot": enable snapshot (json-bool, optional, default false)
>
> Example:
>
> ->  { "execute": "blockdev_add",
>       "arguments": { "id": "blk1", "format": "raw",
>                      "protocol": { "type": "file", "file": "fedora.img" } } }
> <- { "return": {} }
>
> ->  { "execute": "blockdev_add",
>       "arguments": {
>         "id": "blk2", "format": "qcow2",
>         "protocol": {
>           "type": "blkdebug", "config": "test.blkdebug",
>           "protocol": { "type": "file", "file": "test.qcow2" }
>         }
>       }
>     }
> <- { "return": {} }
>
> Notes:
>
> (1) If argument "protocol" is missing, all other optional arguments must
>      be missing as well.  This defines a block device with no media
>      inserted.
>
> (2) In theory, the protocols form a tree.  In practice, all protocols
>      but blkdebug have no children, and blkdebug has just one.
>
> (3) It's possible to list supported disk formats by running QEMU with
>      arguments "-blockdev_add \?".
>
>
> blockdev_del
> ------------
>
> Remove a host block device.
>
> Arguments:
>
> - "id": the host block device's ID (json-string)
>
> Example:
>
> ->  { "execute": "blockdev_del", "arguments": { "id": "blk1" } }
> <- { "return": {} }
>
>
> media_insert
> ------------
>
> Insert media into an empty host block device.
>
> Arguments are exactly like blockdev_add, except "protocol" is mandatory.
>
>
> media_remove
> ------------
>
> Remove media from a host block device.
>
> Arguments:
>
> - "id": the host block device's ID (json-string)
>
> Example:
>
> ->  { "execute": "media_remove", "arguments": { "id": "blk1" } }
> <- { "return": {} }
>
>    

media_insert/remove seem to duplicate blockdev_add/del.  Perhaps we 
don't need them?

To change media, tell the guest device to eject, blockdev_del, 
blockdev_add, reassociate the guest and host parts.

To pretend you're a media changer, blockdev_add all your cds at once and 
just change the guest/host association when you want to hear a new band.

For a fake a multipath setup, blockdev_add one device, associate it with 
multiple guest interfaces.

Otherwise, looks good.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2010-06-15  9:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 17:45 [Qemu-devel] RFC v2: blockdev_add & friends, brief rationale, QMP docs Markus Armbruster
2010-06-15  9:04 ` Avi Kivity [this message]
2010-06-15 12:23   ` Markus Armbruster
2010-06-15 12:43     ` Avi Kivity
2010-06-15 13:27       ` Markus Armbruster
2010-06-15 13:40         ` Avi Kivity
2010-06-15 14:54           ` Markus Armbruster
2010-06-16  9:50             ` Avi Kivity
2010-06-16 11:02               ` Markus Armbruster
2010-06-16 11:06                 ` Avi Kivity
2010-06-15 13:44 ` [Qemu-devel] " Avi Kivity
2010-06-15 14:39   ` Gerd Hoffmann
2010-06-16 11:20   ` Kevin Wolf
2010-06-16 12:41     ` Markus Armbruster
2010-06-16 13:41       ` Anthony Liguori
2010-06-16 13:57         ` Kevin Wolf
2010-06-16 14:24           ` Christoph Hellwig
2010-06-16 14:47             ` Markus Armbruster
2010-06-16 18:07           ` Anthony Liguori
2010-06-17  8:20             ` Kevin Wolf
2010-06-17 13:01               ` Anthony Liguori
2010-06-17 14:15                 ` Kevin Wolf
2010-06-18  8:20                   ` Markus Armbruster
2010-06-18  9:36                     ` Kevin Wolf
2010-06-18  7:06                 ` 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=4C17420E.40601@redhat.com \
    --to=avi@redhat.com \
    --cc=armbru@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 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).