Bug 856915

Summary: qemu should reject repeatedly to hot plug the exact same disk image without unplugging it first
Product: Red Hat Enterprise Linux 5 Reporter: Qian Guo <qiguo>
Component: kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9CC: asias, chayang, juzhang, mkenneth, rhod, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-16 10:32:21 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:

Description Qian Guo 2012-09-13 06:35:05 UTC
Description of problem:
Boot a rhel5.9 guest, and load acpiphp module to support ACPI. Hot plug disk A through monitor, repeat hot plugging disk A without unplugging it.

Version-Release number of selected component (if applicable):
kvm-83-262.el5.x86_64.rpm


How reproducible:
100%

Steps to Reproduce:
1.start vm, that os is rhel5.9.
eg:/usr/libexec/qemu-kvm -no-hpet -no-kvm-pit-reinjection -smp 2,cores=1 -m 2048 -startdate now -rtc-td-hack -k en-us -usbdevice tablet -name Fst -boot c -drive file=/mnt/nfs/migtn.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop,boot=on -soundhw ac97 -M rhel5.6.0 -cpu qemu64 -monitor stdio -net nic,vlan=1,macaddr=00:1a:2a:09:21:02,model=virtio -net tap,vlan=1,script=/etc/qemu-ifup -vnc :10 
2.in guest, run#fdisk -l, there're only /dev/vda1,/dev/vda2;
3.in guest, load module acpiphp;
4.in qemu, hot plug one storage disk repeatedly; 
eg:
(qemu) pci_add pci_addr=auto storage file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio
OK domain 0, bus 0, slot 7, function 0
(qemu) pci_add pci_addr=auto storage file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio
OK domain 0, bus 0, slot 8, function 0
(qemu) pci_add pci_addr=auto storage file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio
OK domain 0, bus 0, slot 9, function 0
(qemu) pci_add pci_addr=auto storage file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio
OK domain 0, bus 0, slot 10, function 0
5.fdisk -l in guest, there're vda~vdf


Actual results:
multiple disks exist in the guest with different slots,though they are from the same source. 

Expected results:
one disk should be hot plugged only once except unplug it.

Additional info:

If start vm with multiple disks, that use the same path and same disk image,eg:
/usr/libexec/qemu-kvm -no-hpet -no-kvm-pit-reinjection -smp 2,cores=1 -m 2048 -startdate now -rtc-td-hack -k en-us -usbdevice tablet -name Fst -boot c -drive file=/mnt/nfs/migtn.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop,boot=on -soundhw ac97 -M rhel5.6.0 -cpu qemu64 -monitor stdio -net nic,vlan=1,macaddr=00:1a:2a:09:21:02,model=virtio -net tap,vlan=1,script=/etc/qemu-ifup -vnc :10 -drive file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop -drive file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop -drive file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop -drive file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop -drive file=/mnt/nfs/img/tmp/t1.qcow2,if=virtio,media=disk,format=qcow2,cache=off,werror=stop

The vm can start too.

Comment 1 Ronen Hod 2012-09-16 10:31:42 UTC
Not sure that this is a bug. It certainly does not make sense, and will not work well in most cases, but I do not see why it should be forbidden.
Anyhow, I am closing it for RHEL5 since we will not fix it, and if it is considered a bug then please check RHEL6 too.