mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Public API for node device enumeration (David Lively)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user