From: Farhan Ali <al...@linux.ibm.com> Add support to filter by 'ap_card' and 'ap_queue' capabilities.
Signed-off-by: Farhan Ali <al...@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiu...@linux.ibm.com> Reviewed-by: Bjoern Walk <bw...@linux.ibm.com> Signed-off-by: Shalini Chellathurai Saroja <shal...@linux.ibm.com> --- docs/manpages/virsh.rst | 2 +- include/libvirt/libvirt-nodedev.h | 2 ++ src/conf/node_device_conf.h | 4 +++- src/conf/virnodedeviceobj.c | 4 +++- src/libvirt-nodedev.c | 2 ++ tools/virsh-nodedev.c | 4 ++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index d34a1c86..e4110c45 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'. +'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. diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-nodedev.h index dd2ffd57..789f9c86 100644 --- a/include/libvirt/libvirt-nodedev.h +++ b/include/libvirt/libvirt-nodedev.h @@ -82,6 +82,8 @@ typedef enum { VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV = 1 << 14, /* Mediated device */ 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_AP_CARD = 1 << 17, /* s390 AP Card device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 18, /* s390 AP Queue */ } virConnectListAllNodeDeviceFlags; int virConnectListAllNodeDevices (virConnectPtr conn, diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index c8100c8b..d732efaa 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -386,7 +386,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES | \ 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_CSS_DEV | \ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD | \ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE) int virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host); diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 0fd44f6f..0ce230db 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -864,7 +864,9 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj, MATCH(MDEV_TYPES) || MATCH(MDEV) || MATCH(CCW_DEV) || - MATCH(CSS_DEV))) + MATCH(CSS_DEV) || + MATCH(AP_CARD) || + MATCH(AP_QUEUE))) return false; } diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c index 28765b9c..762413eb 100644 --- a/src/libvirt-nodedev.c +++ b/src/libvirt-nodedev.c @@ -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 diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index f79e0b78..3862d8f3 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -465,7 +465,11 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV; 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; } -- 2.26.2