1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

nodedev: Support SCSI_GENERIC cap flag for listAllNodeDevices

This commit is contained in:
Osier Yang 2013-06-03 18:05:34 +08:00
parent dd451f3aac
commit 4a7b3e58bd
4 changed files with 7 additions and 2 deletions

View File

@ -3259,6 +3259,7 @@ typedef enum {
VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, /* Storage device */
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 */
} virConnectListAllNodeDeviceFlags;
int virConnectListAllNodeDevices (virConnectPtr conn,

View File

@ -1496,7 +1496,9 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj,
(MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST) &&
virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_FC_HOST)) ||
(MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS) &&
virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_VPORTS))))
virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_VPORTS)) ||
(MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC) &&
virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SCSI_GENERIC))))
return false;
}

View File

@ -274,7 +274,8 @@ void virNodeDeviceObjUnlock(virNodeDeviceObjPtr obj);
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI | \
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_VPORTS | \
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC)
int virNodeDeviceList(virConnectPtr conn,
virNodeDeviceObjList devobjs,

View File

@ -14294,6 +14294,7 @@ error:
* 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
*
* 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