Bug 969968

Summary: qemu will quit when hot plug a device with a bootindex number that was already used by other device
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Marcel Apfelbaum <marcel>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, armbru, bsarathy, chayang, flang, juzhang, michen, mkenneth, pbonzini, qzhang, rhod, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 963588 Environment:
Last Closed: 2013-11-03 12:57:20 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: 963588    
Bug Blocks:    

Comment 1 Sibiao Luo 2013-06-03 08:23:33 UTC
host info:
3.10.0-0.rc2.57.el7.x86_64
qemu-kvm-1.5.0-2.el7.x86_64

# /usr/libexec/qemu-kvm -cpu SandyBridge -M pc-i440fx-1.5 -enable-kvm -S -m 4G -smp 4,sockets=2,cores=2,threads=1...-netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet0,id=rtl8139-net-pci0,mac=08:2e:5f:0a:0d:a1,bus=pci.0,addr=0x5,bootindex=2...
(qemu) info network 
rtl8139-net-pci0: index=0,type=nic,model=rtl8139,macaddr=08:2e:5f:0a:0d:a1
 \ hostnet0: index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
(qemu) netdev_add tap,id=hostnet1,vhost=on,script=/etc/qemu-ifup
(qemu) device_add virtio-net-pci,netdev=hostnet1,id=virtio-net-pci0,bus=pci.0,bootindex=2
Two devices with same boot index 2
/etc/qemu-ifdown: could not launch network script
/etc/qemu-ifdown: could not launch network script

Comment 2 Markus Armbruster 2013-06-07 14:55:57 UTC
Root cause: add_boot_device_path() calls exit() instead of returning failure.

To fix, we need to make it return an error code, and forward it up all call chains until we reach the spot where it should be handled.  I don't expect it to be hard, just t-e-d-i-o-u-s.

Comment 3 Marcel Apfelbaum 2013-09-16 10:22:57 UTC
The boot order is passed in fw cfg and updated only once at
"machine done". There is no update of this list after this point.
Modifying the boot order from monitor does not work at all.
 
 So in order to solve this issue we can:
 1. Don't allow use of bootindex at hot-plug
 2. Change the architecture so boot order changing during hot-plug will be possible

Currently discussed upstream

Comment 4 Ronen Hod 2013-11-03 12:57:20 UTC

*** This bug has been marked as a duplicate of bug 771545 ***