Re: [PATCH 3/3] nodedev: add parent_addr to mdev nodedev dumpxml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/4/22 9:32 AM, Boris Fiuczynski wrote:
As the parent address is part of the mdev nodedev name lets expose the
internally available parent address in the XML.

What is the issue that you're trying to solve here? The mdev xml already has a reference to the name of the parent device. So presumably you can look up the parent nodedev by name and then find its address, no? This seems like you're duplicating parent information in the child. Is it just for convenience?

Jonathon



Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
  docs/schemas/nodedev.rng                               | 5 +++++
  src/conf/node_device_conf.c                            | 2 ++
  tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml | 5 +++++
  3 files changed, 12 insertions(+)

diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index e4733f0804..0d7d1168b6 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -644,6 +644,11 @@
            <ref name="UUID"/>
          </element>
        </optional>
+      <optional>
+        <element name="parent_addr">
+          <data type="string"/>
+        </element>
+      </optional>
        <zeroOrMore>
          <element name="attr">
            <attribute name="name"/>
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 0bac0fde8d..61c8715037 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -604,6 +604,8 @@ virNodeDeviceCapMdevDefFormat(virBuffer *buf,
virBufferEscapeString(buf, "<type id='%s'/>\n", data->mdev.type);
      virBufferEscapeString(buf, "<uuid>%s</uuid>\n", data->mdev.uuid);
+    virBufferEscapeString(buf, "<parent_addr>%s</parent_addr>\n",
+                          data->mdev.parent_addr);
      virBufferAsprintf(buf, "<iommuGroup number='%u'/>\n",
                        data->mdev.iommuGroupNumber);
diff --git a/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml b/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml
index 4df5f4f43c..012c1a1596 100644
--- a/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml
+++ b/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml
@@ -4,6 +4,7 @@
    <capability type='mdev'>
      <type id='i915-GVTg_V5_4'/>
      <uuid>200f228a-c80a-4d50-bfb7-f5a0e4e34045</uuid>
+    <parent_addr>0000:00:02.0</parent_addr>
      <iommuGroup number='0'/>
    </capability>
  </device>
@@ -13,6 +14,7 @@
    <capability type='mdev'>
      <type id='i915-GVTg_V5_4'/>
      <uuid>de807ffc-1923-4d5f-b6c9-b20ecebc6d4b</uuid>
+    <parent_addr>0000:00:02.0</parent_addr>
      <iommuGroup number='0'/>
    </capability>
  </device>
@@ -22,6 +24,7 @@
    <capability type='mdev'>
      <type id='i915-GVTg_V5_8'/>
      <uuid>435722ea-5f43-468a-874f-da34f1217f13</uuid>
+    <parent_addr>0000:00:02.0</parent_addr>
      <iommuGroup number='0'/>
      <attr name='testattr' value='42'/>
    </capability>
@@ -32,6 +35,7 @@
    <capability type='mdev'>
      <type id='vfio_ap-passthrough'/>
      <uuid>783e6dbb-ea0e-411f-94e2-717eaad438bf</uuid>
+    <parent_addr>matrix</parent_addr>
      <iommuGroup number='0'/>
      <attr name='assign_adapter' value='5'/>
      <attr name='assign_adapter' value='6'/>
@@ -47,6 +51,7 @@
    <capability type='mdev'>
      <type id='vfio_ccw-io'/>
      <uuid>cc000052-9b13-9b13-9b13-cc23009b1326</uuid>
+    <parent_addr>0.0.0052</parent_addr>
      <iommuGroup number='0'/>
    </capability>
  </device>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux