Bug 802752 - [virtio-scsi] after hot-unplug a virtio-scsi disk rescan scsi bus qemu reports I/O error
[virtio-scsi] after hot-unplug a virtio-scsi disk rescan scsi bus qemu repor...
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.3
x86_64 Linux
medium Severity high
: rc
: ---
Assigned To: Paolo Bonzini
Virtualization Bugs
:
Depends On:
Blocks: 769712 857935 889075
  Show dependency treegraph
 
Reported: 2012-03-13 08:45 EDT by daiwei
Modified: 2013-01-09 19:46 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-18 23:53:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description daiwei 2012-03-13 08:45:34 EDT
Description of problem:

Boot guest with a data disk,then remove this data disk.Reboot guest or rescan scsi bus in guest, qemu will report "block I/O error in device '': No medium found (123)"


Version-Release number of selected component (if applicable):
# uname -r;rpm -q qemu-kvm
2.6.32-250.el6.x86_64
qemu-kvm-0.12.1.2-2.241.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with a data disk
/usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -name RHEL-Server-6.3-64 -smp 2 -m 4G -uuid 4bbfae8f-0d08-41ad-926a-c7a7568d50f7 -boot menu=on -drive file=/home/rhel6.3-64.raw,if=none,id=drive-virtio-disk0,format=raw,cache=none,media=disk,werror=stop,rerror=stop -device virtio-scsi-pci,id=virtio-scsi-pci0,bus=pci.0,addr=0x5 -device scsi-hd,drive=drive-virtio-disk0,logical_block_size=512,physical_block_size=4096,scsi-id=0,lun=0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=44:37:E6:5E:A3:F2,bus=pci.0,addr=0x4,id=net0 -vnc :1 -balloon none -monitor stdio -usb -usbdevice tablet -drive file=/home/test.raw,if=none,id=testdisk -device virtio-scsi-pci,id=databus -device scsi-hd,drive=testdisk,scsi-id=0,lun=1
2.remove the data disk 
(qemu) __com.redhat_drive_del testdisk
3.reboot guest or rescan scsi bus in guest
  
Actual results:
1.qemu report block I/O error:
(qemu) block I/O error in device '': No medium found (123)
block I/O error in device '': No medium found (123)
block I/O error in device '': No medium found (123)
block I/O error in device '': No medium found (123)

2.in guest
# cat /var/log/messages |grep -i error|grep sdb
Mar 13 20:10:35 localhost kernel: end_request: I/O error, dev sdb, sector 0
Mar 13 20:10:35 localhost kernel: Buffer I/O error on device sdb, logical block 0
Mar 13 20:10:35 localhost kernel: end_request: I/O error, dev sdb, sector 0
Mar 13 20:10:35 localhost kernel: Buffer I/O error on device sdb, logical block 0


Expected results:
qemu should not report error
no error in guest's /var/log/messages

Additional info:
1.Data disk on different target/controller have the same results.
2.Remove controller(virtio-scsi-pci) no this issue.
  (qemu) device_del databus
Comment 2 Paolo Bonzini 2012-03-16 14:02:13 EDT
This is not a bug, the same happens if you do drive_del with an IDE or even virtio disk for example.  You also need to do device_del on the scsi-hd device.

Please test that libvirt does unplug correctly, however.
Comment 3 daiwei 2012-03-18 23:53:46 EDT
"-device scsi-hd,drive=testdisk,scsi-id=0,lun=1" also should have a ID like "-device scsi-hd,drive=testdisk,scsi-id=0,lun=1,id=datadisk",then can use device_del to delete scsi-hd device.

Thanks Paolo.

Note You need to log in before you can comment on or make changes to this bug.