Bug 1095609

Summary: qemu-kvm should give some hint when hot-plug a devices with the same existing "scsi-id and lun"
Product: Red Hat Enterprise Linux 6 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: bsarathy, chayang, famz, flang, juzhang, michen, mkenneth, qiguo, qzhang, rbalakri, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.432.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1095606 Environment:
Last Closed: 2014-10-14 06:58:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1095606, 1096576    
Bug Blocks:    

Description Jun Li 2014-05-08 07:25:42 UTC
+++ This bug was initially created as a clone of Bug #1095606 +++

Description of problem:
when hot-plug a devices with the same existing "scsi-id  and lun", qemu-kvm can not give any error message or qemu-kvm should forbid this operation.

Version-Release number of selected component (if applicable):
3.10.0-123.el7.x86_64
qemu-kvm-1.5.3-60.el7_0.2.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with a virtio-scsi device(specified scsi-id and lun), such as:
/usr/libexec/qemu-kvm -S -m 2G -smp 2 -monitor stdio -boot menu=on -vnc :1 -netdev tap,id=tap0,vhost=on,queues=4,script=/etc/qemu-ifup -device virtio-net-pci,mq=on,netdev=tap0,id=net0,vectors=10 -device virtio-scsi-pci,id=scsi0,bus=pci.0 -drive file=/dev/disk/by-path/ip-10.66.9.10:3260-iscsi-iqn.2013-11.com.example:storage.disk1.juli.xyz-lun-2,format=qcow2,if=none,id=img,media=disk -device scsi-hd,drive=img,id=sys-img,bus=scsi0.0,scsi-id=0,lun=0 -drive file=/home/juli/virtio-win-prewhql-80.iso,if=none,media=cdrom,id=cdrom0 -device scsi-cd,drive=cdrom0,id=sys-cdrom0,bus=scsi0.0,scsi-id=0,lun=1
2.hot-plug another scsi-cd device with the same existing "scsi-id=0 and lun=1".
(qemu) drive_add auto file=/home/juli/sn1.qcow2,if=none,id=test1
(qemu) device_add scsi-cd,drive=test1,id=sys-test1,bus=scsi0.0,scsi-id=0,lun=1
3.

Actual results:
after step 2, this operation will success. And this operation will overlap the existing device(sys-cdrom0).

Expected results:
can not hot-plug another scsi-cd device with the same existing "scsi-id=0 and lun=1".

Additional info:

Comment 1 Jun Li 2014-05-08 07:28:41 UTC
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.415.el6.x86_64
2.6.32-459.el6.x86_64

Steps to Reproduce:
1.boot guest with a virtio-scsi device(specified scsi-id and lun), such as:
/usr/libexec/qemu-kvm -m 2G -smp 2 -monitor stdio -boot menu=on -vnc :11 -drive file=/home/RHEL-Server-6.5-64-virtio.qcow2,if=none,id=img,media=disk -device virtio-scsi-pci,id=scsi0 -device virtio-blk-pci,drive=img,id=sys-img -drive file=/home/juli/test1,if=none,media=cdrom,id=cdrom0 -device scsi-cd,drive=cdrom0,id=sys-cdrom0,bus=scsi0.0,scsi-id=0,lun=1 -S
2.hot-plug another scsi-cd device with the same existing "scsi-id=0 and lun=1".
(qemu) __com.redhat_drive_add   file=/home/juli/test2,id=test1
(qemu) device_add scsi-disk,drive=test1,id=sys-test1,bus=scsi0.0,scsi-id=0,lun=1

Comment 4 Jeff Nelson 2014-07-29 15:57:02 UTC
Fix included in qemu-kvm-0.12.1.2-2.432.el6

Comment 6 langfang 2014-08-01 03:17:17 UTC
Reproduce this bug as follow version:
# uname -r 
2.6.32-452.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.431.el6.x86_64

Steps:
1.Boot guest with 
 -device virtio-scsi-pci,id=scsi0,bus=pci.0 -drive file=/usr/share/virtio-win/virtio-win.iso,if=none,media=cdrom,id=cdrom0 -device scsi-cd,drive=cdrom0,id=sys-cdrom0,bus=scsi0.0,scsi-id=0,lun=1

2.hot-plug another scsi-cd device with the same existing "scsi-id=0 and lun=1".
(qemu)__com.redhat_drive_add file=en_windows_xp_professional_x64.iso,id=test1
(qemu)device_add scsi-cd,drive=test1,id=sys-test1,bus=scsi0.0,scsi-id=0,lun=1

Results:
hot-plug successfully. And this operation will overlap the existing device.


Verify this bug as follow version:

# uname -r 
2.6.32-452.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.434.el6.x86_64

Steps as same as reproduce

Results:
(qemu) device_add scsi-cd,drive=test1,id=sys-test1,bus=scsi0.0,scsi-id=0,lun=1
lun already used by 'sys-cdrom0'
Device 'scsi-cd' could not be initialized


according to above test ,this bug fixed.

Comment 7 Fam Zheng 2014-08-07 00:32:26 UTC
*** Bug 1096590 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2014-10-14 06:58:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1490.html