After
7f1bdec5fa0a0cd25 our nodedev driver is capable of
determining DRM devices (DRM stands for Direct Render Manager not
Digital rights management). There is still one bit missing
though: virConnectListAllNodeDevices() is capable of listing
either all devices or just those with specified capability. Well,
DRM capability is missing there.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
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,
MATCH(STORAGE) ||
MATCH(FC_HOST) ||
MATCH(VPORTS) ||
- MATCH(SCSI_GENERIC)))
+ MATCH(SCSI_GENERIC) ||
+ MATCH(DRM)))
return false;
}
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);
* 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
goto cleanup;
}
- switch (cap_type) {
+ switch ((virNodeDevCapType) cap_type) {
case VIR_NODE_DEV_CAP_SYSTEM:
flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM;
break;
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;
}
}
I<cap> 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<cap> 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<cap> and I<--tree> are mutually exclusive.
=item B<nodedev-reattach> I<nodedev>