This patch contains the public API additions.
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 3624367..c888943 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -993,6 +993,76 @@ char * virStorageVolGetPath(virStorageVolPtr vol);
virDomainPtrvirDomainCreateLinux(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
+
+/*
+ * Host device enumeration
+ */
+
+/**
+ * virNodeDevice:
+ *
+ * A virNodeDevice contains a node (host) device details.
+ */
+
+typedef struct _virNodeDevice virNodeDevice;
+
+/**
+ * virNodeDevicePtr:
+ *
+ * A virNodeDevicePtr is a pointer to a virNodeDevice structure. Get
+ * one via virNodeDeviceLookupByKey, virNodeDeviceLookupByName, or
+ * virNodeDeviceCreate. Be sure to Call virNodeDeviceFree when done
+ * using a virNodeDevicePtr obtained from any of the above functions to
+ * avoid leaking memory.
+ */
+
+typedef virNodeDevice *virNodeDevicePtr;
+
+
+int virNodeNumOfDevices (virConnectPtr conn,
+ unsigned int flags);
+
+int virNodeListDevices (virConnectPtr conn,
+ char **const names,
+ int maxnames,
+ unsigned int flags);
+
+int virNodeNumOfDevicesByCap (virConnectPtr conn,
+ const char *cap,
+ unsigned int flags);
+
+int virNodeListDevicesByCap (virConnectPtr conn,
+ const char *cap,
+ char **const names,
+ int maxnames,
+ unsigned int flags);
+
+virNodeDevicePtrvirNodeDeviceLookupByName (virConnectPtr conn,
+ const char *name);
+
+const char *virNodeDeviceGetName (virNodeDevicePtr dev);
+
+const char *virNodeDeviceGetParent (virNodeDevicePtr dev);
+
+int virNodeDeviceNumOfCaps (virNodeDevicePtr dev);
+
+int virNodeDeviceListCaps(virNodeDevicePtr dev,
+ char **const names,
+ int maxnames);
+
+char * virNodeDeviceGetXMLDesc (virNodeDevicePtr dev,
+ unsigned int flags);
+
+virNodeDevicePtrvirNodeDeviceCreate (virConnectPtr conn,
+ const char *xml,
+ unsigned int flags);
+
+int virNodeDeviceDestroy(virNodeDevicePtr dev,
+ unsigned int flags);
+
+int virNodeDeviceFree (virNodeDevicePtr dev);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 8e24708..020b8dc 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -58,6 +58,7 @@ typedef enum {
VIR_FROM_STORAGE, /* Error from storage driver */
VIR_FROM_NETWORK, /* Error from network config */
VIR_FROM_DOMAIN,/* Error from domain config */
+VIR_FROM_NODE, /* Error from node driver */
} virErrorDomain;
@@ -148,6 +149,9 @@ typedef enum {
VIR_WAR_NO_STORAGE, /* failed to start storage */
VIR_ERR_NO_STORAGE_POOL, /* storage pool not found */
VIR_ERR_NO_STORAGE_VOL, /* storage pool not found */
+VIR_WAR_NO_NODE, /* failed to start node driver */
+VIR_ERR_INVALID_NODE_DEVICE,/* invalid node device object */
+VIR_ERR_NO_NODE_DEVICE,/* node device not found */
} virErrorNumber;
/**
diff --git a/src/libvirt.c b/src/libvirt.c
index ca2675a..5cef752 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -73,6 +73,8 @@ static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
static int virNetworkDriverTabCount = 0;
static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
static int virStorageDriverTabCount = 0;
+static virNodeDriverPtr virNodeDriverTab[MAX_DRIVERS];
+static int virNodeDriverTabCount = 0;
#ifdef WITH_LIBVIRTD
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
static int virStateDriverTabCount = 0;
@@ -299,6 +301,12 @@ virInitialize(void)
#ifdef WITH_NETWORK
if (networkRegister() == -1) return -1;
#endif
+#ifdef HAVE_HAL
+if (halNodeRegister() == -1) return -1;
+#endif
+#ifdef HAVE_DEVKIT
+if (devkitNodeRegister() == -1) return -1;
+#endif
if (storageRegister() == -1) return -1;