From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/4] blockdev: Add read-only option to blockdev-change-medium
Date: Fri, 05 Dec 2014 06:28:46 -0700 [thread overview]
Message-ID: <5481B30E.1090706@redhat.com> (raw)
In-Reply-To: <1417774136-30001-4-git-send-email-mreitz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]
On 12/05/2014 03:08 AM, Max Reitz wrote:
> Add an option to qmp_blockdev_change_medium() which allows changing the
> read-only status of the block device whose medium is changed.
>
> Some drives do not have a inherently fixed read-only status; for
> instance, floppy disks can be set read-only or writable independently of
> the drive. Some users may find it useful to be able to therefore change
> the read-only status of a block device when changing the medium.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> blockdev.c | 24 +++++++++++++++++++++++-
> hmp.c | 2 +-
> qapi/block-core.json | 24 +++++++++++++++++++++++-
> qmp-commands.hx | 24 +++++++++++++++++++++++-
> qmp.c | 3 ++-
> 5 files changed, 72 insertions(+), 5 deletions(-)
Feels much nicer than v1 :)
> +2. Load a read-only medium into a writable drive
> +
> +-> { "execute": "blockdev-change-medium",
> + "arguments": { "device": "isa-fd0",
> + "filename": "/srv/images/ro.img",
> + "format": "raw",
> + "read-only": "retain" } }
> +
> +<- { "error":
> + { "class": "GenericError",
> + "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
> +
> +-> { "execute": "blockdev-change-medium",
> + "arguments": { "device": "isa-fd0",
> + "filename": "/srv/images/ro.img",
> + "format": "raw",
> + "read-only": "ro" } }
> +
> +<- { "return": {} }
Nice example.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
next prev parent reply other threads:[~2014-12-05 13:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 10:08 [Qemu-devel] [PATCH v2 0/4] blockdev: Add blockdev-change-medium with read-only option Max Reitz
2014-12-05 10:08 ` [Qemu-devel] [PATCH v2 1/4] qmp: Introduce blockdev-change-medium Max Reitz
2014-12-05 13:10 ` Eric Blake
2014-12-05 13:18 ` Max Reitz
2014-12-05 13:25 ` Eric Blake
2014-12-05 10:08 ` [Qemu-devel] [PATCH v2 2/4] hmp: Use blockdev-change-medium for change command Max Reitz
2014-12-05 13:24 ` Eric Blake
2014-12-05 13:27 ` Max Reitz
2014-12-05 13:45 ` Eric Blake
2014-12-05 10:08 ` [Qemu-devel] [PATCH v2 3/4] blockdev: Add read-only option to blockdev-change-medium Max Reitz
2014-12-05 13:28 ` Eric Blake [this message]
2014-12-05 10:08 ` [Qemu-devel] [PATCH v2 4/4] hmp: Add read-only option to change command Max Reitz
2014-12-05 13:49 ` Eric Blake
2014-12-05 13:14 ` [Qemu-devel] [PATCH v2 0/4] blockdev: Add blockdev-change-medium with read-only option Eric Blake
2014-12-05 13:25 ` Max Reitz
2014-12-05 13:31 ` Markus Armbruster
2014-12-05 13:47 ` Max Reitz
2014-12-05 14:07 ` Eric Blake
2014-12-05 14:21 ` 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=5481B30E.1090706@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@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.