virsh: nodedev: filter by AP Matrix capability

Add support to filter by 'ap_matrix' capability.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Shalini Chellathurai Saroja 2020-12-03 18:59:40 +01:00 committed by Erik Skultety
parent dc3bc76c1c
commit 385ade999c
7 changed files with 12 additions and 3 deletions

View File

@ -454,6 +454,9 @@
<dd>AP Queue identifier.</dd> <dd>AP Queue identifier.</dd>
</dl> </dl>
</dd> </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> </dl>
</dd> </dd>
</dl> </dl>

View 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 separated by comma, e.g. --cap pci,scsi. Valid capability types include
'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target', 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target',
'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev', '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 If *--tree* is used, the output is formatted in a tree representing parents of each
node. *cap* and *--tree* are mutually exclusive. node. *cap* and *--tree* are mutually exclusive.

View File

@ -85,6 +85,7 @@ typedef enum {
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA = 1 << 17, /* vDPA 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_CARD = 1 << 18, /* s390 AP Card device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 19, /* s390 AP Queue */ VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 19, /* s390 AP Queue */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX = 1 << 20, /* s390 AP Matrix */
} virConnectListAllNodeDeviceFlags; } virConnectListAllNodeDeviceFlags;
int virConnectListAllNodeDevices (virConnectPtr conn, int virConnectListAllNodeDevices (virConnectPtr conn,

View File

@ -412,7 +412,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps);
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_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_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 int
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host); virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host);

View File

@ -874,7 +874,8 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj,
MATCH(CSS_DEV) || MATCH(CSS_DEV) ||
MATCH(VDPA) || MATCH(VDPA) ||
MATCH(AP_CARD) || MATCH(AP_CARD) ||
MATCH(AP_QUEUE))) MATCH(AP_QUEUE) ||
MATCH(AP_MATRIX)))
return false; return false;
} }

View File

@ -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_CSS_DEV
* VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD * 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
* *
* Returns the number of node devices found or -1 and sets @devices to NULL in * 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 * case of error. On success, the array stored into @devices is guaranteed to

View File

@ -474,6 +474,8 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE; flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE;
break; break;
case VIR_NODE_DEV_CAP_AP_MATRIX: case VIR_NODE_DEV_CAP_AP_MATRIX:
flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX;
break;
case VIR_NODE_DEV_CAP_LAST: case VIR_NODE_DEV_CAP_LAST:
break; break;
} }