Description of problem: If boot a guest with more than 8 pci devices, qemu exits with "Too many assigned devices", but if hot-plug pci devices, it will break the limitation. Version-Release number of selected component (if applicable): # rpm -qa|grep kvm etherboot-roms-kvm-5.4.4-13.el5 kvm-qemu-img-83-232.el5 etherboot-zroms-kvm-5.4.4-13.el5 kmod-kvm-83-232.el5 kvm-debuginfo-83-232.el5 kvm-83-232.el5 kvm-tools-83-232.el5 kmod-kvm-debug-83-232.el5 How reproducible: 100% Steps to Reproduce: 1. boot a guest by: /usr/libexec/qemu-kvm -M rhel5.6.0 -no-hpet -rtc-td-hack -startdate now -name rhel5.7 -smp 2 -m 2048 -cpu qemu64 -uuid `uuidgen` -boot c -net nic,vlan=1,macaddr=13:45:65:31:ad:89,model=virtio -net tap,vlan=1,script=/etc/qemu-ifup -drive file=/root/images/rhel5.7-64.qcow2,media=disk,if=virtio,cache=none,boot=on,format=qcow2 -vnc :1 -notify all -balloon none -monitor stdio 2. load acpiphp in guest by: modprobe acpiphp 3. hot-plug pci devices by: (qemu) pci_add pci_addr=auto host host=09:10.0 Registered host PCI device 09:10.0 ("09:10.0") as guest device 00:05.0 OK domain 0, bus 0, slot 5, function 0 ... Actual results: Can hot-plug more than 8 pci devices. (qemu) info pci Bus 0, device 5, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84000000 [0x84003fff]. BAR3: 32 bit memory at 0x84004000 [0x84007fff]. Bus 0, device 6, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84008000 [0x8400bfff]. BAR3: 32 bit memory at 0x8400c000 [0x8400ffff]. Bus 0, device 7, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84010000 [0x84013fff]. BAR3: 32 bit memory at 0x84014000 [0x84017fff]. Bus 0, device 8, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84018000 [0x8401bfff]. BAR3: 32 bit memory at 0x8401c000 [0x8401ffff]. Bus 0, device 9, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84020000 [0x84023fff]. BAR3: 32 bit memory at 0x84024000 [0x84027fff]. Bus 0, device 10, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84028000 [0x8402bfff]. BAR3: 32 bit memory at 0x8402c000 [0x8402ffff]. Bus 0, device 11, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84030000 [0x84033fff]. BAR3: 32 bit memory at 0x84034000 [0x84037fff]. Bus 0, device 12, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84038000 [0x8403bfff]. BAR3: 32 bit memory at 0x8403c000 [0x8403ffff]. Bus 0, device 13, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84040000 [0x84043fff]. BAR3: 32 bit memory at 0x84044000 [0x84047fff]. Bus 0, device 14, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84048000 [0x8404bfff]. BAR3: 32 bit memory at 0x8404c000 [0x8404ffff]. Bus 0, device 15, function 0: Ethernet controller: PCI device 8086:10ca BAR0: 32 bit memory at 0x84050000 [0x84053fff]. BAR3: 32 bit memory at 0x84054000 [0x84057fff]. Expected results: limitation on max number of assigned devices should take effect on hot-plug scenario. Additional info:
Verified this bug in following environment: # uname -r;rpm -q kvm 2.6.18-300.el5 kvm-83-246.el5 Qemu-kvm will quit on "Too many assigned devices" if cold plug more than 8 pci devices when testing device assignment. And refuse to assign the 9th one and claim "Too many assigned devices" instead of quitting. 1. Cold plug 9 VF's: # /usr/libexec/qemu-kvm -no-hpet -rtc-td-hack -usbdevice tablet -startdate now -name rhel5.8_64 -smp 2 -m 4G -boot dc -net none -drive file=/home/rhel5.8_x86_64.qcow2,media=disk,if=virtio,cache=none,format=qcow2,werror=stop,boot=on -qxl 1 -spice ic=on,host=0,disable-ticketing,port=9000 -cpu qemu64 -M rhel5.6.0 -notify all -balloon none -monitor stdio -pcidevice host=08:10.0 -pcidevice host=08:10.1 -pcidevice host=08:10.2 -pcidevice host=08:10.3 -pcidevice host=08:10.4 -pcidevice host=08:10.5 -pcidevice host=08:10.6 -pcidevice host=08:10.7 -pcidevice host=08:11.0 Too many assigned devices 2. Hot plug 9 VF's: (qemu) pci_add pci_addr=auto host host=08:10.0 Registered host PCI device 08:10.0 ("08:10.0") as guest device 00:05.0 OK domain 0, bus 0, slot 5, function 0 <snip> (qemu) pci_add pci_addr=auto host host=08:10.7 Registered host PCI device 08:10.7 ("08:10.7") as guest device 00:0c.7 OK domain 0, bus 0, slot 12, function 0 (qemu) pci_add pci_addr=auto host host=08:11.0 Too many assigned devices Error adding device; check syntax failed to add host=08:11.0 (qemu) 3. cold plug 8 first, then hot plug 1: (qemu) pci_add pci_addr=auto host host=08:11.0 Too many assigned devices Error adding device; check syntax failed to add host=08:11.0 (qemu) Actual Result: Cold plug more than 8: qemu-kvm quitted on "Too many assigned devices" Hot plug more than 8: qemu-kvm refused to assign the 9th one to guest, claimed "Too many assigned devices", and guest won't quit Cold plug 8 VF's, Hot plug the 9th one: qqemu-kvm refused to assign the 9th one to guest, claimed "Too many assigned devices", and guest won't quit Based on above info, this issue has been fixed.
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/RHSA-2012-0149.html