[PATCH libvirt v1 5/7] virsh: nodedev: filter by AP Matrix capability

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

 



Add support to filter by 'ap_matrix' capability.

Signed-off-by: Shalini Chellathurai Saroja <shalini@xxxxxxxxxxxxx>
Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
 docs/formatnode.html.in           | 3 +++
 docs/manpages/virsh.rst           | 2 +-
 include/libvirt/libvirt-nodedev.h | 1 +
 src/conf/node_device_conf.h       | 3 ++-
 src/conf/virnodedeviceobj.c       | 3 ++-
 src/libvirt-nodedev.c             | 1 +
 tools/virsh-nodedev.c             | 2 ++
 7 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in
index 16f68f38..db621bcf 100644
--- a/docs/formatnode.html.in
+++ b/docs/formatnode.html.in
@@ -450,6 +450,9 @@
               <dd>AP Queue identifier.</dd>
             </dl>
           </dd>
+          <dt><code>ap_matrix</code></dt>
+          <dd>Describes an AP Matrix device on a S390 architecture providing
+              cryptographic host resources usable for virtualization.</dd>
         </dl>
       </dd>
     </dl>
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index e4110c45..ff7e8812 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -4970,7 +4970,7 @@ List all of the devices available on the node that are known by libvirt.
 separated by comma, e.g. --cap pci,scsi. Valid capability types include
 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target',
 'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev',
-'mdev_types', 'ccw', 'css', 'ap_card', 'ap_queue'.
+'mdev_types', 'ccw', 'css', 'ap_card', 'ap_queue', 'ap_matrix'.
 If *--tree* is used, the output is formatted in a tree representing parents of each
 node.  *cap* and *--tree* are mutually exclusive.
 
diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-nodedev.h
index 789f9c86..0d7f33e0 100644
--- a/include/libvirt/libvirt-nodedev.h
+++ b/include/libvirt/libvirt-nodedev.h
@@ -84,6 +84,7 @@ typedef enum {
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV       = 1 << 16, /* CSS device */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD       = 1 << 17, /* s390 AP Card device */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE      = 1 << 18, /* s390 AP Queue */
+    VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX     = 1 << 19, /* s390 AP Matrix */
 } virConnectListAllNodeDeviceFlags;
 
 int                     virConnectListAllNodeDevices (virConnectPtr conn,
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index f1e57ad7..6daef571 100644
--- a/src/conf/node_device_conf.h
+++ b/src/conf/node_device_conf.h
@@ -396,7 +396,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps);
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV       | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV       | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD       | \
-                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE)
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE      | \
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX)
 
 int
 virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host);
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index a19017b8..33dab6da 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -867,7 +867,8 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj,
               MATCH(CCW_DEV)       ||
               MATCH(CSS_DEV)       ||
               MATCH(AP_CARD)       ||
-              MATCH(AP_QUEUE)))
+              MATCH(AP_QUEUE)      ||
+              MATCH(AP_MATRIX)))
             return false;
     }
 
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index 762413eb..eb8c735a 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -104,6 +104,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE
+ *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX
  *
  * Returns the number of node devices found or -1 and sets @devices to NULL in
  * case of error.  On success, the array stored into @devices is guaranteed to
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index d39d87c7..d5a8514e 100644
--- a/tools/virsh-nodedev.c
+++ b/tools/virsh-nodedev.c
@@ -471,6 +471,8 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
             flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE;
             break;
         case VIR_NODE_DEV_CAP_AP_MATRIX:
+            flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX;
+            break;
         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