RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1610215 - [Q35] hotplug failed when using pcie-root-port multifunction
Summary: [Q35] hotplug failed when using pcie-root-port multifunction
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Michael S. Tsirkin
QA Contact: jingzhao
URL:
Whiteboard:
Depends On:
Blocks: 1610587
TreeView+ depends on / blocked
 
Reported: 2018-07-31 08:50 UTC by Yiqian Wei
Modified: 2018-09-05 20:39 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1610587 (view as bug list)
Environment:
Last Closed: 2018-09-05 20:39:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yiqian Wei 2018-07-31 08:50:26 UTC
Description of problem:
hotplug failed when using pcie-root-port multifunction

Version-Release number of selected component (if applicable):
host version:
qemu-kvm-rhev-2.12.0-8.el7.x86_64
kernel-3.10.0-928.el7.x86_64
seabios-1.11.0-2.el7.x86_64
guest:rhel7.6

How reproducible:
2/2

Steps to Reproduce:
1.boot a guest with [1]
2.hot plug a virtio-net-pci device with "addr=0x0.1" to guest by:
In hmp:
(qemu)netdev_add tap,id=hostnet1,vhost=on
(qemu)device_add virtio-net-pci,netdev=hostnet1,mac=9a:6a:6b:6c:6d:69,id=net1,iommu_platform=on,ats=on,bus=root1,addr=0x0.1

Actual results:
After step2,
(qemu) device_add virtio-net-pci,netdev=hostnet1,mac=9a:6a:6b:6c:6d:69,id=net1,iommu_platform=on,ats=on,bus=root1,addr=0x0.1
PCI: slot 0 function 0 already ocuppied by virtio-net-pci, new func virtio-net-pci cannot be exposed to guest.

Expected results:
Hotplug device success.

Additional info:
[1]
/usr/libexec/qemu-kvm \
-M q35,kernel-irqchip=split \
-device intel-iommu,intremap=on,caching-mode=on,device-iotlb=on \
-name vm \
-cpu Haswell-noTSX,enforce \
-nodefaults -rtc base=utc \
-m 4G \
-smp 4,sockets=4,cores=1,threads=1,maxcpus=4 \
-enable-kvm \
-k en-us \
-vga qxl \
-boot menu=on \
-qmp tcp:0:6667,server,nowait \
-device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 \
-drive file=/mnt/rhel7.6.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bus=root0,bootindex=1,iommu_platform=on   \
-device pcie-root-port,bus=pcie.0,id=root1,chassis=11,addr=0xa.1 \
-device virtio-net-pci,netdev=hostnet0,mac=9a:6a:6b:6c:6d:68,bus=root1,id=net0,iommu_platform=on,ats=on,multifunction=on,addr=0x0.0   \
-netdev tap,id=hostnet0,vhost=on   \
-monitor stdio \
-spice port=5901,disable-ticketing  \

2.with "qemu-kvm-rhev-2.10.0-21.el7_5.4.x86_64" version,hit the same issue.

Comment 2 Amnon Ilan 2018-08-06 17:55:52 UTC
Is this a valid hotplug config? i.e. when hotpluging via libvirt does it 
use this config?

Comment 3 Yiqian Wei 2018-08-07 08:39:43 UTC
(In reply to Amnon Ilan from comment #2)
> Is this a valid hotplug config? i.e. when hotpluging via libvirt does it 
> use this config?

I retest this bug with libvirt,as follows:
1.boot a rhel7.6 guest with virt-manager
2.edit vm XML file [1]
virsh # edit vm 
Domain vm XML configuration edited.
3.hotplug NIC to guest by:
#virsh attach-device vm /home/bz/nic1.xml

test results:
after step3,
# virsh attach-device vm /home/bz/nic1.xml
error: Failed to attach device from /home/bz/nic1.xml
error: internal error: Only PCI device addresses with function=0 are supported

additional info:
[1].Modified part in vm XML file
<interface type='bridge'>
      <mac address='52:54:00:23:ba:95'/>
      <source bridge='switch'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
</interface>

2.cat nic1.xml
<interface type='bridge'>
   <mac address='52:54:00:23:ba:93'/>
   <source bridge='switch'/>
   <model type='virtio'/>
   <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</interface>

Comment 4 Michael S. Tsirkin 2018-08-13 13:57:45 UTC
to comment 0, it looks like you supply the same function in both cases.

Comment 6 Laine Stump 2018-09-05 20:39:22 UTC
You can only hotplug an entire slot at once. The PCI standard doesn't allow hotplugging something into an unused function of a slot that already has a device in it. IOW, what you're trying to do is explicitly illegal.


Note You need to log in before you can comment on or make changes to this bug.