Public API for node device enumeration (David Lively)

This commit is contained in:
Daniel P. Berrange
2008-11-21 12:19:22 +00:00
parent 2c855c1c66
commit 0793e73c02
10 changed files with 703 additions and 0 deletions

View File

@@ -994,6 +994,59 @@ virDomainPtr virDomainCreateLinux (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,
const char *cap,
unsigned int flags);
int virNodeListDevices (virConnectPtr conn,
const char *cap,
char **const names,
int maxnames,
unsigned int flags);
virNodeDevicePtr virNodeDeviceLookupByName (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);
int virNodeDeviceFree (virNodeDevicePtr dev);
/*
* Domain Event Notification
*/

View File

@@ -994,6 +994,59 @@ virDomainPtr virDomainCreateLinux (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,
const char *cap,
unsigned int flags);
int virNodeListDevices (virConnectPtr conn,
const char *cap,
char **const names,
int maxnames,
unsigned int flags);
virNodeDevicePtr virNodeDeviceLookupByName (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);
int virNodeDeviceFree (virNodeDevicePtr dev);
/*
* Domain Event Notification
*/

View File

@@ -59,6 +59,7 @@ typedef enum {
VIR_FROM_NETWORK, /* Error from network config */
VIR_FROM_DOMAIN, /* Error from domain config */
VIR_FROM_UML, /* Error at the UML driver */
VIR_FROM_NODEDEV, /* Error from node device monitor */
} virErrorDomain;
@@ -149,6 +150,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;
/**