[PATCH libvirt v4 06/12] nodedev: detect AP matrix device

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

 



Add support for AP matrix device in libvirt node device driver.

Signed-off-by: Shalini Chellathurai Saroja <shalini@xxxxxxxxxxxxx>
Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
 docs/schemas/nodedev.rng           |  7 +++++++
 src/conf/node_device_conf.c        |  9 +++++++++
 src/conf/node_device_conf.h        |  8 ++++++++
 src/conf/virnodedeviceobj.c        |  1 +
 src/node_device/node_device_udev.c | 13 +++++++++++++
 tools/virsh-nodedev.c              |  1 +
 6 files changed, 39 insertions(+)

diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index 60367653..1024ba59 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -89,6 +89,7 @@
         <ref name="capvdpa"/>
         <ref name="capapcard"/>
         <ref name="capapqueue"/>
+        <ref name="capapmatrix"/>
       </choice>
     </element>
   </define>
@@ -691,6 +692,12 @@
     </element>
   </define>
 
+  <define name='capapmatrix'>
+    <attribute name='type'>
+      <value>ap_matrix</value>
+    </attribute>
+  </define>
+
   <define name="address">
     <element name="address">
       <attribute name="domain"><ref name="hexuint"/></attribute>
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 01254a8f..d32a6afc 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -69,6 +69,7 @@ VIR_ENUM_IMPL(virNodeDevCap,
               "vdpa",
               "ap_card",
               "ap_queue",
+              "ap_matrix",
 );
 
 VIR_ENUM_IMPL(virNodeDevNetCap,
@@ -665,6 +666,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def)
         case VIR_NODE_DEV_CAP_MDEV_TYPES:
         case VIR_NODE_DEV_CAP_FC_HOST:
         case VIR_NODE_DEV_CAP_VPORTS:
+        case VIR_NODE_DEV_CAP_AP_MATRIX:
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
@@ -2077,6 +2079,9 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt,
         ret = virNodeDevCapAPQueueParseXML(ctxt, def, node,
                                            &caps->data.ap_queue);
         break;
+    case VIR_NODE_DEV_CAP_AP_MATRIX:
+        ret = 0;
+        break;
     case VIR_NODE_DEV_CAP_MDEV_TYPES:
     case VIR_NODE_DEV_CAP_FC_HOST:
     case VIR_NODE_DEV_CAP_VPORTS:
@@ -2398,6 +2403,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps)
             virMediatedDeviceTypeFree(data->ccw_dev.mdev_types[i]);
         VIR_FREE(data->ccw_dev.mdev_types);
         break;
+    case VIR_NODE_DEV_CAP_AP_MATRIX:
+        VIR_FREE(data->ap_matrix.addr);
+        break;
     case VIR_NODE_DEV_CAP_MDEV_TYPES:
     case VIR_NODE_DEV_CAP_DRM:
     case VIR_NODE_DEV_CAP_FC_HOST:
@@ -2467,6 +2475,7 @@ virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def)
         case VIR_NODE_DEV_CAP_VDPA:
         case VIR_NODE_DEV_CAP_AP_CARD:
         case VIR_NODE_DEV_CAP_AP_QUEUE:
+        case VIR_NODE_DEV_CAP_AP_MATRIX:
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index b580d6cf..b863653b 100644
--- a/src/conf/node_device_conf.h
+++ b/src/conf/node_device_conf.h
@@ -68,6 +68,7 @@ typedef enum {
     VIR_NODE_DEV_CAP_VDPA,              /* vDPA device */
     VIR_NODE_DEV_CAP_AP_CARD,           /* s390 AP Card device */
     VIR_NODE_DEV_CAP_AP_QUEUE,          /* s390 AP Queue */
+    VIR_NODE_DEV_CAP_AP_MATRIX,         /* s390 AP Matrix device */
 
     VIR_NODE_DEV_CAP_LAST
 } virNodeDevCapType;
@@ -304,6 +305,12 @@ struct _virNodeDevCapAPQueue {
     unsigned int ap_domain;
 };
 
+typedef struct _virNodeDevCapAPMatrix virNodeDevCapAPMatrix;
+typedef virNodeDevCapAPMatrix *virNodeDevCapAPMatrixPtr;
+struct _virNodeDevCapAPMatrix {
+    char *addr;
+};
+
 typedef struct _virNodeDevCapData virNodeDevCapData;
 typedef virNodeDevCapData *virNodeDevCapDataPtr;
 struct _virNodeDevCapData {
@@ -325,6 +332,7 @@ struct _virNodeDevCapData {
         virNodeDevCapVDPA vdpa;
         virNodeDevCapAPCard ap_card;
         virNodeDevCapAPQueue ap_queue;
+        virNodeDevCapAPMatrix ap_matrix;
     };
 };
 
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 691632c6..8fbef5f5 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -719,6 +719,7 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
         case VIR_NODE_DEV_CAP_VDPA:
         case VIR_NODE_DEV_CAP_AP_CARD:
         case VIR_NODE_DEV_CAP_AP_QUEUE:
+        case VIR_NODE_DEV_CAP_AP_MATRIX:
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7883f23e..179793d8 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1234,6 +1234,15 @@ udevProcessAPQueue(struct udev_device *device,
 }
 
 
+static int
+udevProcessAPMatrix(virNodeDeviceDefPtr def)
+{
+    def->name = g_strdup("ap_matrix");
+
+    return 0;
+}
+
+
 static int
 udevGetDeviceNodes(struct udev_device *device,
                    virNodeDeviceDefPtr def)
@@ -1319,6 +1328,8 @@ udevGetDeviceType(struct udev_device *device,
             *type = VIR_NODE_DEV_CAP_CSS_DEV;
         else if (STREQ_NULLABLE(subsystem, "vdpa"))
             *type = VIR_NODE_DEV_CAP_VDPA;
+        else if (STREQ_NULLABLE(subsystem, "matrix"))
+            *type = VIR_NODE_DEV_CAP_AP_MATRIX;
 
         VIR_FREE(subsystem);
     }
@@ -1371,6 +1382,8 @@ udevGetDeviceDetails(struct udev_device *device,
         return udevProcessAPCard(device, def);
     case VIR_NODE_DEV_CAP_AP_QUEUE:
         return udevProcessAPQueue(device, def);
+    case VIR_NODE_DEV_CAP_AP_MATRIX:
+        return udevProcessAPMatrix(def);
     case VIR_NODE_DEV_CAP_MDEV_TYPES:
     case VIR_NODE_DEV_CAP_SYSTEM:
     case VIR_NODE_DEV_CAP_FC_HOST:
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index f5ffe525..f69030d2 100644
--- a/tools/virsh-nodedev.c
+++ b/tools/virsh-nodedev.c
@@ -473,6 +473,7 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
         case VIR_NODE_DEV_CAP_AP_QUEUE:
             flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE;
             break;
+        case VIR_NODE_DEV_CAP_AP_MATRIX:
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
-- 
2.26.2




[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