Bug 705681

Summary: hot-plug pci devices more than 10 via monitor, qemu will exit
Product: Red Hat Enterprise Linux 5 Reporter: FuXiangChun <xfu>
Component: kvmAssignee: Don Dutile (Red Hat) <ddutile>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7CC: gcosta, juzhang, michen, mkenneth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-23 22:20:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 580946    

Description FuXiangChun 2011-05-18 04:40:31 UTC
Description of problem:
hot-plug 11th pci devices via monitor, qemu will exit and dump below messages:
create_userspace_phys_mem: Invalid argument
assigned_dev_iomem_map: Error: create new mapping failed

Version-Release number of selected component (if applicable):
# rpm -qa|grep kvm
kvm-83-232.el5
# uname -r
2.6.18-260.el5

How reproducible:


Steps to Reproduce:
1.boot the guest without VFs assigned
/usr/libexec/qemu-kvm -no-hpet -usbdevice tablet -rtc-td-hack -name 61 -smp 2 -m 2G -uuid 9e6f04cf-2ad7-45aa-9333-2d2ee26570c6 -boot c -drive file=/root/testrun/rhel61.qcow2,if=ide,cache=none,boot=on,format=qcow2,werror=stop -net nic,vlan=1,macaddr=1C:C1:DE:44:a3:8c,model=rtl8139 -net tap,vlan=1,script=/etc/qemu-ifup  -notify all -balloon none  -monitor stdio -spice disable-ticketing,port=5911 -qxl 1

2.enter into guest monitor command line, issue following command:
(qemu) pci_add pci_addr=auto host host=03:11.1
(qemu) pci_add pci_addr=auto host host=03:11.2
(qemu) pci_add pci_addr=auto host host=03:11.3
(qemu) pci_add pci_addr=auto host host=03:11.4
(qemu) pci_add pci_addr=auto host host=03:11.5
(qemu) pci_add pci_addr=auto host host=03:10.0
(qemu) pci_add pci_addr=auto host host=03:10.1
(qemu) pci_add pci_addr=auto host host=03:10.2
(qemu) pci_add pci_addr=auto host host=03:10.3
(qemu) pci_add pci_addr=auto host host=03:10.4
(qemu) pci_add pci_addr=auto host host=03:10.5

3.
  
Actual results:
qemu exit

Expected results:
guest and host work well

Additional info:

Comment 1 juzhang 2011-05-18 04:47:14 UTC
Expected results:
1.nic device is hot add successful. 
2.If max number is limited to 8,should be promot more friendly message rather than quit directly.

Comment 2 Don Dutile (Red Hat) 2011-05-23 22:20:25 UTC
This limitation exists in upstream.
It's due to limited 'memory blocks' that qemu uses to manage memory sections, in this case, device mmap'd MMIO BARS.

There is an outstanding note about this limitation for RHEL6 as well.