Bug 768862

Summary: Two devices cann't use the same bootindex option when hot-plug it
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Gleb Natapov <gleb>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, bcao, bsarathy, juzhang, knoel, michen, mkenneth, tburke, virt-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-03 12:49:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description FuXiangChun 2011-12-19 08:19:12 UTC
Description of problem:
if use the same bootindex option when hot-plug it, qemu will quit immediately.  

Version-Release number of selected component (if applicable):
# rpm -qa|grep qemu
qemu-kvm-tools-0.12.1.2-2.212.el6.x86_64
# uname -r
2.6.32-220.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.# /usr/libexec/qemu-kvm -M rhel6.2.0 -m 4096 -smp 4,cores=2,threads=1,sockets=2 -cpu cpu64-rhel6,+sse2,+x2apic -name rhel6.2-64 -chardev socket,id=serial_id_20111215,path=/tmp/serial,server,nowait -device isa-serial,chardev=serial_id_20111215 -drive file=/home/win2008r2-sp1-3.qcow2,index=0,if=none,id=drive-virtio-disk1,media=disk,cache=none,format=qcow2,aio=native -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=1 -device virtio-net-pci,netdev=idbEmLYK,mac=9a:3c:3a:f0:b4:1a,id=ndev00idbEmLYK,bus=pci.0,addr=0x3 -netdev tap,id=idbEmLYK,vhost=on -rtc base=utc,clock=host,driftfix=slew -boot order=cdn,once=d,menu=on -no-kvm-pit-reinjection -usb -device usb-tablet -enable-kvm -chardev socket,id=qmp_monitor_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1,server,nowait -mon chardev=qmp_monitor_id_qmpmonitor1,mode=control -spice port=5912,disable-ticketing -vga qxl -monitor stdio -drive file=/home/second-disk-3.qcow2,index=1,if=none,id=drive-virtio-disk2,media=disk,cache=none,format=qcow2,aio=native -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,id=virtio-disk2,bootindex=2

2.(qemu)device_del virtio-disk2

3.(qemu) __com.redhat_drive_add file=/home/second-disk-3.qcow2,id=drive-virtio-disk2,media=disk,cache=none,format=qcow2,aio=native
(qemu) device_add virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,id=virtio-disk2,bootindex=2
  
Actual results:
qemu quit, and show below info
Two devices with same boot index 2


Expected results:
add device successful 

Additional info:

Comment 2 Dor Laor 2012-01-02 08:51:20 UTC
Seems like it (does not) works by design. Right Gleb?

Comment 3 Gleb Natapov 2012-01-02 08:58:10 UTC
(In reply to comment #2)
> Seems like it (does not) works by design. Right Gleb?

Right. Exiting qemu during hotplug is not the best error handling though. We should fail hotplug but not kill a guest.

Comment 4 Mike Cao 2012-01-03 12:36:30 UTC
According t ocomment #3,re-open this bug .

Comment 5 Gleb Natapov 2012-01-03 12:49:50 UTC
(In reply to comment #4)
> According t ocomment #3,re-open this bug .

comment #3 does not cancel the fact that the bug is invalid. You can't (and management should never try to) hotplug device with existing boot index either way. If you want you can open a bug with request to improve error handling.

Comment 6 FuXiangChun 2012-01-04 02:57:37 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > According t ocomment #3,re-open this bug .
> 
> comment #3 does not cancel the fact that the bug is invalid. You can't (and
> management should never try to) hotplug device with existing boot index either
> way. If you want you can open a bug with request to improve error handling.

I re-open a request bug(771545) with low severity and priority