From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkEu3-0003iJ-E4 for qemu-devel@nongnu.org; Wed, 05 Jun 2013 10:41:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkEtz-0005bj-Bx for qemu-devel@nongnu.org; Wed, 05 Jun 2013 10:41:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkEtz-0005bU-3e for qemu-devel@nongnu.org; Wed, 05 Jun 2013 10:41:27 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r55EfPqB026597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Jun 2013 10:41:26 -0400 Date: Wed, 5 Jun 2013 16:41:24 +0200 From: Stefan Hajnoczi Message-ID: <20130605144124.GA352@stefanha-thinkpad.muc.redhat.com> References: <1370421194-27049-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370421194-27049-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] blockdev: reset werror/rerror on drive_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Markus Armbruster , dron@redhat.com On Wed, Jun 05, 2013 at 10:33:14AM +0200, Stefan Hajnoczi wrote: > Paolo Bonzini 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 > Signed-off-by: Stefan Hajnoczi > --- > blockdev.c | 4 ++++ > hmp-commands.hx | 2 ++ > 2 files changed, 6 insertions(+) Applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan