aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsier Yang <jyang@redhat.com>2012-09-05 13:34:10 +0800
committerOsier Yang <jyang@redhat.com>2012-09-17 10:40:31 +0800
commitc68cd62adb83c74bdd54431d3988400b506aaf3a (patch)
tree1ab5fc77b8b94c04f37defb11098f09c09767307 /src/node_device/node_device_driver.c
parentlist: Add helpers for listing node devices (diff)
downloadlibvirt-c68cd62adb83c74bdd54431d3988400b506aaf3a.tar.gz
libvirt-c68cd62adb83c74bdd54431d3988400b506aaf3a.tar.bz2
libvirt-c68cd62adb83c74bdd54431d3988400b506aaf3a.zip
list: Implement listAllNodeDevices
This simply implements listAllNodeDevices using helper virNodeDeviceList src/node_device/node_device_driver.h: * Declare nodeListAllNodeDevices. src/node_device/node_device_driver.c: * Implement nodeListAllNodeDevices. src/node_device/node_device_hal.c: * Hook listAllNodeDevices to nodeListAllNodeDevices. src/node_device/node_device_udev.c * Hook listAllNodeDevices to nodeListAllNodeDevices.
Diffstat (limited to 'src/node_device/node_device_driver.c')
-rw-r--r--src/node_device/node_device_driver.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index d44924c13..4c6270787 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -183,6 +183,21 @@ nodeListDevices(virConnectPtr conn,
return -1;
}
+int
+nodeListAllNodeDevices(virConnectPtr conn,
+ virNodeDevicePtr **devices,
+ unsigned int flags)
+{
+ virDeviceMonitorStatePtr driver = conn->devMonPrivateData;
+ int ret = -1;
+
+ virCheckFlags(VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP, -1);
+
+ nodeDeviceLock(driver);
+ ret = virNodeDeviceList(conn, driver->devs, devices, flags);
+ nodeDeviceUnlock(driver);
+ return ret;
+}
virNodeDevicePtr
nodeDeviceLookupByName(virConnectPtr conn, const char *name)