diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-nodedev.h index 4ff8b416ae939dc8a755aeb6002248dddd2aa9f2..85003903d73f1236912dbbc834f74672c17ad162 100644 --- a/include/libvirt/libvirt-nodedev.h +++ b/include/libvirt/libvirt-nodedev.h @@ -78,6 +78,7 @@ typedef enum { VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = 1 << 9, /* FC Host Bus Adapter */ VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = 1 << 10, /* Capable of vport */ VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = 1 << 11, /* Capable of scsi_generic */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM = 1 << 12, /* DRM device */ } virConnectListAllNodeDeviceFlags; int virConnectListAllNodeDevices (virConnectPtr conn, diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index f996db115221a7807d42c8aa491a2a600956e1d2..b3063d9ec0144e50042ad6da35c1b1e9341bc27c 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -2224,7 +2224,8 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj, MATCH(STORAGE) || MATCH(FC_HOST) || MATCH(VPORTS) || - MATCH(SCSI_GENERIC))) + MATCH(SCSI_GENERIC) || + MATCH(DRM))) return false; } diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index be7e0e003afbac50ce472e9120fcdfa99cee4b81..40e930a280e095bbe6b3d8edd6656723daded9cd 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -340,7 +340,8 @@ void virNodeDeviceObjUnlock(virNodeDeviceObjPtr obj); VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS | \ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC) + VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC | \ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM) typedef bool (*virNodeDeviceObjListFilter)(virConnectPtr conn, virNodeDeviceDefPtr def); diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c index 6ea14b3e378aa495c17c011c06826e901931a895..83376b0d96dc47820694870c69d3b1f18e0d5dff 100644 --- a/src/libvirt-nodedev.c +++ b/src/libvirt-nodedev.c @@ -97,6 +97,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags) * VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST * VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS * VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC + * VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM * * 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 9ede96886210c1eb2fe285f0eaed85a5482a5aab..c691440219d2e4b03d01d230aa98ceda74385486 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -414,7 +414,7 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) goto cleanup; } - switch (cap_type) { + switch ((virNodeDevCapType) cap_type) { case VIR_NODE_DEV_CAP_SYSTEM: flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM; break; @@ -451,7 +451,10 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) case VIR_NODE_DEV_CAP_SCSI_GENERIC: flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC; break; - default: + case VIR_NODE_DEV_CAP_DRM: + flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM; + break; + case VIR_NODE_DEV_CAP_LAST: break; } } diff --git a/tools/virsh.pod b/tools/virsh.pod index a47040984b0bd0acbddcf87d574f1278cf36ddd0..90f4b5a1f73cfe549b64e3d55fdbbe1e85dd75b4 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -3072,9 +3072,9 @@ List all of the devices available on the node that are known by libvirt. I is used to filter the list by capability types, the types must be 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'. If I<--tree> is -used, the output is formatted in a tree representing parents of each node. -I and I<--tree> are mutually exclusive. +'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm'.If I<--tree> +is used, the output is formatted in a tree representing parents of each +node. I and I<--tree> are mutually exclusive. =item B I