Bug 1946719
| Summary: | RFE: support setting ACPI index for PCI devices to enable systemd predictable NIC device naming | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Daniel Berrangé <berrange> |
| Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
| Status: | CLOSED ERRATA | QA Contact: | yalzhang <yalzhang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.5 | CC: | imammedo, jdenemar, jsuchane, laine, lmen, pkrempa, smitterl, virt-maint, xuzhang, yalzhang |
| Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
| Target Release: | 8.4 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-7.3.0-1.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-11-16 07:52:31 UTC | Type: | Feature Request |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | 7.3.0 |
| Embargoed: | |||
| Bug Depends On: | 1946716 | ||
| Bug Blocks: | |||
|
Description
Daniel Berrangé
2021-04-06 18:03:52 UTC
Included in 7.3.0 release just heads up, even though ACPI PCI hotplug for Q35 was merged in QEMU-6.1, acpi-index will work only with hotpluggable devices (i.e. NICs attached to root ports/other bridges). for devices directly attached to pcie.0 it will not work. So we will need extra patches on top to make it work to the same extent as on PC. Hi Daniel, I have tested the feature with below scenarios, all results are expected except the virsh command "update-device". Libvirt should forbid any live update for the "acpi index". Could you please help to confirm it, Thank you!
Test with below packages with pc machine type:
# rpm -q libvirt qemu-kvm
libvirt-7.6.0-1.module+el8.5.0+12097+2c77910b.x86_64
qemu-kvm-6.0.0-27.module+el8.5.0+12121+c40c8708.x86_64
Scenarios:
1. Start vm with <acpi index='NNN'/> and check the interface name, the interface will get name as “enoNNN”. While the one without index set will get name as “ensX”(X is the slot number) - PASS;
2. Hotplug and unplug interface with “acpi index” defined - PASS;
3. Boundary test - PASS
4. Unique test - PASS
5. Update device - FAIL
Details:
Start vm with interfaces set with ‘acpi index’:
<interface type='network'>
<mac address='52:54:00:69:68:30'/>
<source network='default'/>
<model type='virtio'/>
<acpi index='13'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:eb:e2:ab'/>
<source network='default'/>
<model type='e1000e'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</interface>
Check the interface name, they will get:
# ip l
2: eno13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:69:68:30 brd ff:ff:ff:ff:ff:ff
3: ens10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:eb:e2:ab brd ff:ff:ff:ff:ff:ff
Hotplug and unplug interface with ‘acpi index’:
Hot unplug the first interface, and plug another interface with different index:
# virsh detach-device test interface.xml
Device detached successfully
# cat interface.xml
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
<acpi index='16383'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
# virsh attach-device test interface.xml
Device attached successfully
# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: ens10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:eb:e2:ab brd ff:ff:ff:ff:ff:ff
4: eno16383: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:d6:7a:5b brd ff:ff:ff:ff:ff:ff
Test duplicate index
Try to attach an interface with duplicate index ‘16383’:
# cat hostdev_interface.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x5e' slot='0x01' function='0x3'/>
</source>
<acpi index='16383'/>
</hostdev>
# virsh attach-device test hostdev_interface.xml
error: Failed to attach device from hostdev_interface.xml
error: internal error: unable to execute QEMU command 'device_add': a PCI device with acpi-index = 16383 already exist
# cat interface.xml
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
<acpi index='16383'/>
</interface>
# virsh attach-device test interface.xml
error: Failed to attach device from interface.xml
error: internal error: unable to execute QEMU command 'device_add': a PCI device with acpi-index = 16383 already exist
Destroy the vm and edit the vm to includes duplicate index:
# virsh dumpxml test | grep 'acpi index'
<acpi index='13'/>
<acpi index='13'/>
# virsh start test
error: Failed to start domain 'test'
error: internal error: qemu unexpectedly closed the monitor: 2021-08-09T02:03:58.531356Z qemu-kvm: -device e1000e,netdev=hostnet1,id=net1,mac=52:54:00:eb:e2:ab,bus=pci.0,addr=0xa,acpi-index=13: a PCI device with acpi-index = 13 already exist
Try to start with ‘acpi index=16384’
# virsh start test
error: Failed to start domain 'test'
error: internal error: qemu unexpectedly closed the monitor: 2021-08-09T02:06:17.770232Z qemu-kvm: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:69:68:30,bus=pci.0,addr=0x9,acpi-index=16384: acpi-index should be less or equal to 16383
Hotplug with ‘acpi index=16384’
# virsh attach-device test interface.xml
error: Failed to attach device from interface.xml
error: internal error: unable to execute QEMU command 'device_add': acpi-index should be less or equal to 16383
Update device fail
# virsh dupmxml test | grep /interface -B 12
<interface type='network'>
<mac address='52:54:00:69:68:30'/>
<source network='default' portid='2e78e325-cadf-4295-a4f0-0262c58f7f45' bridge='virbr0'/>
<target dev='vnet86'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
# cat update_interface.xml
<interface type='network'>
<mac address='52:54:00:69:68:30'/>
<source network='default' portid='2e78e325-cadf-4295-a4f0-0262c58f7f45' bridge='virbr0'/>
<target dev='vnet86'/>
<model type='virtio'/>
<alias name='net0'/>
<acpi index='16383'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
# virsh update-device test update_interface.xml
Device updated successfully
Check the live xml, there is no changes
Set the bug to be verified according to comment 6 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 (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4684 |