]> git.ipfire.org Git - thirdparty/qemu.git/commit
blockdev: reset werror/rerror on drive_del
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 5 Jun 2013 08:33:14 +0000 (10:33 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 13 Jun 2013 15:32:41 +0000 (10:32 -0500)
commit58101748657072985a6a0e23f426be5426fd76f7
tree3ad351cc29c4a70c52667e783e33fa7f5d971427
parenteeaa8d33e444ef6bbf2a10bde43aaf079db8d4df
blockdev: reset werror/rerror on drive_del

Paolo Bonzini <pbonzini@redhat.com> 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.  The guest is
stuck in a continuous pause loop since the I/O request is retried and
fails immediately again when the guest is resumed.

With this patch the error is reported to the guest.

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 <dron@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 293c51a6ee369228633a8428ab689f14c045ff98)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
blockdev.c
hmp-commands.hx