]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: nodedev: Filter by AP card and AP queue capabilities
authorFarhan Ali <alifm@linux.ibm.com>
Thu, 3 Dec 2020 17:59:37 +0000 (18:59 +0100)
committerErik Skultety <eskultet@redhat.com>
Wed, 9 Dec 2020 13:03:05 +0000 (14:03 +0100)
Add support to filter by 'ap_card' and 'ap_queue' capabilities.

Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
docs/manpages/virsh.rst
include/libvirt/libvirt-nodedev.h
src/conf/node_device_conf.h
src/conf/virnodedeviceobj.c
src/libvirt-nodedev.c
tools/virsh-nodedev.c

index aa54bc21ef61044b2a64911ece56f85ecc8cbd7e..7658b53b2aa20c19320875a707706236ee0390d8 100644 (file)
@@ -5043,7 +5043,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'.
+'mdev_types', 'ccw', 'css', 'ap_card', 'ap_queue'.
 If *--tree* is used, the output is formatted in a tree representing parents of each
 node.  *cap* and *--tree* are mutually exclusive.
 
index b73b076f140ea2cb61720631b3511c65e77bd264..d5091aa28475fae44d2333bf0498869fe4dd1dfc 100644 (file)
@@ -83,6 +83,8 @@ typedef enum {
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV       = 1 << 15, /* CCW device */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV       = 1 << 16, /* CSS device */
     VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA          = 1 << 17, /* vDPA device */
+    VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD       = 1 << 18, /* s390 AP Card device */
+    VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE      = 1 << 19, /* s390 AP Queue */
 } virConnectListAllNodeDeviceFlags;
 
 int                     virConnectListAllNodeDevices (virConnectPtr conn,
index 27cb0004ae21a46dfa04fb4f91844efc6285879a..b580d6cf3d7ebfcfe11adf51a5d989a2d21207ef 100644 (file)
@@ -402,7 +402,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps);
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV          | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV       | \
                  VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV       | \
-                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA)
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA          | \
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD       | \
+                 VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE)
 
 int
 virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host);
index 8b4302d782df2a1da4d8c992647ebed5b2d011bb..691632c66d8269c0f5d7cc9e22b74c8f0f579aca 100644 (file)
@@ -871,7 +871,9 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj,
               MATCH(MDEV)          ||
               MATCH(CCW_DEV)       ||
               MATCH(CSS_DEV)       ||
-              MATCH(VDPA)))
+              MATCH(VDPA)          ||
+              MATCH(AP_CARD)       ||
+              MATCH(AP_QUEUE)))
             return false;
     }
 
index 28765b9c3015999e5382dfe353f99b1af9cee210..762413ebfdada92e03a86d74b8fec252e533a3fc 100644 (file)
@@ -102,6 +102,8 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
  *   VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV
  *   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
  *
  * 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
index 81752e852095c3096de488c8124ad544122f826b..f5ffe5252430d24b1ce102f8a0c9589e8126002d 100644 (file)
@@ -468,7 +468,11 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
             flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA;
             break;
         case VIR_NODE_DEV_CAP_AP_CARD:
+            flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD;
+            break;
         case VIR_NODE_DEV_CAP_AP_QUEUE:
+            flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE;
+            break;
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }