On 4/6/21 11:31 AM, Daniel P. Berrangé wrote:
PCI devices can be associated with a unique integer index that is
exposed via ACPI. In Linux OS with systemd, this value is used for
provide a NIC device naming scheme that is stable across changes
in PCI slot configuration.
Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
docs/formatdomain.rst | 6 +++
docs/schemas/domaincommon.rng | 73 +++++++++++++++++++++++++++++++++++
src/conf/device_conf.h | 3 ++
src/conf/domain_conf.c | 12 ++++++
4 files changed, 94 insertions(+)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 7ba32ea9c1..5db0aac77a 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -4363,6 +4363,7 @@ Network interfaces
<mac address='52:54:00:5d:c7:9e'/>
<boot order='1'/>
<rom bar='off'/>
+ <acpi index='4'/>
</interface>
</devices>
...
@@ -4389,6 +4390,11 @@ when it's in the reserved VMware range by adding a ``type="static"`` attribute
to the ``<mac/>`` element. Note that this attribute is useless if the provided
MAC address is outside of the reserved VMWare ranges.
+:since:`Since 7.3.0`, one can set the ACPI index against network interfaces.
+With some operating systems (eg Linux with systemd), the ACPI index is used
+to provide network interface device naming, that is stable across changes
+in PCI addresses assigned to the device.
+
:anchor:`<a id="elementsNICSVirtual"/>`
Virtual network
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 2ff7862539..30108b6d4c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1441,6 +1441,9 @@
<optional>
<ref name="alias"/>
</optional>
+ <optional>
+ <ref name="acpi"/>
+ </optional>
<optional>
<ref name="address"/>
</optional>
Looks like it's time to reorganize the schema to eliminate all of this
repetition. You already put the acpi index into the virDomainDeviceInfo
struct, and parse/format it with virDomainDeviceInfoParse/Format, so it
would make sense to define a "deviceInfo" element to replace every
"address" reference. The deviceInfo element could also include alias,
since that too is part of the deviceInfo.
If you don't want to do that in this series, I can do it after you've
pushed it all of this - just remind me.