diff --git a/ChangeLog b/ChangeLog index 4c206155cb..06821d96b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 21 12:51:14 BST 2008 Daniel P. Berrange + + * libvirt-api.xml, libvirt-refs.xml, html/libvirt-libvirt.html, + html/libvirt-virterror.html: Regenerate for new APIs + Fri Nov 21 12:46:14 BST 2008 Daniel P. Berrange Misc tweaks to node device impl diff --git a/docs/html/libvirt-libvirt.html b/docs/html/libvirt-libvirt.html index eaf9e8b1f5..96d18ecfc8 100644 --- a/docs/html/libvirt-libvirt.html +++ b/docs/html/libvirt-libvirt.html @@ -45,6 +45,8 @@ typedef enum virDomainXMLFlags typedef enum virEventHandleType typedef struct _virNetwork virNetwork typedef virNetwork * virNetworkPtr +typedef struct _virNodeDevice virNodeDevice +typedef virNodeDevice * virNodeDevicePtr typedef struct _virNodeInfo virNodeInfo typedef virNodeInfo * virNodeInfoPtr typedef struct _virSchedParameter virSchedParameter @@ -74,7 +76,7 @@ typedef virConnectDomainEventCallbackvirConnectDomainEventCallback (virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void * opaque) int virConnectDomainEventDeregister (virConnectPtr conn,
virConnectDomainEventCallback cb) -int virConnectDomainEventRegister (virConnectPtr conn,
virConnectDomainEventCallback cb,
void * opaque) +int virConnectDomainEventRegister (virConnectPtr conn,
virConnectDomainEventCallback cb,
void * opaque,
virFreeCallback freecb) char * virConnectFindStoragePoolSources (virConnectPtr conn,
const char * type,
const char * srcSpec,
unsigned int flags) char * virConnectGetCapabilities (virConnectPtr conn) char * virConnectGetHostname (virConnectPtr conn) @@ -143,17 +145,17 @@ int virDomainShutdown (virDomainSuspend (virDomainPtr domain) int virDomainUndefine (virDomainPtr domain) typedef virEventAddHandleFunc -int virEventAddHandleFunc (int fd,
int event,
virEventHandleCallback cb,
void * opaque) +int virEventAddHandleFunc (int fd,
int event,
virEventHandleCallback cb,
void * opaque,
virFreeCallback ff) typedef virEventAddTimeoutFunc -int virEventAddTimeoutFunc (int timeout,
virEventTimeoutCallback cb,
void * opaque) +int virEventAddTimeoutFunc (int timeout,
virEventTimeoutCallback cb,
void * opaque,
virFreeCallback ff) typedef virEventHandleCallback -void virEventHandleCallback (int fd,
int events,
void * opaque) +void virEventHandleCallback (int watch,
int fd,
int events,
void * opaque) void virEventRegisterImpl (virEventAddHandleFunc addHandle,
virEventUpdateHandleFunc updateHandle,
virEventRemoveHandleFunc removeHandle,
virEventAddTimeoutFunc addTimeout,
virEventUpdateTimeoutFunc updateTimeout,
virEventRemoveTimeoutFunc removeTimeout) typedef virEventRemoveHandleFunc -int virEventRemoveHandleFunc (int fd) +int virEventRemoveHandleFunc (int watch) typedef virEventRemoveTimeoutFunc int virEventRemoveTimeoutFunc (int timer) @@ -162,11 +164,14 @@ typedef virEventTimeoutCallback void virEventTimeoutCallback (int timer,
void * opaque) typedef virEventUpdateHandleFunc -void virEventUpdateHandleFunc (int fd,
int event) +void virEventUpdateHandleFunc (int watch,
int event) typedef virEventUpdateTimeoutFunc void virEventUpdateTimeoutFunc (int timer,
int timeout) +typedef virFreeCallback +void virFreeCallback (void * opaque) + int virGetVersion (unsigned long * libVer,
const char * type,
unsigned long * typeVer) int virInitialize (void) int virNetworkCreate (virNetworkPtr network) @@ -186,9 +191,18 @@ char * virNetworkGetXMLDesc (virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn,
const char * uuidstr) int virNetworkSetAutostart (virNetworkPtr network,
int autostart) int virNetworkUndefine (virNetworkPtr network) +int virNodeDeviceFree (virNodeDevicePtr dev) +const char * virNodeDeviceGetName (virNodeDevicePtr dev) +const char * virNodeDeviceGetParent (virNodeDevicePtr dev) +char * virNodeDeviceGetXMLDesc (virNodeDevicePtr dev,
unsigned int flags) +int virNodeDeviceListCaps (virNodeDevicePtr dev,
char ** const names,
int maxnames) +virNodeDevicePtr virNodeDeviceLookupByName (virConnectPtr conn,
const char * name) +int virNodeDeviceNumOfCaps (virNodeDevicePtr dev) int virNodeGetCellsFreeMemory (virConnectPtr conn,
unsigned long long * freeMems,
int startCell,
int maxCells) unsigned long long virNodeGetFreeMemory (virConnectPtr conn) int virNodeGetInfo (virConnectPtr conn,
virNodeInfoPtr info) +int virNodeListDevices (virConnectPtr conn,
const char * cap,
char ** const names,
int maxnames,
unsigned int flags) +int virNodeNumOfDevices (virConnectPtr conn,
const char * cap,
unsigned int flags) int virStoragePoolBuild (virStoragePoolPtr pool,
unsigned int flags) int virStoragePoolCreate (virStoragePoolPtr pool,
unsigned int flags) virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn,
const char * xmlDesc,
unsigned int flags) @@ -278,6 +292,9 @@ char * virStorageVolGetXMLDesc (

virNetwork

struct virNetwork{
 
The content of this structure is not made public by the API
 }
+

virNodeDevice

struct virNodeDevice{
+
The content of this structure is not made public by the API
+}
 

virNodeInfo

struct virNodeInfo{
 
charmodel[32]model : string indicating the CPU model
unsigned longmemory : memory size in kilobytes
unsigned intcpus : the number of active CPUs
unsigned intmhz : expected CPU frequency
unsigned intnodes : the number of NUMA cell, 1 for uniform mem access
unsigned intsockets : number of CPU socket per node
unsigned intcores : number of core per socket
unsigned intthreads : number of threads per core
 }
@@ -317,8 +334,8 @@ char *	virStorageVolGetXMLDesc		(

cred:
ncred:
cbdata:
Returns:

virConnectClose

int	virConnectClose			(virConnectPtr conn)

This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.

conn:pointer to the hypervisor connection
Returns:0 in case of success or -1 in case of error.

virConnectDomainEventCallback

typedef int	(*virConnectDomainEventCallback)	(virConnectPtr conn, 
virDomainPtr dom,
int event,
int detail,
void * opaque)

A callback function to be registered, and called when a domain event occurs

conn:virConnect connection
dom:The domain on which the event occured
event:The specfic virDomainEventType which occured
detail:event specific detail information
opaque:opaque user data
Returns:

virConnectDomainEventDeregister

int	virConnectDomainEventDeregister	(virConnectPtr conn, 
virConnectDomainEventCallback cb)
-

Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type

conn:pointer to the connection
cb:callback to the function handling domain events
Returns:0 on success, -1 on failure

virConnectDomainEventRegister

int	virConnectDomainEventRegister	(virConnectPtr conn, 
virConnectDomainEventCallback cb,
void * opaque)
-

Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events

conn:pointer to the connection
cb:callback to the function handling domain events
opaque:opaque data to pass on to the callback
Returns:0 on success, -1 on failure

virConnectFindStoragePoolSources

char *	virConnectFindStoragePoolSources	(virConnectPtr conn, 
const char * type,
const char * srcSpec,
unsigned int flags)
+

Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type

conn:pointer to the connection
cb:callback to the function handling domain events
Returns:0 on success, -1 on failure

virConnectDomainEventRegister

int	virConnectDomainEventRegister	(virConnectPtr conn, 
virConnectDomainEventCallback cb,
void * opaque,
virFreeCallback freecb)
+

Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events

conn:pointer to the connection
cb:callback to the function handling domain events
opaque:opaque data to pass on to the callback
freecb:
Returns:0 on success, -1 on failure

virConnectFindStoragePoolSources

char *	virConnectFindStoragePoolSources	(virConnectPtr conn, 
const char * type,
const char * srcSpec,
unsigned int flags)

Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)

conn:pointer to hypervisor connection
type:type of storage pool sources to discover
srcSpec:XML document specifying discovery source
flags:flags for discovery (unused, pass 0)
Returns:an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.

virConnectGetCapabilities

char *	virConnectGetCapabilities	(virConnectPtr conn)

Provides capabilities of the hypervisor / driver.

conn:pointer to the hypervisor connection
Returns:NULL in case of error, or an XML string defining the capabilities. The client must free the returned string after use.

virConnectGetHostname

char *	virConnectGetHostname		(virConnectPtr conn)

This returns the system hostname on which the hypervisor is running (the result of the gethostname(2) system call). If we are connected to a remote system, then this returns the hostname of the remote system.

conn:pointer to a hypervisor connection
Returns:the hostname which must be freed by the caller, or NULL if there was an error.

virConnectGetMaxVcpus

int	virConnectGetMaxVcpus		(virConnectPtr conn, 
const char * type)
@@ -385,16 +402,17 @@ char * virStorageVolGetXMLDesc (

Dynamically change the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrary limited. This function requires privileged access to the hypervisor.

domain:pointer to domain object, or NULL for Domain0
nvcpus:the new number of virtual CPUs for this domain
Returns:0 in case of success, -1 in case of failure.

virDomainShutdown

int	virDomainShutdown		(virDomainPtr domain)

Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. Note that the guest OS may ignore the request. TODO: should we add an option for reboot, knowing it may not be doable in the general case ?

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainSuspend

int	virDomainSuspend		(virDomainPtr domain)

Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use virDomainResume() to reactivate the domain. This function may requires privileged access.

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainUndefine

int	virDomainUndefine		(virDomainPtr domain)
-

Undefine a domain but does not stop it if it is running

domain:pointer to a defined domain
Returns:0 in case of success, -1 in case of error

virEventAddHandleFunc

typedef int	(*virEventAddHandleFunc	)	(int fd, 
int event,
virEventHandleCallback cb,
void * opaque) -

Part of the EventImpl, this callback Adds a file handle callback to listen for specific events

fd:file descriptor to listen on
event:bitset of events on which to fire the callback
cb:the callback to be called
opaque:user data to pass to the callback
Returns:

virEventAddTimeoutFunc

typedef int	(*virEventAddTimeoutFunc	)	(int timeout, 
virEventTimeoutCallback cb,
void * opaque) -

Part of the EventImpl, this user-defined callback handles adding an event timeout.

timeout:The timeout to monitor
cb:the callback to call when timeout has expired
opaque:user data to pass to the callback
Returns:a timer value

virEventHandleCallback

typedef void	(*virEventHandleCallback	)	(int fd, 
int events,
void * opaque) -

callback for receiving file handle events

fd:file handle on which the event occurred
events:bitset of events from virEventHandleType constants
opaque:user data registered with handle

virEventRegisterImpl

void	virEventRegisterImpl		(virEventAddHandleFunc addHandle, 
virEventUpdateHandleFunc updateHandle,
virEventRemoveHandleFunc removeHandle,
virEventAddTimeoutFunc addTimeout,
virEventUpdateTimeoutFunc updateTimeout,
virEventRemoveTimeoutFunc removeTimeout)
-

addHandle:
updateHandle:
removeHandle:
addTimeout:
updateTimeout:
removeTimeout:

virEventRemoveHandleFunc

typedef int	(*virEventRemoveHandleFunc)	(int fd)
-

Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on

fd:file descriptor to stop listening on
Returns:

virEventRemoveTimeoutFunc

typedef int	(*virEventRemoveTimeoutFunc)	(int timer)
-

Part of the EventImpl, this user-defined callback removes a timer

timer:the timer to remove
Returns:0 on success, -1 on failure

virEventTimeoutCallback

typedef void	(*virEventTimeoutCallback	)	(int timer, 
void * opaque) -

callback for receiving timer events

timer:timer id emitting the event
opaque:user data registered with handle

virEventUpdateHandleFunc

typedef void	(*virEventUpdateHandleFunc)	(int fd, 
int event) -

Part of the EventImpl, this user-provided callback is notified when events to listen on change

fd:file descriptor to modify
event:new events to listen on

virEventUpdateTimeoutFunc

typedef void	(*virEventUpdateTimeoutFunc)	(int timer, 
int timeout) -

Part of the EventImpl, this user-defined callback updates an event timeout.

timer:the timer to modify
timeout:the new timeout value

virGetVersion

int	virGetVersion			(unsigned long * libVer, 
const char * type,
unsigned long * typeVer)
+

Undefine a domain but does not stop it if it is running

domain:pointer to a defined domain
Returns:0 in case of success, -1 in case of error

virEventAddHandleFunc

typedef int	(*virEventAddHandleFunc	)	(int fd, 
int event,
virEventHandleCallback cb,
void * opaque,
virFreeCallback ff) +

Part of the EventImpl, this callback Adds a file handle callback to listen for specific events. The same file handle can be registered multiple times provided the requested event sets are non-overlapping If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.

fd:file descriptor to listen on
event:bitset of events on which to fire the callback
cb:the callback to be called when an event occurrs
opaque:user data to pass to the callback
ff:the callback invoked to free opaque data blob
Returns:a handle watch number to be used for updating and unregistering for events

virEventAddTimeoutFunc

typedef int	(*virEventAddTimeoutFunc	)	(int timeout, 
virEventTimeoutCallback cb,
void * opaque,
virFreeCallback ff) +

Part of the EventImpl, this user-defined callback handles adding an event timeout. If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.

timeout:The timeout to monitor
cb:the callback to call when timeout has expired
opaque:user data to pass to the callback
ff:the callback invoked to free opaque data blob
Returns:a timer value

virEventHandleCallback

typedef void	(*virEventHandleCallback	)	(int watch, 
int fd,
int events,
void * opaque) +

Callback for receiving file handle events. The callback will be invoked once for each event which is pending.

watch:watch on which the event occurred
fd:file handle on which the event occurred
events:bitset of events from virEventHandleType constants
opaque:user data registered with handle

virEventRegisterImpl

void	virEventRegisterImpl		(virEventAddHandleFunc addHandle, 
virEventUpdateHandleFunc updateHandle,
virEventRemoveHandleFunc removeHandle,
virEventAddTimeoutFunc addTimeout,
virEventUpdateTimeoutFunc updateTimeout,
virEventRemoveTimeoutFunc removeTimeout)
+

addHandle:
updateHandle:
removeHandle:
addTimeout:
updateTimeout:
removeTimeout:

virEventRemoveHandleFunc

typedef int	(*virEventRemoveHandleFunc)	(int watch)
+

Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on. If a virEventHandleFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data.

watch:file descriptor watch to stop listening on
Returns:

virEventRemoveTimeoutFunc

typedef int	(*virEventRemoveTimeoutFunc)	(int timer)
+

Part of the EventImpl, this user-defined callback removes a timer If a virEventTimeoutFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data.

timer:the timer to remove
Returns:0 on success, -1 on failure

virEventTimeoutCallback

typedef void	(*virEventTimeoutCallback	)	(int timer, 
void * opaque) +

callback for receiving timer events

timer:timer id emitting the event
opaque:user data registered with handle

virEventUpdateHandleFunc

typedef void	(*virEventUpdateHandleFunc)	(int watch, 
int event) +

Part of the EventImpl, this user-provided callback is notified when events to listen on change

watch:file descriptor watch to modify
event:new events to listen on

virEventUpdateTimeoutFunc

typedef void	(*virEventUpdateTimeoutFunc)	(int timer, 
int timeout) +

Part of the EventImpl, this user-defined callback updates an event timeout.

timer:the timer to modify
timeout:the new timeout value

virFreeCallback

typedef void	(*virFreeCallback		)	(void * opaque)
+

opaque:

virGetVersion

int	virGetVersion			(unsigned long * libVer, 
const char * type,
unsigned long * typeVer)

Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, if @type is unknown or not available, an error code will be returned and @typeVer will be 0.

libVer:return value for the library version (OUT)
type:the type of connection/driver looked at
typeVer:return value for the version of the hypervisor (OUT)
Returns:-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.

virInitialize

int	virInitialize			(void)

Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library.

Returns:0 in case of success, -1 in case of error

virNetworkCreate

int	virNetworkCreate		(virNetworkPtr network)

Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.

network:pointer to a defined network
Returns:0 in case of success, -1 in case of error

virNetworkCreateXML

virNetworkPtr	virNetworkCreateXML	(virConnectPtr conn, 
const char * xmlDesc)
@@ -413,10 +431,19 @@ char * virStorageVolGetXMLDesc (

Try to lookup a network on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuid:the raw UUID for the network
Returns:a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised.

virNetworkLookupByUUIDString

virNetworkPtr	virNetworkLookupByUUIDString	(virConnectPtr conn, 
const char * uuidstr)

Try to lookup a network on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuidstr:the string UUID for the network
Returns:a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised.

virNetworkSetAutostart

int	virNetworkSetAutostart		(virNetworkPtr network, 
int autostart)

Configure the network to be automatically started when the host machine boots.

network:a network object
autostart:whether the network should be automatically started 0 or 1
Returns:-1 in case of error, 0 in case of success

virNetworkUndefine

int	virNetworkUndefine		(virNetworkPtr network)
-

Undefine a network but does not stop it if it is running

network:pointer to a defined network
Returns:0 in case of success, -1 in case of error

virNodeGetCellsFreeMemory

int	virNodeGetCellsFreeMemory	(virConnectPtr conn, 
unsigned long long * freeMems,
int startCell,
int maxCells)
+

Undefine a network but does not stop it if it is running

network:pointer to a defined network
Returns:0 in case of success, -1 in case of error

virNodeDeviceFree

int	virNodeDeviceFree		(virNodeDevicePtr dev)
+

Drops a reference to the node device, freeing it if this was the last reference.

dev:pointer to the node device
Returns:the 0 for success, -1 for error.

virNodeDeviceGetName

const char *	virNodeDeviceGetName	(virNodeDevicePtr dev)
+

dev:the device
Returns:the device name.

virNodeDeviceGetParent

const char *	virNodeDeviceGetParent	(virNodeDevicePtr dev)
+

dev:the device
Returns:the name of the device's parent, or NULL if the device has no parent.

virNodeDeviceGetXMLDesc

char *	virNodeDeviceGetXMLDesc		(virNodeDevicePtr dev, 
unsigned int flags)
+

Fetch an XML document describing all aspects of the device.

dev:pointer to the node device
flags:flags for XML generation (unused, pass 0)
Returns:the XML document, or NULL on error

virNodeDeviceListCaps

int	virNodeDeviceListCaps		(virNodeDevicePtr dev, 
char ** const names,
int maxnames)
+

Lists the names of the capabilities supported by the device.

dev:the device
names:array to collect the list of capability names
maxnames:size of @names
Returns:the number of capability names listed in @names.

virNodeDeviceLookupByName

virNodeDevicePtr	virNodeDeviceLookupByName	(virConnectPtr conn, 
const char * name)
+

Lookup a node device by its name.

conn:pointer to the hypervisor connection
name:unique device name
Returns:a virNodeDevicePtr if found, NULL otherwise.

virNodeDeviceNumOfCaps

int	virNodeDeviceNumOfCaps		(virNodeDevicePtr dev)
+

dev:the device
Returns:the number of capabilities supported by the device.

virNodeGetCellsFreeMemory

int	virNodeGetCellsFreeMemory	(virConnectPtr conn, 
unsigned long long * freeMems,
int startCell,
int maxCells)

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

conn:pointer to the hypervisor connection
freeMems:pointer to the array of unsigned long long
startCell:index of first cell to return freeMems info on.
maxCells:Maximum number of cells for which freeMems information can be returned.
Returns:the number of entries filled in freeMems, or -1 in case of error.

virNodeGetFreeMemory

unsigned long long	virNodeGetFreeMemory	(virConnectPtr conn)

provides the free memory available on the Node

conn:pointer to the hypervisor connection
Returns:the available free memory in kilobytes or 0 in case of error

virNodeGetInfo

int	virNodeGetInfo			(virConnectPtr conn, 
virNodeInfoPtr info)
-

Extract hardware information about the node.

conn:pointer to the hypervisor connection
info:pointer to a virNodeInfo structure allocated by the user
Returns:0 in case of success and -1 in case of failure.

virStoragePoolBuild

int	virStoragePoolBuild		(virStoragePoolPtr pool, 
unsigned int flags)
+

Extract hardware information about the node.

conn:pointer to the hypervisor connection
info:pointer to a virNodeInfo structure allocated by the user
Returns:0 in case of success and -1 in case of failure.

virNodeListDevices

int	virNodeListDevices		(virConnectPtr conn, 
const char * cap,
char ** const names,
int maxnames,
unsigned int flags)
+

Collect the list of node devices, and store their names in @names If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability

conn:pointer to the hypervisor connection
cap:capability name
names:array to collect the list of node device names
maxnames:size of @names
flags:flags (unused, pass 0)
Returns:the number of node devices found or -1 in case of error

virNodeNumOfDevices

int	virNodeNumOfDevices		(virConnectPtr conn, 
const char * cap,
unsigned int flags)
+

Provides the number of node devices. If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability

conn:pointer to the hypervisor connection
cap:capability name
flags:flags (unused, pass 0)
Returns:the number of node devices or -1 in case of error

virStoragePoolBuild

int	virStoragePoolBuild		(virStoragePoolPtr pool, 
unsigned int flags)

Build the underlying storage pool

pool:pointer to storage pool
flags:future flags, use 0 for now
Returns:0 on success, or -1 upon failure

virStoragePoolCreate

int	virStoragePoolCreate		(virStoragePoolPtr pool, 
unsigned int flags)

Starts an inactive storage pool

pool:pointer to storage pool
flags:future flags, use 0 for now
Returns:0 on success, or -1 if it could not be started

virStoragePoolCreateXML

virStoragePoolPtr	virStoragePoolCreateXML	(virConnectPtr conn, 
const char * xmlDesc,
unsigned int flags)

Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted

conn:pointer to hypervisor connection
xmlDesc:XML description for new pool
flags:future flags, use 0 for now
Returns:a virStoragePoolPtr object, or NULL if creation failed

virStoragePoolDefineXML

virStoragePoolPtr	virStoragePoolDefineXML	(virConnectPtr conn, 
const char * xml,
unsigned int flags)
diff --git a/docs/html/libvirt-virterror.html b/docs/html/libvirt-virterror.html index 7d56e65c37..98ff2c8662 100644 --- a/docs/html/libvirt-virterror.html +++ b/docs/html/libvirt-virterror.html @@ -25,11 +25,11 @@ void virSetErrorFunc (void * userData,
intcode : The error code, a virErrorNumber
intdomain : What part of the library raised this error
char *message : human-readable informative error message
virErrorLevellevel : how consequent is the error
virConnectPtrconn : connection if available, deprecated see note above
virDomainPtrdom : domain if available, deprecated see note above
char *str1 : extra string information
char *str2 : extra string information
char *str3 : extra string information
intint1 : extra number information
intint2 : extra number information
virNetworkPtrnet : network if available, deprecated see note above
 }
 

virErrorDomain

enum virErrorDomain {
-
VIR_FROM_NONE = 0
VIR_FROM_XEN = 1 : Error at Xen hypervisor layer
VIR_FROM_XEND = 2 : Error at connection with xend daemon
VIR_FROM_XENSTORE = 3 : Error at connection with xen store
VIR_FROM_SEXPR = 4 : Error in the S-Expression code
VIR_FROM_XML = 5 : Error in the XML code
VIR_FROM_DOM = 6 : Error when operating on a domain
VIR_FROM_RPC = 7 : Error in the XML-RPC code
VIR_FROM_PROXY = 8 : Error in the proxy code
VIR_FROM_CONF = 9 : Error in the configuration file handling
VIR_FROM_QEMU = 10 : Error at the QEMU daemon
VIR_FROM_NET = 11 : Error when operating on a network
VIR_FROM_TEST = 12 : Error from test driver
VIR_FROM_REMOTE = 13 : Error from remote driver
VIR_FROM_OPENVZ = 14 : Error from OpenVZ driver
VIR_FROM_XENXM = 15 : Error at Xen XM layer
VIR_FROM_STATS_LINUX = 16 : Error in the Linux Stats code
VIR_FROM_LXC = 17 : Error from Linux Container driver
VIR_FROM_STORAGE = 18 : Error from storage driver
VIR_FROM_NETWORK = 19 : Error from network config
VIR_FROM_DOMAIN = 20 : Error from domain config
}
+
VIR_FROM_NONE = 0
VIR_FROM_XEN = 1 : Error at Xen hypervisor layer
VIR_FROM_XEND = 2 : Error at connection with xend daemon
VIR_FROM_XENSTORE = 3 : Error at connection with xen store
VIR_FROM_SEXPR = 4 : Error in the S-Expression code
VIR_FROM_XML = 5 : Error in the XML code
VIR_FROM_DOM = 6 : Error when operating on a domain
VIR_FROM_RPC = 7 : Error in the XML-RPC code
VIR_FROM_PROXY = 8 : Error in the proxy code
VIR_FROM_CONF = 9 : Error in the configuration file handling
VIR_FROM_QEMU = 10 : Error at the QEMU daemon
VIR_FROM_NET = 11 : Error when operating on a network
VIR_FROM_TEST = 12 : Error from test driver
VIR_FROM_REMOTE = 13 : Error from remote driver
VIR_FROM_OPENVZ = 14 : Error from OpenVZ driver
VIR_FROM_XENXM = 15 : Error at Xen XM layer
VIR_FROM_STATS_LINUX = 16 : Error in the Linux Stats code
VIR_FROM_LXC = 17 : Error from Linux Container driver
VIR_FROM_STORAGE = 18 : Error from storage driver
VIR_FROM_NETWORK = 19 : Error from network config
VIR_FROM_DOMAIN = 20 : Error from domain config
VIR_FROM_UML = 21 : Error at the UML driver
VIR_FROM_NODEDEV = 22 : Error from node device monitor
}
 

virErrorLevel

enum virErrorLevel {
 
VIR_ERR_NONE = 0
VIR_ERR_WARNING = 1 : A simple warning
VIR_ERR_ERROR = 2 : An error
}
 

virErrorNumber

enum virErrorNumber {
-
VIR_ERR_OK = 0
VIR_ERR_INTERNAL_ERROR = 1 : internal error
VIR_ERR_NO_MEMORY = 2 : memory allocation failure
VIR_ERR_NO_SUPPORT = 3 : no support for this function
VIR_ERR_UNKNOWN_HOST = 4 : could not resolve hostname
VIR_ERR_NO_CONNECT = 5 : can't connect to hypervisor
VIR_ERR_INVALID_CONN = 6 : invalid connection object
VIR_ERR_INVALID_DOMAIN = 7 : invalid domain object
VIR_ERR_INVALID_ARG = 8 : invalid function argument
VIR_ERR_OPERATION_FAILED = 9 : a command to hypervisor failed
VIR_ERR_GET_FAILED = 10 : a HTTP GET command to failed
VIR_ERR_POST_FAILED = 11 : a HTTP POST command to failed
VIR_ERR_HTTP_ERROR = 12 : unexpected HTTP error code
VIR_ERR_SEXPR_SERIAL = 13 : failure to serialize an S-Expr
VIR_ERR_NO_XEN = 14 : could not open Xen hypervisor control
VIR_ERR_XEN_CALL = 15 : failure doing an hypervisor call
VIR_ERR_OS_TYPE = 16 : unknown OS type
VIR_ERR_NO_KERNEL = 17 : missing kernel information
VIR_ERR_NO_ROOT = 18 : missing root device information
VIR_ERR_NO_SOURCE = 19 : missing source device information
VIR_ERR_NO_TARGET = 20 : missing target device information
VIR_ERR_NO_NAME = 21 : missing domain name information
VIR_ERR_NO_OS = 22 : missing domain OS information
VIR_ERR_NO_DEVICE = 23 : missing domain devices information
VIR_ERR_NO_XENSTORE = 24 : could not open Xen Store control
VIR_ERR_DRIVER_FULL = 25 : too many drivers registered
VIR_ERR_CALL_FAILED = 26 : not supported by the drivers (DEPRECATED)
VIR_ERR_XML_ERROR = 27 : an XML description is not well formed or broken
VIR_ERR_DOM_EXIST = 28 : the domain already exist
VIR_ERR_OPERATION_DENIED = 29 : operation forbidden on read-only connections
VIR_ERR_OPEN_FAILED = 30 : failed to open a conf file
VIR_ERR_READ_FAILED = 31 : failed to read a conf file
VIR_ERR_PARSE_FAILED = 32 : failed to parse a conf file
VIR_ERR_CONF_SYNTAX = 33 : failed to parse the syntax of a conf file
VIR_ERR_WRITE_FAILED = 34 : failed to write a conf file
VIR_ERR_XML_DETAIL = 35 : detail of an XML error
VIR_ERR_INVALID_NETWORK = 36 : invalid network object
VIR_ERR_NETWORK_EXIST = 37 : the network already exist
VIR_ERR_SYSTEM_ERROR = 38 : general system call failure
VIR_ERR_RPC = 39 : some sort of RPC error
VIR_ERR_GNUTLS_ERROR = 40 : error from a GNUTLS call
VIR_WAR_NO_NETWORK = 41 : failed to start network
VIR_ERR_NO_DOMAIN = 42 : domain not found or unexpectedly disappeared
VIR_ERR_NO_NETWORK = 43 : network not found
VIR_ERR_INVALID_MAC = 44 : invalid MAC address
VIR_ERR_AUTH_FAILED = 45 : authentication failed
VIR_ERR_INVALID_STORAGE_POOL = 46 : invalid storage pool object
VIR_ERR_INVALID_STORAGE_VOL = 47 : invalid storage vol object
VIR_WAR_NO_STORAGE = 48 : failed to start storage
VIR_ERR_NO_STORAGE_POOL = 49 : storage pool not found
VIR_ERR_NO_STORAGE_VOL = 50 : storage pool not found
}
+
VIR_ERR_OK = 0
VIR_ERR_INTERNAL_ERROR = 1 : internal error
VIR_ERR_NO_MEMORY = 2 : memory allocation failure
VIR_ERR_NO_SUPPORT = 3 : no support for this function
VIR_ERR_UNKNOWN_HOST = 4 : could not resolve hostname
VIR_ERR_NO_CONNECT = 5 : can't connect to hypervisor
VIR_ERR_INVALID_CONN = 6 : invalid connection object
VIR_ERR_INVALID_DOMAIN = 7 : invalid domain object
VIR_ERR_INVALID_ARG = 8 : invalid function argument
VIR_ERR_OPERATION_FAILED = 9 : a command to hypervisor failed
VIR_ERR_GET_FAILED = 10 : a HTTP GET command to failed
VIR_ERR_POST_FAILED = 11 : a HTTP POST command to failed
VIR_ERR_HTTP_ERROR = 12 : unexpected HTTP error code
VIR_ERR_SEXPR_SERIAL = 13 : failure to serialize an S-Expr
VIR_ERR_NO_XEN = 14 : could not open Xen hypervisor control
VIR_ERR_XEN_CALL = 15 : failure doing an hypervisor call
VIR_ERR_OS_TYPE = 16 : unknown OS type
VIR_ERR_NO_KERNEL = 17 : missing kernel information
VIR_ERR_NO_ROOT = 18 : missing root device information
VIR_ERR_NO_SOURCE = 19 : missing source device information
VIR_ERR_NO_TARGET = 20 : missing target device information
VIR_ERR_NO_NAME = 21 : missing domain name information
VIR_ERR_NO_OS = 22 : missing domain OS information
VIR_ERR_NO_DEVICE = 23 : missing domain devices information
VIR_ERR_NO_XENSTORE = 24 : could not open Xen Store control
VIR_ERR_DRIVER_FULL = 25 : too many drivers registered
VIR_ERR_CALL_FAILED = 26 : not supported by the drivers (DEPRECATED)
VIR_ERR_XML_ERROR = 27 : an XML description is not well formed or broken
VIR_ERR_DOM_EXIST = 28 : the domain already exist
VIR_ERR_OPERATION_DENIED = 29 : operation forbidden on read-only connections
VIR_ERR_OPEN_FAILED = 30 : failed to open a conf file
VIR_ERR_READ_FAILED = 31 : failed to read a conf file
VIR_ERR_PARSE_FAILED = 32 : failed to parse a conf file
VIR_ERR_CONF_SYNTAX = 33 : failed to parse the syntax of a conf file
VIR_ERR_WRITE_FAILED = 34 : failed to write a conf file
VIR_ERR_XML_DETAIL = 35 : detail of an XML error
VIR_ERR_INVALID_NETWORK = 36 : invalid network object
VIR_ERR_NETWORK_EXIST = 37 : the network already exist
VIR_ERR_SYSTEM_ERROR = 38 : general system call failure
VIR_ERR_RPC = 39 : some sort of RPC error
VIR_ERR_GNUTLS_ERROR = 40 : error from a GNUTLS call
VIR_WAR_NO_NETWORK = 41 : failed to start network
VIR_ERR_NO_DOMAIN = 42 : domain not found or unexpectedly disappeared
VIR_ERR_NO_NETWORK = 43 : network not found
VIR_ERR_INVALID_MAC = 44 : invalid MAC address
VIR_ERR_AUTH_FAILED = 45 : authentication failed
VIR_ERR_INVALID_STORAGE_POOL = 46 : invalid storage pool object
VIR_ERR_INVALID_STORAGE_VOL = 47 : invalid storage vol object
VIR_WAR_NO_STORAGE = 48 : failed to start storage
VIR_ERR_NO_STORAGE_POOL = 49 : storage pool not found
VIR_ERR_NO_STORAGE_VOL = 50 : storage pool not found
VIR_WAR_NO_NODE = 51 : failed to start node driver
VIR_ERR_INVALID_NODE_DEVICE = 52 : invalid node device object
VIR_ERR_NO_NODE_DEVICE = 53 : node device not found
}
 

Functions

virConnCopyLastError

int	virConnCopyLastError		(virConnectPtr conn, 
virErrorPtr to)

Copy the content of the last error caught on that connection One will need to free the result with virResetError()

conn:pointer to the hypervisor connection
to:target to receive the copy
Returns:0 if no error was found and the error code otherwise and -1 in case of parameter error.

virConnGetLastError

virErrorPtr	virConnGetLastError	(virConnectPtr conn)

Provide a pointer to the last error caught on that connection Simpler but may not be suitable for multithreaded accesses, in which case use virConnCopyLastError()

conn:pointer to the hypervisor connection
Returns:a pointer to the last error or NULL if none occurred.

virConnResetLastError

void	virConnResetLastError		(virConnectPtr conn)
diff --git a/docs/libvirt-api.xml b/docs/libvirt-api.xml index 3f10d28b48..186f805acf 100644 --- a/docs/libvirt-api.xml +++ b/docs/libvirt-api.xml @@ -107,14 +107,16 @@ + + - + @@ -159,6 +161,7 @@ + @@ -181,16 +184,19 @@ + + + @@ -206,7 +212,9 @@ + + @@ -239,9 +247,10 @@ - + + @@ -266,9 +275,11 @@ + + @@ -278,6 +289,7 @@ + @@ -303,10 +315,13 @@ + + + @@ -337,8 +352,10 @@ + + @@ -500,6 +517,7 @@ + @@ -511,11 +529,12 @@ + - + @@ -543,10 +562,11 @@ - + + @@ -557,6 +577,7 @@ + @@ -581,6 +602,7 @@ + @@ -679,6 +701,10 @@ see note above'/> a virNetworkPtr is pointer to a virNetwork private structure, this is the type used to reference a virtual network in the API. + + + 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. + @@ -791,6 +817,7 @@ see note above'/> + Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only) @@ -1220,23 +1247,26 @@ see note above'/> - Part of the EventImpl, this callback Adds a file handle callback to listen for specific events - + Part of the EventImpl, this callback Adds a file handle callback to listen for specific events. The same file handle can be registered multiple times provided the requested event sets are non-overlapping If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose. + - + + - Part of the EventImpl, this user-defined callback handles adding an event timeout. + Part of the EventImpl, this user-defined callback handles adding an event timeout. If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose. + - callback for receiving file handle events + Callback for receiving file handle events. The callback will be invoked once for each event which is pending. + @@ -1252,12 +1282,12 @@ see note above'/> - Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on + Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on. If a virEventHandleFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data. - + - Part of the EventImpl, this user-defined callback removes a timer + Part of the EventImpl, this user-defined callback removes a timer If a virEventTimeoutFreeFunc was supplied when the handle was registered, it will be invoked some time during, or after this function call, when it is safe to release the user data. @@ -1270,7 +1300,7 @@ see note above'/> Part of the EventImpl, this user-provided callback is notified when events to listen on change - + @@ -1279,6 +1309,11 @@ see note above'/> + + + + + Provide a pointer to the last error caught at the library level Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError() @@ -1389,6 +1424,45 @@ see note above'/> + + Drops a reference to the node device, freeing it if this was the last reference. + + + + + + + + + + + + + + + Fetch an XML document describing all aspects of the device. + + + + + + Lists the names of the capabilities supported by the device. + + + + + + + Lookup a node device by its name. + + + + + + + + + This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller. @@ -1408,6 +1482,22 @@ see note above'/> + + Collect the list of node devices, and store their names in @names If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability + + + + + + + + + Provides the number of node devices. If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability + + + + + Reset the error being pointed to diff --git a/docs/libvirt-refs.xml b/docs/libvirt-refs.xml index 48b917055c..4868870cc9 100644 --- a/docs/libvirt-refs.xml +++ b/docs/libvirt-refs.xml @@ -69,6 +69,7 @@ + @@ -80,6 +81,7 @@ + @@ -116,6 +118,7 @@ + @@ -126,6 +129,7 @@ + @@ -156,6 +160,7 @@ + @@ -291,6 +296,7 @@ + @@ -313,11 +319,22 @@ + + + + + + + + + + + @@ -448,6 +465,7 @@ + @@ -459,6 +477,7 @@ + @@ -495,6 +514,7 @@ + @@ -505,6 +525,7 @@ + @@ -535,6 +556,7 @@ + @@ -674,6 +696,7 @@ + @@ -696,11 +719,22 @@ + + + + + + + + + + + @@ -800,6 +834,9 @@ + + + @@ -822,6 +859,8 @@ + + @@ -860,6 +899,9 @@ + + + @@ -939,9 +981,12 @@ + + + @@ -1034,6 +1079,11 @@ + + + + + @@ -1048,6 +1098,14 @@ + + + + + + + + @@ -1108,6 +1166,7 @@ + @@ -1315,6 +1374,7 @@ + @@ -1336,11 +1396,22 @@ + + + + + + + + + + + @@ -1412,6 +1483,7 @@ + @@ -1423,6 +1495,7 @@ + @@ -1455,6 +1528,7 @@ + @@ -1465,12 +1539,14 @@ + + @@ -1575,6 +1651,7 @@ + @@ -1582,6 +1659,7 @@ + @@ -1656,6 +1734,9 @@ + + + @@ -1687,6 +1768,7 @@ + @@ -1792,10 +1874,16 @@ + + + + + + @@ -1866,6 +1954,8 @@ + + @@ -1902,12 +1992,11 @@ + - - @@ -2137,6 +2226,7 @@ + @@ -2224,6 +2314,8 @@ + + @@ -2237,6 +2329,7 @@ + @@ -2332,32 +2425,19 @@ + - - - - - - - - - - - - - - - - - - + + + + @@ -2509,6 +2589,10 @@ + + + + @@ -2578,6 +2662,8 @@ + + @@ -2647,6 +2733,8 @@ + + @@ -2662,9 +2750,20 @@ + + + + + + + + + + + @@ -2726,6 +2825,8 @@ + + @@ -2829,6 +2930,10 @@ + + + + @@ -2891,6 +2996,8 @@ + + @@ -2944,6 +3051,7 @@ + @@ -2990,14 +3098,10 @@ - - - - - - + + @@ -3037,6 +3141,7 @@ + @@ -3095,6 +3200,8 @@ + + @@ -3107,6 +3214,7 @@ + @@ -3151,6 +3259,7 @@ + @@ -3297,6 +3406,9 @@ + + + @@ -3337,6 +3449,8 @@ + + @@ -3353,6 +3467,8 @@ + + @@ -3373,6 +3489,9 @@ + + + @@ -3420,6 +3539,7 @@ + @@ -3482,7 +3602,10 @@ + + + @@ -3512,6 +3635,7 @@ + @@ -3656,6 +3780,10 @@ + + + + @@ -3700,6 +3828,13 @@ + + + + + + + @@ -3718,6 +3853,7 @@ + @@ -3733,6 +3869,8 @@ + + @@ -3768,8 +3906,6 @@ - - @@ -3790,6 +3926,7 @@ + @@ -3888,11 +4025,14 @@ + + + @@ -4113,6 +4253,7 @@ + @@ -4142,30 +4283,14 @@ - - - - - - - - - - - - - - - - - - + + @@ -4222,14 +4347,24 @@ + + + + + + + + + + @@ -4278,6 +4413,9 @@ + + + @@ -4287,6 +4425,9 @@ + + + @@ -4313,6 +4454,8 @@ + + @@ -4328,6 +4471,8 @@ + + @@ -4363,6 +4508,7 @@ + @@ -4394,6 +4540,9 @@ + + + @@ -4415,6 +4564,9 @@ + + + @@ -4438,6 +4590,9 @@ + + + @@ -4538,6 +4693,7 @@ + @@ -4556,6 +4712,8 @@ + + @@ -4621,6 +4779,7 @@ + @@ -4635,7 +4794,10 @@ + + + @@ -4648,6 +4810,8 @@ + + @@ -4691,6 +4855,7 @@ + @@ -4716,6 +4881,8 @@ + + @@ -4752,6 +4919,8 @@ + + @@ -4834,6 +5003,10 @@ + + + + @@ -4841,6 +5014,7 @@ + @@ -4887,6 +5061,9 @@ + + + @@ -4942,6 +5119,8 @@ + + @@ -4970,6 +5149,8 @@ + + @@ -5056,6 +5237,7 @@ + @@ -5125,6 +5307,12 @@ + + + + + + @@ -5138,6 +5326,8 @@ + + @@ -5214,6 +5404,7 @@ + @@ -5229,9 +5420,13 @@ + + + + @@ -5259,6 +5454,8 @@ + + @@ -5271,6 +5468,9 @@ + + + @@ -5329,6 +5529,7 @@ + @@ -5343,6 +5544,13 @@ + + + + + + + @@ -5355,6 +5563,9 @@ + + + @@ -5362,6 +5573,9 @@ + + + @@ -5422,6 +5636,7 @@ + @@ -5436,6 +5651,8 @@ + + @@ -5598,9 +5815,15 @@ + + + + + + @@ -5610,6 +5833,9 @@ + + + @@ -5695,9 +5921,18 @@ + + + + + + + + + @@ -5708,8 +5943,10 @@ + + @@ -5730,33 +5967,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5811,8 +6021,6 @@ - - @@ -5841,6 +6049,8 @@ + + @@ -5850,17 +6060,17 @@ - - + + - - + + - - + +