[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/4] blockdev: Add read-only option to blockd
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v2 4/4] hmp: Add read-only option to change command, Max Reitz, 2014/12/05
Re: [Qemu-devel] [PATCH v2 0/4] blockdev: Add blockdev-change-medium with read-only option, Eric Blake, 2014/12/05
Re: [Qemu-devel] [PATCH v2 0/4] blockdev: Add blockdev-change-medium with read-only option, Markus Armbruster, 2014/12/05