[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RESEND 43/50] blockdev: Implement change with ba
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RESEND 43/50] blockdev: Implement change with basic operations |
Date: |
Wed, 28 Jan 2015 13:30:41 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 01/27/2015 12:46 PM, Max Reitz wrote:
> Implement 'change' on block devices by calling blockdev-open-tray,
> blockdev-remove-medium, blockdev-insert-medium (a variation of that
> which does not need a node-name) and blockdev-close-tray.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> blockdev.c | 191
> +++++++++++++++++++++++--------------------------------------
> 1 file changed, 72 insertions(+), 119 deletions(-)
>
> +
> + qmp_blockdev_open_tray(device, false, false, &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> +
> + qmp_blockdev_remove_medium(device, &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> +
> + qmp_blockdev_insert_anon_medium(device, medium_bs, &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> +
> + qmp_blockdev_close_tray(device, errp);
So if we fail anywhere in the middle, the device is left in an
unspecified state, and a followup query-block would be needed to learn
where we failed. I guess that's life when you use a high-level command
instead of chaining low-level ones yourself. I can live with it.
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 RESEND 40/50] blockdev: Add blockdev-remove-medium, (continued)
- [Qemu-devel] [PATCH RESEND 40/50] blockdev: Add blockdev-remove-medium, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 46/50] hmp: Use blockdev-change-medium for change command, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 45/50] qmp: Introduce blockdev-change-medium, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 42/50] blockdev: Implement eject with basic operations, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 43/50] blockdev: Implement change with basic operations, Max Reitz, 2015/01/27
- Re: [Qemu-devel] [PATCH RESEND 43/50] blockdev: Implement change with basic operations,
Eric Blake <=
- [Qemu-devel] [PATCH RESEND 47/50] blockdev: Add read-only option to blockdev-change-medium, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 44/50] block: Inquire tray state before tray-moved events, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 49/50] iotests: More options for VM.add_drive(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 50/50] iotests: Add test for change-related QMP commands, Max Reitz, 2015/01/27