On 09/13/12 08:54, Osier Yang wrote:
This is to list the node device objects, supports to filter the results by capability types. include/libvirt/libvirt.h.in: Declare enum virConnectListAllNodeDeviceFlags and virConnectListAllNodeDevices. python/generator.py: Skip auto-generating src/driver.h: (virDrvConnectListAllNodeDevices) src/libvirt.c: Implement the public API src/libvirt_public.syms: Export the symbol to public --- include/libvirt/libvirt.h.in | 39 +++++++++++++++++++++++ python/generator.py | 1 + src/driver.h | 4 ++ src/libvirt.c | 71 ++++++++++++++++++++++++++++++++++++++++++ src/libvirt_public.syms | 1 + 5 files changed, 116 insertions(+), 0 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index ca04f6c..2bb39be 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -2834,6 +2834,45 @@ int virNodeListDevices (virConnectPtr conn, char **const names, int maxnames, unsigned int flags); +/* + * virConnectListAllNodeDevices: + * + * Flags used to filter the returned node devices. Flags in each group + * are exclusive. Currently only one group to filter the devices by cap + * type. + */ +typedef enum { + /* System capability */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = 1 << 0,
You unfortunately need to specify the comment _after_ the value, otherwise the docs generator generates the comments to wrong lines.
+ + /* PCI device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = 1 << 1, + + /* USB device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = 1 << 2, + + /* USB interface */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = 1 << 3, + + /* Network device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET = 1 << 4, + + /* SCSI Host Bus Adapter */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = 1 << 5, + + /* SCSI Target */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = 1 << 6, + + /* SCSI device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI = 1 << 7, + + /* Storage device */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, +} virConnectListAllNodeDeviceFlags; + +int virConnectListAllNodeDevices (virConnectPtr conn, + virNodeDevicePtr **devices, + unsigned int flags); virNodeDevicePtr virNodeDeviceLookupByName (virConnectPtr conn, const char *name);
Otherwise ACK as you addressed all my comments. Peter -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list