qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] blockdev: reset werror/rerror on drive_del


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] blockdev: reset werror/rerror on drive_del
Date: Mon, 03 Jun 2013 17:20:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 03/06/2013 16:58, Stefan Hajnoczi ha scritto:
> Paolo Bonzini <address@hidden> suggested the following test case:
> 
> 1. Launch a guest and wait at the GRUB boot menu:
> 
>   qemu-system-x86_64 -enable-kvm -m 1024 \
>    -drive if=none,cache=none,file=test.img,id=foo,werror=stop,rerror=stop
>    -device virtio-blk-pci,drive=foo,id=virtio0,addr=4
> 
> 2. Hot unplug the device:
> 
>   (qemu) drive_del foo
> 
> 3. Select the first boot menu entry
> 
> Without this patch the guest pauses due to ENOMEDIUM.  But it is not
> possible to resolve this situation - the drive has become anonymous.
> 
> With this patch the guest the guest gets the ENOMEDIUM error.
> 
> Note that this scenario actually happens sometimes during libvirt disk
> hot unplug, where device_del is followed by drive_del.  I/O may still be
> submitted to the drive after drive_del if the guest does not process the
> PCI hot unplug notification.
> 
> Reported-by: Dafna Ron <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  blockdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index d1ec99a..6eb81a3 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1180,6 +1180,10 @@ int do_drive_del(Monitor *mon, const QDict *qdict, 
> QObject **ret_data)
>       */
>      if (bdrv_get_attached_dev(bs)) {
>          bdrv_make_anon(bs);
> +
> +        /* Further I/O must not pause the guest */
> +        bdrv_set_on_error(bs, BLOCKDEV_ON_ERROR_REPORT,
> +                          BLOCKDEV_ON_ERROR_REPORT);
>      } else {
>          drive_uninit(drive_get_by_blockdev(bs));
>      }
> 

Reviewed-by: Paolo Bonzini <address@hidden>

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]