This provides the 2 public APIs needed for conversion of domain XML
to/from native configuration formats. It also hooks up the internal
driver infrastructure, and binds to virsh
docs/devhelp/libvirt-libvirt.html | 10
docs/html/libvirt-libvirt.html | 8
docs/html/libvirt-virterror.html | 522 +++++++++++++++++++++++++++++++++++++-
docs/libvirt-api.xml | 22 +
docs/libvirt-refs.xml | 77 +++++
include/libvirt/libvirt.h | 10
include/libvirt/libvirt.h.in | 10
src/driver.h | 12
src/libvirt.c | 105 +++++++
src/libvirt_public.syms | 12
src/lxc_driver.c | 2
src/openvz_driver.c | 2
src/qemu_driver.c | 2
src/remote_internal.c | 2
src/test.c | 2
src/uml_driver.c | 2
src/virsh.c | 94 ++++++
src/xen_unified.c | 2
18 files changed, 886 insertions(+), 10 deletions(-)
Daniel
diff -r 803e91762b86 docs/devhelp/libvirt-libvirt.html
--- a/docs/devhelp/libvirt-libvirt.html Wed May 13 09:34:19 2009 -0400
+++ b/docs/devhelp/libvirt-libvirt.html Wed May 13 09:34:22 2009 -0400
@@ -122,6 +122,7 @@ int <a href="#virInitialize">virInitiali
int <a href="#virInitialize">virInitialize</a> (void);
const char * <a
href="#virNodeDeviceGetName">virNodeDeviceGetName</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev);
int <a
href="#virStoragePoolSetAutostart">virStoragePoolSetAutostart</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br/> int autostart);
+char * <a
href="#virConnectDomainXMLFromNative">virConnectDomainXMLFromNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> const char * nativeFormat, <br/> const char * nativeConfig,
<br/> unsigned int flags);
int <a
href="#virNodeDeviceDettach">virNodeDeviceDettach</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev);
int <a
href="#virDomainGetSecurityLabel">virDomainGetSecurityLabel</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br/> <a
href="libvirt-libvirt.html#virSecurityLabelPtr">virSecurityLabelPtr</a>
seclabel);
int <a
href="#virConnectDomainEventDeregister">virConnectDomainEventDeregister</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb);
@@ -162,6 +163,7 @@ int <a href="#virNetworkGetAutostart">vi
int <a
href="#virNetworkGetAutostart">virNetworkGetAutostart</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br/> int * autostart);
char * <a
href="#virNetworkGetBridgeName">virNetworkGetBridgeName</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
char * <a
href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br/> unsigned int flags);
+char * <a
href="#virConnectDomainXMLToNative">virConnectDomainXMLToNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> const char * nativeFormat, <br/> const char * domainXml,
<br/> unsigned int flags);
int <a
href="#virDomainSetSchedulerParameters">virDomainSetSchedulerParameters</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br/> <a
href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a>
params, <br/> int nparams);
const char * <a
href="#virConnectGetType">virConnectGetType</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolCreateXML">virStorageVolCreateXML</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br/> const char * xmldesc, <br/> unsigned int flags);
@@ -795,6 +797,14 @@ The content of this structure is not mad
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will
enable delivery of the events The <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle
passed into the callback upon delivery of an event is only valid for the duration of
execution of the callback. If the callback wishes to keep the domain object after the
callback</p>
<div class="variablelist"><table border="0"><col
align="left"/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
data to pass on to the callback</td></tr><tr><td><span
class="term"><i><tt>freecb</tt></i>:</span></td><td>optional
function to deallocate opaque when not used
anymore</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>it
shall take a reference to it, by calling virDomainRef. The reference can be released once
the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on
failure</td></tr></tbody></table></div></div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a
name="virConnectDomainXMLFromNative"/>virConnectDomainXMLFromNative
()</h3><pre class="programlisting">char
* virConnectDomainXMLFromNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> const char * nativeFormat, <br/> const char * nativeConfig,
<br/> unsigned int flags)<br/>
+</pre><p>Reads native configuration data describing a domain, and generates
libvirt domain XML. The format of the native data is hypervisor dependant.</p>
+<div class="variablelist"><table border="0"><col
align="left"/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format importing from</td></tr><tr><td><span
class="term"><i><tt>nativeConfig</tt></i>:</span></td><td>the
configuration data to import</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free()
the returned
value.</td></tr></tbody></table></div></div>
+ <hr/>
+ <div class="refsect2" lang="en"><h3><a
name="virConnectDomainXMLToNative"/>virConnectDomainXMLToNative
()</h3><pre class="programlisting">char
* virConnectDomainXMLToNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> const char * nativeFormat, <br/> const char * domainXml,
<br/> unsigned int flags)<br/>
+</pre><p>Reads a domain XML configuration document, and generates generates a
native configuration file describing the domain. The format of the native data is
hypervisor dependant.</p>
+<div class="variablelist"><table border="0"><col
align="left"/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format exporting to</td></tr><tr><td><span
class="term"><i><tt>domainXml</tt></i>:</span></td><td>the
domain configuration to export</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller
must free() the returned
value.</td></tr></tbody></table></div></div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a
name="virConnectFindStoragePoolSources"/>virConnectFindStoragePoolSources
()</h3><pre class="programlisting">char
* virConnectFindStoragePoolSources (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br/> const char * type, <br/> const char * srcSpec,
<br/> unsigned int flags)<br/>
</pre><p>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)</p>
<div class="variablelist"><table border="0"><col
align="left"/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>type</tt></i>:</span></td><td>type
of storage pool sources to discover</td></tr><tr><td><span
class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML
document specifying discovery source</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for discovery (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>an
xml document consisting of a SourceList element containing a source document appropriate
to the given pool type for each discovered
source.</td></tr></tbody></table></div></div>
diff -r 803e91762b86 docs/html/libvirt-libvirt.html
--- a/docs/html/libvirt-libvirt.html Wed May 13 09:34:19 2009 -0400
+++ b/docs/html/libvirt-libvirt.html Wed May 13 09:41:37 2009 -0400
@@ -84,6 +84,8 @@ int <a href="#virConnectDomainEventCallb
int <a
href="#virConnectDomainEventDeregister">virConnectDomainEventDeregister</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb)
int <a
href="#virConnectDomainEventRegister">virConnectDomainEventRegister</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a>
freecb)
+char * <a
href="#virConnectDomainXMLFromNative">virConnectDomainXMLFromNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * nativeConfig,
<br /> unsigned int flags)
+char * <a
href="#virConnectDomainXMLToNative">virConnectDomainXMLToNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * domainXml,
<br /> unsigned int flags)
char * <a
href="#virConnectFindStoragePoolSources">virConnectFindStoragePoolSources</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type, <br /> const char * srcSpec, <br
/> unsigned int flags)
char * <a
href="#virConnectGetCapabilities">virConnectGetCapabilities</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
char * <a
href="#virConnectGetHostname">virConnectGetHostname</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
@@ -362,7 +364,9 @@ int <a href="#virStorageVolRef">virStora
</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of
error.</td></tr></tbody></table></div><h3><a
name="virConnectDomainEventCallback"
id="virConnectDomainEventCallback"><code>virConnectDomainEventCallback</code></a></h3><pre
class="programlisting">typedef int (*virConnectDomainEventCallback) (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> int event, <br /> int detail, <br /> void * opaque)
</pre><p>A callback function to be registered, and called when a domain event
occurs</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td><a
href="libvirt-libvirt.html#virConnect">virConnect</a>
connection</td></tr><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>The
domain on which the event occured</td></tr><tr><td><span
class="term"><i><tt>event</tt></i>:</span></td><td>The
specfic <a
href="libvirt-libvirt.html#virDomainEventType">virDomainEventType</a>
which occured</td></tr><tr><td><span
class="term"><i><tt>detail</tt></i>:</span></td><td>event
specific detail information</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
user data</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br
/><h3><a name="virConnectDomainEventDeregister"
id="virConnectDomainEventDeregister"><code>virConnectDomainEventDeregister</code></a></h3><pre
class="programlisting">int virConnectDomainEventDeregister (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb)<br />
</pre><p>Removes a Domain Event Callback. De-registering for a domain
callback will disable delivery of this event type</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virConnectDomainEventRegister"
id="virConnectDomainEventRegister"><code>virConnectDomainEventRegister</code></a></h3><pre
class="programlisting">int virConnectDomainEventRegister (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a>
freecb)<br />
-</pre><p>Adds a Domain Event Callback. Registering for a domain callback will
enable delivery of the events The <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle
passed into the callback upon delivery of an event is only valid for the duration of
execution of the callback. If the callback wishes to keep the domain object after the
callback</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
data to pass on to the callback</td></tr><tr><td><span
class="term"><i><tt>freecb</tt></i>:</span></td><td>optional
function to deallocate opaque when not used
anymore</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>it
shall take a reference to it, by calling virDomainRef. The reference can be released once
the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virConnectFindStoragePoolSources"
id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre
class="programlisting">char * virConnectFindStoragePoolSources (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type, <br /> const char * srcSpec, <br
/> unsigned int flags)<br />
+</pre><p>Adds a Domain Event Callback. Registering for a domain callback will
enable delivery of the events The <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle
passed into the callback upon delivery of an event is only valid for the duration of
execution of the callback. If the callback wishes to keep the domain object after the
callback</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
data to pass on to the callback</td></tr><tr><td><span
class="term"><i><tt>freecb</tt></i>:</span></td><td>optional
function to deallocate opaque when not used
anymore</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>it
shall take a reference to it, by calling virDomainRef. The reference can be released once
the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virConnectDomainXMLFromNative"
id="virConnectDomainXMLFromNative"><code>virConnectDomainXMLFromNative</code></a></h3><pre
class="programlisting">char * virConnectDomainXMLFromNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * nativeConfig,
<br /> unsigned int flags)<br />
+</pre><p>Reads native configuration data describing a domain, and generates
libvirt domain XML. The format of the native data is hypervisor
dependant.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format importing from</td></tr><tr><td><span
class="term"><i><tt>nativeConfig</tt></i>:</span></td><td>the
configuration data to import</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free()
the returned
value.</td></tr></tbody></table></div><h3><a
name="virConnectDomainXMLToNative"
id="virConnectDomainXMLToNative"><code>virConnectDomainXMLToNative</code></a></h3><pre
class="programlisting">char * virConnectDomainXMLToNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * domainXml,
<br /> unsigned int flags)<br />
+</pre><p>Reads a domain XML configuration document, and generates generates a
native configuration file describing the domain. The format of the native data is
hypervisor dependant.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format exporting to</td></tr><tr><td><span
class="term"><i><tt>domainXml</tt></i>:</span></td><td>the
domain configuration to export</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller
must free() the returned
value.</td></tr></tbody></table></div><h3><a
name="virConnectFindStoragePoolSources"
id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre
class="programlisting">char * virConnectFindStoragePoolSources (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type, <br /> const char * srcSpec, <br
/> unsigned int flags)<br />
</pre><p>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)</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>type</tt></i>:</span></td><td>type
of storage pool sources to discover</td></tr><tr><td><span
class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML
document specifying discovery source</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for discovery (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>an
xml document consisting of a SourceList element containing a source document appropriate
to the given pool type for each discovered
source.</td></tr></tbody></table></div><h3><a
name="virConnectGetCapabilities"
id="virConnectGetCapabilities"><code>virConnectGetCapabilities</code></a></h3><pre
class="programlisting">char * virConnectGetCapabilities (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
</pre><p>Provides capabilities of the hypervisor / driver.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error, or an XML string defining the capabilities. The client must free the
returned string after
use.</td></tr></tbody></table></div><h3><a
name="virConnectGetHostname"
id="virConnectGetHostname"><code>virConnectGetHostname</code></a></h3><pre
class="programlisting">char * virConnectGetHostname (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to a hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
hostname which must be freed by the caller, or NULL if there was an
error.</td></tr></tbody></table></div><h3><a
name="virConnectGetMaxVcpus"
id="virConnectGetMaxVcpus"><code>virConnectGetMaxVcpus</code></a></h3><pre
class="programlisting">int virConnectGetMaxVcpus (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type)<br />
@@ -519,5 +523,5 @@ int <a href="#virStorageVolRef">virStora
</pre><p>Fetch a pointer to a storage volume based on its globally unique
key</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>key</tt></i>:</span></td><td>globally
unique key</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolLookupByName"
id="virStorageVolLookupByName"><code>virStorageVolLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByName (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * name)<br />
</pre><p>Fetch a pointer to a storage volume based on its name within a
pool</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>name
of storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolLookupByPath"
id="virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByPath (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * path)<br />
</pre><p>Fetch a pointer to a storage volume based on its locally (host)
unique path</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>path</tt></i>:</span></td><td>locally
unique path</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolRef"
id="virStorageVolRef"><code>virStorageVolRef</code></a></h3><pre
class="programlisting">int virStorageVolRef (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
-</pre><p>Increment the reference count on the vol. For each additional call
to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a vol would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>the
vol to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div></div></div><div
id="footer"><p id="sponsor">
+</pre><p>Increment the reference count on the vol. For each additional call
to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a vol would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>the
vol to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h1>Reference
Manual for libvirt</h1><h2>Table of
Contents</h2><ul><li><a
href="libvirt-libvirt.html">libvirt</a>: core interfaces for the
libvirt library</li><li><a
href="libvirt-virterror.html">virterror</a>: error handling interfaces
for the libvirt library</li></ul></div></div><div
id="footer"><p id="sponsor">
Sponsored by:<br /><a
href="http://et.redhat.com/"><img
src="../et.png" alt="Project sponsored by Red Hat Emerging Technology"
/></a></p></div></body></html>
diff -r 803e91762b86 docs/html/libvirt-virterror.html
--- a/docs/html/libvirt-virterror.html Wed May 13 09:34:19 2009 -0400
+++ b/docs/html/libvirt-virterror.html Wed May 13 09:41:37 2009 -0400
@@ -45,5 +45,525 @@ void <a href="#virSetErrorFunc">virSetEr
</pre><p>Reset the error being pointed to</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>err</tt></i>:</span></td><td>pointer
to the <a href="libvirt-virterror.html#virError">virError</a> to
clean up</td></tr></tbody></table></div><h3><a
name="virResetLastError"
id="virResetLastError"><code>virResetLastError</code></a></h3><pre
class="programlisting">void virResetLastError (void)<br />
</pre><p>Reset the last error caught at the library level. The error object
is kept in thread local storage, so separate threads can safely access this concurrently,
only resetting their own error object.</p><h3><a
name="virSaveLastError"
id="virSaveLastError"><code>virSaveLastError</code></a></h3><pre
class="programlisting"><a
href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virSaveLastError (void)<br
/>
</pre><p>Save the last error into a new error object.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the copied error or NULL if allocation failed. It is the caller's
responsibility to free the error with
virFreeError().</td></tr></tbody></table></div><h3><a
name="virSetErrorFunc"
id="virSetErrorFunc"><code>virSetErrorFunc</code></a></h3><pre
class="programlisting">void virSetErrorFunc (void * userData, <br
/> <a
href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a>
handler)<br />
-</pre><p>Set a library global error handling function, if @handler is NULL,
it will reset to default printing on stderr. The error raised there are those for which no
handler at the connection level could caught.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>userData</tt></i>:</span></td><td>pointer
to the user data provided in the handler
callback</td></tr><tr><td><span
class="term"><i><tt>handler</tt></i>:</span></td><td>the
function to get called in case of error or
NULL</td></tr></tbody></table></div></div></div><div
id="footer"><p id="sponsor">
+</pre><p>Set a library global error handling function, if @handler is NULL,
it will reset to default printing on stderr. The error raised there are those for which no
handler at the connection level could caught.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>userData</tt></i>:</span></td><td>pointer
to the user data provided in the handler
callback</td></tr><tr><td><span
class="term"><i><tt>handler</tt></i>:</span></td><td>the
function to get called in case of error or
NULL</td></tr></tbody></table></div><h1>Module libvirt
from libvirt</h1><p>Provides the interfaces of the libvirt library to handle
virtualized domains </p><h2>Table of Contents</h2><h3><a
href="#macros">Macros</a></h3><pre>#define <a
href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a>
+#define <a href="#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a>
+#define <a href="#VIR_CPU_MAPLEN">VIR_CPU_MAPLEN</a>
+#define <a href="#VIR_CPU_USABLE">VIR_CPU_USABLE</a>
+#define <a
href="#VIR_DOMAIN_SCHED_FIELD_LENGTH">VIR_DOMAIN_SCHED_FIELD_LENGTH</a>
+#define <a href="#VIR_GET_CPUMAP">VIR_GET_CPUMAP</a>
+#define <a href="#VIR_NODEINFO_MAXCPUS">VIR_NODEINFO_MAXCPUS</a>
+#define <a
href="#VIR_SECURITY_DOI_BUFLEN">VIR_SECURITY_DOI_BUFLEN</a>
+#define <a
href="#VIR_SECURITY_LABEL_BUFLEN">VIR_SECURITY_LABEL_BUFLEN</a>
+#define <a
href="#VIR_SECURITY_MODEL_BUFLEN">VIR_SECURITY_MODEL_BUFLEN</a>
+#define <a href="#VIR_UNUSE_CPU">VIR_UNUSE_CPU</a>
+#define <a href="#VIR_USE_CPU">VIR_USE_CPU</a>
+#define <a href="#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a>
+#define <a
href="#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a>
+</pre><h3><a
href="#types">Types</a></h3><pre>typedef struct _virConnect
<a href="#virConnect">virConnect</a>
+typedef struct _virConnectAuth <a
href="#virConnectAuth">virConnectAuth</a>
+typedef <a
href="libvirt-libvirt.html#virConnectAuth">virConnectAuth</a> * <a
name="virConnectAuthPtr"
id="virConnectAuthPtr">virConnectAuthPtr</a>
+typedef struct _virConnectCredential <a
href="#virConnectCredential">virConnectCredential</a>
+typedef <a
href="libvirt-libvirt.html#virConnectCredential">virConnectCredential</a>
* <a name="virConnectCredentialPtr"
id="virConnectCredentialPtr">virConnectCredentialPtr</a>
+typedef enum <a
href="#virConnectCredentialType">virConnectCredentialType</a>
+typedef enum <a href="#virConnectFlags">virConnectFlags</a>
+typedef <a href="libvirt-libvirt.html#virConnect">virConnect</a> *
<a name="virConnectPtr"
id="virConnectPtr">virConnectPtr</a>
+typedef struct _virDomain <a href="#virDomain">virDomain</a>
+typedef <a
href="libvirt-libvirt.html#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a>
* <a name="virDomainBlockStatsPtr"
id="virDomainBlockStatsPtr">virDomainBlockStatsPtr</a>
+typedef struct _virDomainBlockStats <a
href="#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a>
+typedef enum <a
href="#virDomainCreateFlags">virDomainCreateFlags</a>
+typedef enum <a
href="#virDomainEventDefinedDetailType">virDomainEventDefinedDetailType</a>
+typedef enum <a
href="#virDomainEventResumedDetailType">virDomainEventResumedDetailType</a>
+typedef enum <a
href="#virDomainEventStartedDetailType">virDomainEventStartedDetailType</a>
+typedef enum <a
href="#virDomainEventStoppedDetailType">virDomainEventStoppedDetailType</a>
+typedef enum <a
href="#virDomainEventSuspendedDetailType">virDomainEventSuspendedDetailType</a>
+typedef enum <a href="#virDomainEventType">virDomainEventType</a>
+typedef enum <a
href="#virDomainEventUndefinedDetailType">virDomainEventUndefinedDetailType</a>
+typedef struct _virDomainInfo <a
href="#virDomainInfo">virDomainInfo</a>
+typedef <a
href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a> * <a
name="virDomainInfoPtr"
id="virDomainInfoPtr">virDomainInfoPtr</a>
+typedef <a
href="libvirt-libvirt.html#virDomainInterfaceStatsStruct">virDomainInterfaceStatsStruct</a>
* <a name="virDomainInterfaceStatsPtr"
id="virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a>
+typedef struct _virDomainInterfaceStats <a
href="#virDomainInterfaceStatsStruct">virDomainInterfaceStatsStruct</a>
+typedef enum <a
href="#virDomainMemoryFlags">virDomainMemoryFlags</a>
+typedef enum <a
href="#virDomainMigrateFlags">virDomainMigrateFlags</a>
+typedef <a href="libvirt-libvirt.html#virDomain">virDomain</a> *
<a name="virDomainPtr" id="virDomainPtr">virDomainPtr</a>
+typedef enum <a href="#virDomainState">virDomainState</a>
+typedef enum <a href="#virDomainXMLFlags">virDomainXMLFlags</a>
+typedef enum <a href="#virEventHandleType">virEventHandleType</a>
+typedef struct _virNetwork <a href="#virNetwork">virNetwork</a>
+typedef <a href="libvirt-libvirt.html#virNetwork">virNetwork</a> *
<a name="virNetworkPtr"
id="virNetworkPtr">virNetworkPtr</a>
+typedef struct _virNodeDevice <a
href="#virNodeDevice">virNodeDevice</a>
+typedef <a
href="libvirt-libvirt.html#virNodeDevice">virNodeDevice</a> * <a
name="virNodeDevicePtr"
id="virNodeDevicePtr">virNodeDevicePtr</a>
+typedef struct _virNodeInfo <a href="#virNodeInfo">virNodeInfo</a>
+typedef <a href="libvirt-libvirt.html#virNodeInfo">virNodeInfo</a>
* <a name="virNodeInfoPtr"
id="virNodeInfoPtr">virNodeInfoPtr</a>
+typedef struct _virSchedParameter <a
href="#virSchedParameter">virSchedParameter</a>
+typedef <a
href="libvirt-libvirt.html#virSchedParameter">virSchedParameter</a> *
<a name="virSchedParameterPtr"
id="virSchedParameterPtr">virSchedParameterPtr</a>
+typedef enum <a
href="#virSchedParameterType">virSchedParameterType</a>
+typedef struct _virSecurityLabel <a
href="#virSecurityLabel">virSecurityLabel</a>
+typedef <a
href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a> *
<a name="virSecurityLabelPtr"
id="virSecurityLabelPtr">virSecurityLabelPtr</a>
+typedef struct _virSecurityModel <a
href="#virSecurityModel">virSecurityModel</a>
+typedef <a
href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> *
<a name="virSecurityModelPtr"
id="virSecurityModelPtr">virSecurityModelPtr</a>
+typedef struct _virStoragePool <a
href="#virStoragePool">virStoragePool</a>
+typedef enum <a
href="#virStoragePoolBuildFlags">virStoragePoolBuildFlags</a>
+typedef enum <a
href="#virStoragePoolDeleteFlags">virStoragePoolDeleteFlags</a>
+typedef struct _virStoragePoolInfo <a
href="#virStoragePoolInfo">virStoragePoolInfo</a>
+typedef <a
href="libvirt-libvirt.html#virStoragePoolInfo">virStoragePoolInfo</a> *
<a name="virStoragePoolInfoPtr"
id="virStoragePoolInfoPtr">virStoragePoolInfoPtr</a>
+typedef <a
href="libvirt-libvirt.html#virStoragePool">virStoragePool</a> * <a
name="virStoragePoolPtr"
id="virStoragePoolPtr">virStoragePoolPtr</a>
+typedef enum <a
href="#virStoragePoolState">virStoragePoolState</a>
+typedef struct _virStorageVol <a
href="#virStorageVol">virStorageVol</a>
+typedef enum <a
href="#virStorageVolDeleteFlags">virStorageVolDeleteFlags</a>
+typedef struct _virStorageVolInfo <a
href="#virStorageVolInfo">virStorageVolInfo</a>
+typedef <a
href="libvirt-libvirt.html#virStorageVolInfo">virStorageVolInfo</a> *
<a name="virStorageVolInfoPtr"
id="virStorageVolInfoPtr">virStorageVolInfoPtr</a>
+typedef <a
href="libvirt-libvirt.html#virStorageVol">virStorageVol</a> * <a
name="virStorageVolPtr"
id="virStorageVolPtr">virStorageVolPtr</a>
+typedef enum <a href="#virStorageVolType">virStorageVolType</a>
+typedef struct _virVcpuInfo <a href="#virVcpuInfo">virVcpuInfo</a>
+typedef <a href="libvirt-libvirt.html#virVcpuInfo">virVcpuInfo</a>
* <a name="virVcpuInfoPtr"
id="virVcpuInfoPtr">virVcpuInfoPtr</a>
+typedef enum <a href="#virVcpuState">virVcpuState</a>
+</pre><h3><a
href="#functions">Functions</a></h3><pre>typedef <a
href="#virConnectAuthCallbackPtr">virConnectAuthCallbackPtr</a>
+int <a
href="#virConnectAuthCallbackPtr">virConnectAuthCallbackPtr</a> (<a
href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a>
cred, <br /> unsigned int ncred, <br /> void * cbdata)
+
+int <a href="#virConnectClose">virConnectClose</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+typedef <a
href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
+int <a
href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> int event, <br /> int detail, <br /> void * opaque)
+
+int <a
href="#virConnectDomainEventDeregister">virConnectDomainEventDeregister</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb)
+int <a
href="#virConnectDomainEventRegister">virConnectDomainEventRegister</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a>
freecb)
+char * <a
href="#virConnectDomainXMLFromNative">virConnectDomainXMLFromNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * nativeConfig,
<br /> unsigned int flags)
+char * <a
href="#virConnectDomainXMLToNative">virConnectDomainXMLToNative</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * domainXml,
<br /> unsigned int flags)
+char * <a
href="#virConnectFindStoragePoolSources">virConnectFindStoragePoolSources</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type, <br /> const char * srcSpec, <br
/> unsigned int flags)
+char * <a
href="#virConnectGetCapabilities">virConnectGetCapabilities</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+char * <a
href="#virConnectGetHostname">virConnectGetHostname</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectGetMaxVcpus">virConnectGetMaxVcpus</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type)
+const char * <a
href="#virConnectGetType">virConnectGetType</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+char * <a href="#virConnectGetURI">virConnectGetURI</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectGetVersion">virConnectGetVersion</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> unsigned long * hvVer)
+int <a
href="#virConnectListDefinedDomains">virConnectListDefinedDomains</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)
+int <a
href="#virConnectListDefinedNetworks">virConnectListDefinedNetworks</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)
+int <a
href="#virConnectListDefinedStoragePools">virConnectListDefinedStoragePools</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)
+int <a
href="#virConnectListDomains">virConnectListDomains</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> int * ids, <br /> int maxids)
+int <a
href="#virConnectListNetworks">virConnectListNetworks</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)
+int <a
href="#virConnectListStoragePools">virConnectListStoragePools</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)
+int <a
href="#virConnectNumOfDefinedDomains">virConnectNumOfDefinedDomains</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectNumOfDefinedNetworks">virConnectNumOfDefinedNetworks</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectNumOfDefinedStoragePools">virConnectNumOfDefinedStoragePools</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectNumOfDomains">virConnectNumOfDomains</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectNumOfNetworks">virConnectNumOfNetworks</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virConnectNumOfStoragePools">virConnectNumOfStoragePools</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virConnectOpen">virConnectOpen</a> (const char * name)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virConnectOpenAuth">virConnectOpenAuth</a> (const char * name,
<br /> <a
href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a>
auth, <br /> int flags)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virConnectOpenReadOnly">virConnectOpenReadOnly</a> (const char *
name)
+int <a href="#virConnectRef">virConnectRef</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a
href="#virDomainAttachDevice">virDomainAttachDevice</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * xml)
+int <a href="#virDomainBlockPeek">virDomainBlockPeek</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> unsigned long long offset, <br
/> size_t size, <br /> void * buffer, <br /> unsigned int
flags)
+int <a href="#virDomainBlockStats">virDomainBlockStats</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> <a
href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a>
stats, <br /> size_t size)
+int <a href="#virDomainCoreDump">virDomainCoreDump</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * to, <br /> int flags)
+int <a href="#virDomainCreate">virDomainCreate</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainCreateLinux">virDomainCreateLinux</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainCreateXML">virDomainCreateXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainDefineXML">virDomainDefineXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml)
+int <a href="#virDomainDestroy">virDomainDestroy</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a
href="#virDomainDetachDevice">virDomainDetachDevice</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * xml)
+int <a href="#virDomainFree">virDomainFree</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a
href="#virDomainGetAutostart">virDomainGetAutostart</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int * autostart)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virDomainGetConnect">virDomainGetConnect</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)
+unsigned int <a href="#virDomainGetID">virDomainGetID</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a href="#virDomainGetInfo">virDomainGetInfo</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virDomainInfoPtr">virDomainInfoPtr</a>
info)
+unsigned long <a
href="#virDomainGetMaxMemory">virDomainGetMaxMemory</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a
href="#virDomainGetMaxVcpus">virDomainGetMaxVcpus</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+const char * <a
href="#virDomainGetName">virDomainGetName</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+char * <a href="#virDomainGetOSType">virDomainGetOSType</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a
href="#virDomainGetSchedulerParameters">virDomainGetSchedulerParameters</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a>
params, <br /> int * nparams)
+char * <a
href="#virDomainGetSchedulerType">virDomainGetSchedulerType</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int * nparams)
+int <a
href="#virDomainGetSecurityLabel">virDomainGetSecurityLabel</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSecurityLabelPtr">virSecurityLabelPtr</a>
seclabel)
+int <a href="#virDomainGetUUID">virDomainGetUUID</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned char * uuid)
+int <a
href="#virDomainGetUUIDString">virDomainGetUUIDString</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> char * buf)
+int <a href="#virDomainGetVcpus">virDomainGetVcpus</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virVcpuInfoPtr">virVcpuInfoPtr</a> info,
<br /> int maxinfo, <br /> unsigned char * cpumaps, <br
/> int maplen)
+char * <a
href="#virDomainGetXMLDesc">virDomainGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int flags)
+int <a
href="#virDomainInterfaceStats">virDomainInterfaceStats</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> <a
href="libvirt-libvirt.html#virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a>
stats, <br /> size_t size)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainLookupByID">virDomainLookupByID</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> int id)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainLookupByName">virDomainLookupByName</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainLookupByUUID">virDomainLookupByUUID</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainLookupByUUIDString">virDomainLookupByUUIDString</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)
+int <a href="#virDomainMemoryPeek">virDomainMemoryPeek</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> unsigned long long start, <br /> size_t size, <br /> void
* buffer, <br /> unsigned int flags)
+<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a
href="#virDomainMigrate">virDomainMigrate</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn,
<br /> unsigned long flags, <br /> const char * dname, <br
/> const char * uri, <br /> unsigned long bandwidth)
+int <a href="#virDomainPinVcpu">virDomainPinVcpu</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int vcpu, <br /> unsigned char * cpumap, <br
/> int maplen)
+int <a href="#virDomainReboot">virDomainReboot</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int flags)
+int <a href="#virDomainRef">virDomainRef</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a href="#virDomainRestore">virDomainRestore</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * from)
+int <a href="#virDomainResume">virDomainResume</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a href="#virDomainSave">virDomainSave</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * to)
+int <a
href="#virDomainSetAutostart">virDomainSetAutostart</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int autostart)
+int <a
href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned long memory)
+int <a href="#virDomainSetMemory">virDomainSetMemory</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned long memory)
+int <a
href="#virDomainSetSchedulerParameters">virDomainSetSchedulerParameters</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a>
params, <br /> int nparams)
+int <a href="#virDomainSetVcpus">virDomainSetVcpus</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int nvcpus)
+int <a href="#virDomainShutdown">virDomainShutdown</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a href="#virDomainSuspend">virDomainSuspend</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+int <a href="#virDomainUndefine">virDomainUndefine</a> (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
+typedef <a href="#virEventAddHandleFunc">virEventAddHandleFunc</a>
+int <a
href="#virEventAddHandleFunc">virEventAddHandleFunc</a> (int fd,
<br /> int event, <br /> <a
href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
+
+typedef <a
href="#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a>
+int <a
href="#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> (int
timeout, <br /> <a
href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
+
+typedef <a
href="#virEventHandleCallback">virEventHandleCallback</a>
+void <a
href="#virEventHandleCallback">virEventHandleCallback</a> (int watch,
<br /> int fd, <br /> int events, <br /> void * opaque)
+
+void <a
href="#virEventRegisterImpl">virEventRegisterImpl</a> (<a
href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a>
addHandle, <br /> <a
href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a>
updateHandle, <br /> <a
href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a>
removeHandle, <br /> <a
href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a>
addTimeout, <br /> <a
href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a>
updateTimeout, <br /> <a
href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a>
removeTimeout)
+typedef <a
href="#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a>
+int <a
href="#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> (int
watch)
+
+typedef <a
href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a>
+int <a
href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> (int
timer)
+
+typedef <a
href="#virEventTimeoutCallback">virEventTimeoutCallback</a>
+void <a
href="#virEventTimeoutCallback">virEventTimeoutCallback</a> (int
timer, <br /> void * opaque)
+
+typedef <a
href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a>
+void <a
href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> (int
watch, <br /> int event)
+
+typedef <a
href="#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a>
+void <a
href="#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> (int
timer, <br /> int timeout)
+
+typedef <a href="#virFreeCallback">virFreeCallback</a>
+void <a href="#virFreeCallback">virFreeCallback</a> (void *
opaque)
+
+int <a href="#virGetVersion">virGetVersion</a> (unsigned long *
libVer, <br /> const char * type, <br /> unsigned long * typeVer)
+int <a href="#virInitialize">virInitialize</a> (void)
+int <a href="#virNetworkCreate">virNetworkCreate</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a
href="#virNetworkCreateXML">virNetworkCreateXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc)
+<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a
href="#virNetworkDefineXML">virNetworkDefineXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml)
+int <a href="#virNetworkDestroy">virNetworkDestroy</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+int <a href="#virNetworkFree">virNetworkFree</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+int <a
href="#virNetworkGetAutostart">virNetworkGetAutostart</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int * autostart)
+char * <a
href="#virNetworkGetBridgeName">virNetworkGetBridgeName</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virNetworkGetConnect">virNetworkGetConnect</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net)
+const char * <a
href="#virNetworkGetName">virNetworkGetName</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+int <a href="#virNetworkGetUUID">virNetworkGetUUID</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> unsigned char * uuid)
+int <a
href="#virNetworkGetUUIDString">virNetworkGetUUIDString</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> char * buf)
+char * <a
href="#virNetworkGetXMLDesc">virNetworkGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int flags)
+<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a
href="#virNetworkLookupByName">virNetworkLookupByName</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)
+<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a
href="#virNetworkLookupByUUID">virNetworkLookupByUUID</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)
+<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a
href="#virNetworkLookupByUUIDString">virNetworkLookupByUUIDString</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)
+int <a href="#virNetworkRef">virNetworkRef</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+int <a
href="#virNetworkSetAutostart">virNetworkSetAutostart</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int autostart)
+int <a href="#virNetworkUndefine">virNetworkUndefine</a> (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
+<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> <a
href="#virNodeDeviceCreateXML">virNodeDeviceCreateXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)
+int <a
href="#virNodeDeviceDestroy">virNodeDeviceDestroy</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a
href="#virNodeDeviceDettach">virNodeDeviceDettach</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a href="#virNodeDeviceFree">virNodeDeviceFree</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+const char * <a
href="#virNodeDeviceGetName">virNodeDeviceGetName</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+const char * <a
href="#virNodeDeviceGetParent">virNodeDeviceGetParent</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+char * <a
href="#virNodeDeviceGetXMLDesc">virNodeDeviceGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev,
<br /> unsigned int flags)
+int <a
href="#virNodeDeviceListCaps">virNodeDeviceListCaps</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev,
<br /> char ** const names, <br /> int maxnames)
+<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> <a
href="#virNodeDeviceLookupByName">virNodeDeviceLookupByName</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)
+int <a
href="#virNodeDeviceNumOfCaps">virNodeDeviceNumOfCaps</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a
href="#virNodeDeviceReAttach">virNodeDeviceReAttach</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a href="#virNodeDeviceRef">virNodeDeviceRef</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a href="#virNodeDeviceReset">virNodeDeviceReset</a> (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
+int <a
href="#virNodeGetCellsFreeMemory">virNodeGetCellsFreeMemory</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> unsigned long long * freeMems, <br /> int startCell, <br
/> int maxCells)
+unsigned long long <a
href="#virNodeGetFreeMemory">virNodeGetFreeMemory</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
+int <a href="#virNodeGetInfo">virNodeGetInfo</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)
+int <a
href="#virNodeGetSecurityModel">virNodeGetSecurityModel</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virSecurityModelPtr">virSecurityModelPtr</a>
secmodel)
+int <a href="#virNodeListDevices">virNodeListDevices</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * cap, <br /> char ** const names, <br
/> int maxnames, <br /> unsigned int flags)
+int <a href="#virNodeNumOfDevices">virNodeNumOfDevices</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * cap, <br /> unsigned int flags)
+int <a href="#virStoragePoolBuild">virStoragePoolBuild</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)
+int <a
href="#virStoragePoolCreate">virStoragePoolCreate</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolCreateXML">virStoragePoolCreateXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolDefineXML">virStoragePoolDefineXML</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml, <br /> unsigned int flags)
+int <a
href="#virStoragePoolDelete">virStoragePoolDelete</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)
+int <a
href="#virStoragePoolDestroy">virStoragePoolDestroy</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a href="#virStoragePoolFree">virStoragePoolFree</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a
href="#virStoragePoolGetAutostart">virStoragePoolGetAutostart</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> int * autostart)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virStoragePoolGetConnect">virStoragePoolGetConnect</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a
href="#virStoragePoolGetInfo">virStoragePoolGetInfo</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> <a
href="libvirt-libvirt.html#virStoragePoolInfoPtr">virStoragePoolInfoPtr</a>
info)
+const char * <a
href="#virStoragePoolGetName">virStoragePoolGetName</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a
href="#virStoragePoolGetUUID">virStoragePoolGetUUID</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned char * uuid)
+int <a
href="#virStoragePoolGetUUIDString">virStoragePoolGetUUIDString</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> char * buf)
+char * <a
href="#virStoragePoolGetXMLDesc">virStoragePoolGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)
+int <a
href="#virStoragePoolListVolumes">virStoragePoolListVolumes</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> char ** const names, <br /> int maxnames)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolLookupByName">virStoragePoolLookupByName</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolLookupByUUID">virStoragePoolLookupByUUID</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolLookupByUUIDString">virStoragePoolLookupByUUIDString</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)
+<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a
href="#virStoragePoolLookupByVolume">virStoragePoolLookupByVolume</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+int <a
href="#virStoragePoolNumOfVolumes">virStoragePoolNumOfVolumes</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a href="#virStoragePoolRef">virStoragePoolRef</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+int <a
href="#virStoragePoolRefresh">virStoragePoolRefresh</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)
+int <a
href="#virStoragePoolSetAutostart">virStoragePoolSetAutostart</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> int autostart)
+int <a
href="#virStoragePoolUndefine">virStoragePoolUndefine</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)
+<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolCreateXML">virStorageVolCreateXML</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * xmldesc, <br /> unsigned int flags)
+<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolCreateXMLFrom">virStorageVolCreateXMLFrom</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * xmldesc, <br /> <a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
clonevol, <br /> unsigned int flags)
+int <a href="#virStorageVolDelete">virStorageVolDelete</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> unsigned int flags)
+int <a href="#virStorageVolFree">virStorageVolFree</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a
href="#virStorageVolGetConnect">virStorageVolGetConnect</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+int <a
href="#virStorageVolGetInfo">virStorageVolGetInfo</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> <a
href="libvirt-libvirt.html#virStorageVolInfoPtr">virStorageVolInfoPtr</a>
info)
+const char * <a
href="#virStorageVolGetKey">virStorageVolGetKey</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+const char * <a
href="#virStorageVolGetName">virStorageVolGetName</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+char * <a
href="#virStorageVolGetPath">virStorageVolGetPath</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+char * <a
href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> unsigned int flags)
+<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolLookupByKey">virStorageVolLookupByKey</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * key)
+<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolLookupByName">virStorageVolLookupByName</a> (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * name)
+<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a
href="#virStorageVolLookupByPath">virStorageVolLookupByPath</a> (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * path)
+int <a href="#virStorageVolRef">virStorageVolRef</a> (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
+</pre><h2>Description</h2><h3><a name="macros"
id="macros">Macros</a></h3><h3><a
name="LIBVIR_VERSION_NUMBER"
id="LIBVIR_VERSION_NUMBER"><code>LIBVIR_VERSION_NUMBER</code></a></h3><pre>#define
LIBVIR_VERSION_NUMBER</pre><p>Macro providing the version of the library as
version * 1,000,000 + minor * 1000 + micro</p><h3><a
name="VIR_COPY_CPUMAP"
id="VIR_COPY_CPUMAP"><code>VIR_COPY_CPUMAP</code></a></h3><pre>#define
VIR_COPY_CPUMAP</pre><p>This macro is to be used in conjunction with
virDomainGetVcpus() and virDomainPinVcpu() APIs. <a
href="libvirt-libvirt.html#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a> macro
extract the cpumap of the specified vcpu from cpumaps array and copy it into cpumap to be
used later by virDomainPinVcpu() API.</p><h3><a
name="VIR_CPU_MAPLEN"
id="VIR_CPU_MAPLEN"><code>VIR_CPU_MAPLEN</code></a></h3><pre>#define
VIR_CPU_MAPLEN</pre><p>This macro is to be used in conjunction with
virDomainPinVcpu() API. It returns the length (in bytes) required to store the complete
CPU map between a single virtual & all physical CPUs of a
domain.</p><h3><a name="VIR_CPU_USABLE"
id="VIR_CPU_USABLE"><code>VIR_CPU_USABLE</code></a></h3><pre>#define
VIR_CPU_USABLE</pre><p>This macro is to be used in conjunction with
virDomainGetVcpus() API. <a
href="libvirt-libvirt.html#VIR_CPU_USABLE">VIR_CPU_USABLE</a> macro
returns a non zero value (true) if the cpu is usable by the vcpu, and 0
otherwise.</p><h3><a name="VIR_DOMAIN_SCHED_FIELD_LENGTH"
id="VIR_DOMAIN_SCHED_FIELD_LENGTH"><code>VIR_DOMAIN_SCHED_FIELD_LENGTH</code></a></h3><pre>#define
VIR_DOMAIN_SCHED_FIELD_LENGTH</pre><p>Macro providing the field length of
<a
href="libvirt-libvirt.html#virSchedParameter">virSchedParameter</a></p><h3><a
name="VIR_GET_CPUMAP"
id="VIR_GET_CPUMAP"><code>VIR_GET_CPUMAP</code></a></h3><pre>#define
VIR_GET_CPUMAP</pre><p>This macro is to be used in conjunction with
virDomainGetVcpus() and virDomainPinVcpu() APIs. <a
href="libvirt-libvirt.html#VIR_GET_CPUMAP">VIR_GET_CPUMAP</a> macro
returns a pointer to the cpumap of the specified vcpu from cpumaps
array.</p><h3><a name="VIR_NODEINFO_MAXCPUS"
id="VIR_NODEINFO_MAXCPUS"><code>VIR_NODEINFO_MAXCPUS</code></a></h3><pre>#define
VIR_NODEINFO_MAXCPUS</pre><p>This macro is to calculate the total number of
CPUs supported but not necessary active in the host.</p><h3><a
name="VIR_SECURITY_DOI_BUFLEN"
id="VIR_SECURITY_DOI_BUFLEN"><code>VIR_SECURITY_DOI_BUFLEN</code></a></h3><pre>#define
VIR_SECURITY_DOI_BUFLEN</pre><p>Macro providing the maximum length of the
<a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a>
doi string.</p><h3><a name="VIR_SECURITY_LABEL_BUFLEN"
id="VIR_SECURITY_LABEL_BUFLEN"><code>VIR_SECURITY_LABEL_BUFLEN</code></a></h3><pre>#define
VIR_SECURITY_LABEL_BUFLEN</pre><p>Macro providing the maximum length of the
<a href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a>
label string. Note that this value is based on that used by Labeled
NFS.</p><h3><a name="VIR_SECURITY_MODEL_BUFLEN"
id="VIR_SECURITY_MODEL_BUFLEN"><code>VIR_SECURITY_MODEL_BUFLEN</code></a></h3><pre>#define
VIR_SECURITY_MODEL_BUFLEN</pre><p>Macro providing the maximum length of the
<a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a>
model string.</p><h3><a name="VIR_UNUSE_CPU"
id="VIR_UNUSE_CPU"><code>VIR_UNUSE_CPU</code></a></h3><pre>#define
VIR_UNUSE_CPU</pre><p>This macro is to be used in conjunction with
virDomainPinVcpu() API. USE_CPU macro reset the bit (CPU not usable) of the related cpu in
cpumap.</p><h3><a name="VIR_USE_CPU"
id="VIR_USE_CPU"><code>VIR_USE_CPU</code></a></h3><pre>#define
VIR_USE_CPU</pre><p>This macro is to be used in conjunction with
virDomainPinVcpu() API. USE_CPU macro set the bit (CPU usable) of the related cpu in
cpumap.</p><h3><a name="VIR_UUID_BUFLEN"
id="VIR_UUID_BUFLEN"><code>VIR_UUID_BUFLEN</code></a></h3><pre>#define
VIR_UUID_BUFLEN</pre><p>This macro provides the length of the buffer required
for virDomainGetUUID()</p><h3><a name="VIR_UUID_STRING_BUFLEN"
id="VIR_UUID_STRING_BUFLEN"><code>VIR_UUID_STRING_BUFLEN</code></a></h3><pre>#define
VIR_UUID_STRING_BUFLEN</pre><p>This macro provides the length of the buffer
required for virDomainGetUUIDString()</p><h3><a name="types"
id="types">Types</a></h3><h3><a
name="virConnect"
id="virConnect"><code>virConnect</code></a></h3><div
class="api"><pre>struct virConnect{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virConnectAuth"
id="virConnectAuth"><code>virConnectAuth</code></a></h3><div
class="api"><pre>struct virConnectAuth{
+</pre><table><tr><td>int
*</td><td>credtype</td><td> : List of supported <a
href="libvirt-libvirt.html#virConnectCredentialType">virConnectCredentialType</a>
values</td></tr><tr><td>unsigned
int</td><td>ncredtype</td></tr><tr><td><a
href="libvirt-libvirt.html#virConnectAuthCallbackPtr">virConnectAuthCallbackPtr</a></td><td>cb</td><td>
: Callback used to collect credentials</td></tr><tr><td>void
*</td><td>cbdata</td></tr></table><pre>
+}
+</pre></div><h3><a name="virConnectCredential"
id="virConnectCredential"><code>virConnectCredential</code></a></h3><div
class="api"><pre>struct virConnectCredential{
+</pre><table><tr><td>int</td><td>type</td><td>
: One of <a
href="libvirt-libvirt.html#virConnectCredentialType">virConnectCredentialType</a>
constants</td></tr><tr><td>const char
*</td><td>prompt</td><td> : Prompt to show to
user</td></tr><tr><td>const char
*</td><td>challenge</td><td> : Additional challenge to
show</td></tr><tr><td>const char
*</td><td>defresult</td><td> : Optional default
result</td></tr><tr><td>char
*</td><td>result</td><td> : Result to be filled with user response
(or defresult)</td></tr><tr><td>unsigned
int</td><td>resultlen</td><td> : Length of the
result</td></tr></table><pre>
+}
+</pre></div><h3><a name="virConnectCredentialType"
id="virConnectCredentialType"><code>virConnectCredentialType</code></a></h3><div
class="api"><pre>enum virConnectCredentialType {
+</pre><table><tr><td><a name="VIR_CRED_USERNAME"
id="VIR_CRED_USERNAME">VIR_CRED_USERNAME</a></td><td> =
</td><td>1</td><td> : Identity to act
as</td></tr><tr><td><a name="VIR_CRED_AUTHNAME"
id="VIR_CRED_AUTHNAME">VIR_CRED_AUTHNAME</a></td><td> =
</td><td>2</td><td> : Identify to authorize
as</td></tr><tr><td><a name="VIR_CRED_LANGUAGE"
id="VIR_CRED_LANGUAGE">VIR_CRED_LANGUAGE</a></td><td> =
</td><td>3</td><td> : RFC 1766 languages, comma
separated</td></tr><tr><td><a name="VIR_CRED_CNONCE"
id="VIR_CRED_CNONCE">VIR_CRED_CNONCE</a></td><td> =
</td><td>4</td><td> : client supplies a
nonce</td></tr><tr><td><a name="VIR_CRED_PASSPHRASE"
id="VIR_CRED_PASSPHRASE">VIR_CRED_PASSPHRASE</a></td><td> =
</td><td>5</td><td> : Passphrase
secret</td></tr><tr><td><a name="VIR_CRED_ECHOPROMPT"
id="VIR_CRED_ECHOPROMPT">VIR_CRED_ECHOPROMPT</a></td><td> =
</td><td>6</td><td> : Challenge
response</td></tr><tr><td><a
name="VIR_CRED_NOECHOPROMPT"
id="VIR_CRED_NOECHOPROMPT">VIR_CRED_NOECHOPROMPT</a></td><td>
= </td><td>7</td><td> : Challenge
response</td></tr><tr><td><a name="VIR_CRED_REALM"
id="VIR_CRED_REALM">VIR_CRED_REALM</a></td><td> =
</td><td>8</td><td> : Authentication
realm</td></tr><tr><td><a name="VIR_CRED_EXTERNAL"
id="VIR_CRED_EXTERNAL">VIR_CRED_EXTERNAL</a></td><td> =
</td><td>9</td><td> : Externally managed credential More may be
added - expect the unexpected</td></tr></table><pre>}
+</pre></div><h3><a name="virConnectFlags"
id="virConnectFlags"><code>virConnectFlags</code></a></h3><div
class="api"><pre>enum virConnectFlags {
+</pre><table><tr><td><a name="VIR_CONNECT_RO"
id="VIR_CONNECT_RO">VIR_CONNECT_RO</a></td><td> =
</td><td>1</td><td> : A readonly
connection</td></tr></table><pre>}
+</pre></div><h3><a name="virDomain"
id="virDomain"><code>virDomain</code></a></h3><div
class="api"><pre>struct virDomain{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virDomainBlockStatsStruct"
id="virDomainBlockStatsStruct"><code>virDomainBlockStatsStruct</code></a></h3><div
class="api"><pre>struct virDomainBlockStatsStruct{
+</pre><table><tr><td>long
long</td><td>rd_req</td><td> : number of read
requests</td></tr><tr><td>long
long</td><td>rd_bytes</td><td> : number of read
bytes</td></tr><tr><td>long
long</td><td>wr_req</td><td> : number of write
requests</td></tr><tr><td>long
long</td><td>wr_bytes</td><td> : number of written
bytes</td></tr><tr><td>long
long</td><td>errs</td><td> : In Xen this returns the mysterious
'oo_req'.</td></tr></table><pre>
+}
+</pre></div><h3><a name="virDomainCreateFlags"
id="virDomainCreateFlags"><code>virDomainCreateFlags</code></a></h3><div
class="api"><pre>enum virDomainCreateFlags {
+</pre><table><tr><td><a name="VIR_DOMAIN_NONE"
id="VIR_DOMAIN_NONE">VIR_DOMAIN_NONE</a></td><td> =
</td><td>0</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainEventDefinedDetailType"
id="virDomainEventDefinedDetailType"><code>virDomainEventDefinedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventDefinedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_DEFINED_ADDED"
id="VIR_DOMAIN_EVENT_DEFINED_ADDED">VIR_DOMAIN_EVENT_DEFINED_ADDED</a></td><td>
= </td><td>0</td><td> : Newly created config
file</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_DEFINED_UPDATED"
id="VIR_DOMAIN_EVENT_DEFINED_UPDATED">VIR_DOMAIN_EVENT_DEFINED_UPDATED</a></td><td>
= </td><td>1</td><td> : Changed config
file</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainEventResumedDetailType"
id="virDomainEventResumedDetailType"><code>virDomainEventResumedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventResumedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED"
id="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED">VIR_DOMAIN_EVENT_RESUMED_UNPAUSED</a></td><td>
= </td><td>0</td><td> : Normal resume due to admin
unpause</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_RESUMED_MIGRATED"
id="VIR_DOMAIN_EVENT_RESUMED_MIGRATED">VIR_DOMAIN_EVENT_RESUMED_MIGRATED</a></td><td>
= </td><td>1</td><td> : Resumed for completion of
migration</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainEventStartedDetailType"
id="virDomainEventStartedDetailType"><code>virDomainEventStartedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventStartedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_STARTED_BOOTED"
id="VIR_DOMAIN_EVENT_STARTED_BOOTED">VIR_DOMAIN_EVENT_STARTED_BOOTED</a></td><td>
= </td><td>0</td><td> : Normal startup from
boot</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STARTED_MIGRATED"
id="VIR_DOMAIN_EVENT_STARTED_MIGRATED">VIR_DOMAIN_EVENT_STARTED_MIGRATED</a></td><td>
= </td><td>1</td><td> : Incoming migration from another
host</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STARTED_RESTORED"
id="VIR_DOMAIN_EVENT_STARTED_RESTORED">VIR_DOMAIN_EVENT_STARTED_RESTORED</a></td><td>
= </td><td>2</td><td> : Restored from a state
file</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainEventStoppedDetailType"
id="virDomainEventStoppedDetailType"><code>virDomainEventStoppedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventStoppedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN"
id="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN">VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN</a></td><td>
= </td><td>0</td><td> : Normal
shutdown</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_DESTROYED"
id="VIR_DOMAIN_EVENT_STOPPED_DESTROYED">VIR_DOMAIN_EVENT_STOPPED_DESTROYED</a></td><td>
= </td><td>1</td><td> : Forced poweroff from
host</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_CRASHED"
id="VIR_DOMAIN_EVENT_STOPPED_CRASHED">VIR_DOMAIN_EVENT_STOPPED_CRASHED</a></td><td>
= </td><td>2</td><td> : Guest
crashed</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_MIGRATED"
id="VIR_DOMAIN_EVENT_STOPPED_MIGRATED">VIR_DOMAIN_EVENT_STOPPED_MIGRATED</a></td><td>
= </td><td>3</td><td> : Migrated off to another
host</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_SAVED"
id="VIR_DOMAIN_EVENT_STOPPED_SAVED">VIR_DOMAIN_EVENT_STOPPED_SAVED</a></td><td>
= </td><td>4</td><td> : Saved to a state
file</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED_FAILED"
id="VIR_DOMAIN_EVENT_STOPPED_FAILED">VIR_DOMAIN_EVENT_STOPPED_FAILED</a></td><td>
= </td><td>5</td><td> : Host emulator/mgmt
failed</td></tr></table><pre>}
+</pre></div><h3><a
name="virDomainEventSuspendedDetailType"
id="virDomainEventSuspendedDetailType"><code>virDomainEventSuspendedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventSuspendedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED"
id="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED">VIR_DOMAIN_EVENT_SUSPENDED_PAUSED</a></td><td>
= </td><td>0</td><td> : Normal suspend due to admin
pause</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED"
id="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED">VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED</a></td><td>
= </td><td>1</td><td> : Suspended for offline
migration</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainEventType"
id="virDomainEventType"><code>virDomainEventType</code></a></h3><div
class="api"><pre>enum virDomainEventType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_DEFINED"
id="VIR_DOMAIN_EVENT_DEFINED">VIR_DOMAIN_EVENT_DEFINED</a></td><td>
= </td><td>0</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_UNDEFINED"
id="VIR_DOMAIN_EVENT_UNDEFINED">VIR_DOMAIN_EVENT_UNDEFINED</a></td><td>
= </td><td>1</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STARTED"
id="VIR_DOMAIN_EVENT_STARTED">VIR_DOMAIN_EVENT_STARTED</a></td><td>
= </td><td>2</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_SUSPENDED"
id="VIR_DOMAIN_EVENT_SUSPENDED">VIR_DOMAIN_EVENT_SUSPENDED</a></td><td>
= </td><td>3</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_RESUMED"
id="VIR_DOMAIN_EVENT_RESUMED">VIR_DOMAIN_EVENT_RESUMED</a></td><td>
= </td><td>4</td></tr><tr><td><a
name="VIR_DOMAIN_EVENT_STOPPED"
id="VIR_DOMAIN_EVENT_STOPPED">VIR_DOMAIN_EVENT_STOPPED</a></td><td>
= </td><td>5</td></tr></table><pre>}
+</pre></div><h3><a
name="virDomainEventUndefinedDetailType"
id="virDomainEventUndefinedDetailType"><code>virDomainEventUndefinedDetailType</code></a></h3><div
class="api"><pre>enum virDomainEventUndefinedDetailType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED"
id="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED">VIR_DOMAIN_EVENT_UNDEFINED_REMOVED</a></td><td>
= </td><td>0</td><td> : Deleted the config
file</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainInfo"
id="virDomainInfo"><code>virDomainInfo</code></a></h3><div
class="api"><pre>struct virDomainInfo{
+</pre><table><tr><td>unsigned
char</td><td>state</td><td> : the running state, one of <a
href="libvirt-libvirt.html#virDomainState">virDomainState</a></td></tr><tr><td>unsigned
long</td><td>maxMem</td><td> : the maximum memory in KBytes
allowed</td></tr><tr><td>unsigned
long</td><td>memory</td><td> : the memory in KBytes used by the
domain</td></tr><tr><td>unsigned
short</td><td>nrVirtCpu</td><td> : the number of virtual CPUs for
the domain</td></tr><tr><td>unsigned long
long</td><td>cpuTime</td><td> : the CPU time used in
nanoseconds</td></tr></table><pre>
+}
+</pre></div><h3><a name="virDomainInterfaceStatsStruct"
id="virDomainInterfaceStatsStruct"><code>virDomainInterfaceStatsStruct</code></a></h3><div
class="api"><pre>struct virDomainInterfaceStatsStruct{
+</pre><table><tr><td>long
long</td><td>rx_bytes</td></tr><tr><td>long
long</td><td>rx_packets</td></tr><tr><td>long
long</td><td>rx_errs</td></tr><tr><td>long
long</td><td>rx_drop</td></tr><tr><td>long
long</td><td>tx_bytes</td></tr><tr><td>long
long</td><td>tx_packets</td></tr><tr><td>long
long</td><td>tx_errs</td></tr><tr><td>long
long</td><td>tx_drop</td></tr></table><pre>
+}
+</pre></div><h3><a name="virDomainMemoryFlags"
id="virDomainMemoryFlags"><code>virDomainMemoryFlags</code></a></h3><div
class="api"><pre>enum virDomainMemoryFlags {
+</pre><table><tr><td><a name="VIR_MEMORY_VIRTUAL"
id="VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a></td><td> =
</td><td>1</td><td> : addresses are virtual
addresses</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainMigrateFlags"
id="virDomainMigrateFlags"><code>virDomainMigrateFlags</code></a></h3><div
class="api"><pre>enum virDomainMigrateFlags {
+</pre><table><tr><td><a name="VIR_MIGRATE_LIVE"
id="VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a></td><td> =
</td><td>1</td><td> : live
migration</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainState"
id="virDomainState"><code>virDomainState</code></a></h3><div
class="api"><pre>enum virDomainState {
+</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE"
id="VIR_DOMAIN_NOSTATE">VIR_DOMAIN_NOSTATE</a></td><td> =
</td><td>0</td><td> : no
state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING"
id="VIR_DOMAIN_RUNNING">VIR_DOMAIN_RUNNING</a></td><td> =
</td><td>1</td><td> : the domain is
running</td></tr><tr><td><a name="VIR_DOMAIN_BLOCKED"
id="VIR_DOMAIN_BLOCKED">VIR_DOMAIN_BLOCKED</a></td><td> =
</td><td>2</td><td> : the domain is blocked on
resource</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED"
id="VIR_DOMAIN_PAUSED">VIR_DOMAIN_PAUSED</a></td><td> =
</td><td>3</td><td> : the domain is paused by
user</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN"
id="VIR_DOMAIN_SHUTDOWN">VIR_DOMAIN_SHUTDOWN</a></td><td> =
</td><td>4</td><td> : the domain is being shut
down</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF"
id="VIR_DOMAIN_SHUTOFF">VIR_DOMAIN_SHUTOFF</a></td><td> =
</td><td>5</td><td> : the domain is shut
off</td></tr><tr><td><a name="VIR_DOMAIN_CRASHED"
id="VIR_DOMAIN_CRASHED">VIR_DOMAIN_CRASHED</a></td><td> =
</td><td>6</td><td> : the domain is
crashed</td></tr></table><pre>}
+</pre></div><h3><a name="virDomainXMLFlags"
id="virDomainXMLFlags"><code>virDomainXMLFlags</code></a></h3><div
class="api"><pre>enum virDomainXMLFlags {
+</pre><table><tr><td><a name="VIR_DOMAIN_XML_SECURE"
id="VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a></td><td>
= </td><td>1</td><td> : dump security sensitive information
too</td></tr><tr><td><a
name="VIR_DOMAIN_XML_INACTIVE"
id="VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a></td><td>
= </td><td>2</td><td> : dump inactive domain
information</td></tr></table><pre>}
+</pre></div><h3><a name="virEventHandleType"
id="virEventHandleType"><code>virEventHandleType</code></a></h3><div
class="api"><pre>enum virEventHandleType {
+</pre><table><tr><td><a
name="VIR_EVENT_HANDLE_READABLE"
id="VIR_EVENT_HANDLE_READABLE">VIR_EVENT_HANDLE_READABLE</a></td><td>
= </td><td>1</td></tr><tr><td><a
name="VIR_EVENT_HANDLE_WRITABLE"
id="VIR_EVENT_HANDLE_WRITABLE">VIR_EVENT_HANDLE_WRITABLE</a></td><td>
= </td><td>2</td></tr><tr><td><a
name="VIR_EVENT_HANDLE_ERROR"
id="VIR_EVENT_HANDLE_ERROR">VIR_EVENT_HANDLE_ERROR</a></td><td>
= </td><td>4</td></tr><tr><td><a
name="VIR_EVENT_HANDLE_HANGUP"
id="VIR_EVENT_HANDLE_HANGUP">VIR_EVENT_HANDLE_HANGUP</a></td><td>
= </td><td>8</td></tr></table><pre>}
+</pre></div><h3><a name="virNetwork"
id="virNetwork"><code>virNetwork</code></a></h3><div
class="api"><pre>struct virNetwork{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virNodeDevice"
id="virNodeDevice"><code>virNodeDevice</code></a></h3><div
class="api"><pre>struct virNodeDevice{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virNodeInfo"
id="virNodeInfo"><code>virNodeInfo</code></a></h3><div
class="api"><pre>struct virNodeInfo{
+</pre><table><tr><td>charmodel[32]</td><td>model</td><td>
: string indicating the CPU model</td></tr><tr><td>unsigned
long</td><td>memory</td><td> : memory size in
kilobytes</td></tr><tr><td>unsigned
int</td><td>cpus</td><td> : the number of active
CPUs</td></tr><tr><td>unsigned
int</td><td>mhz</td><td> : expected CPU
frequency</td></tr><tr><td>unsigned
int</td><td>nodes</td><td> : the number of NUMA cell, 1 for
uniform mem access</td></tr><tr><td>unsigned
int</td><td>sockets</td><td> : number of CPU socket per
node</td></tr><tr><td>unsigned
int</td><td>cores</td><td> : number of core per
socket</td></tr><tr><td>unsigned
int</td><td>threads</td><td> : number of threads per
core</td></tr></table><pre>
+}
+</pre></div><h3><a name="virSchedParameter"
id="virSchedParameter"><code>virSchedParameter</code></a></h3><div
class="api"><pre>struct virSchedParameter{
+</pre><table><tr><td>charfield[VIR_DOMAIN_SCHED_FIELD_LENGTH]</td><td>field</td><td>
: parameter
name</td></tr><tr><td>int</td><td>type</td><td>
: parameter type</td></tr></table><pre>
+}
+</pre></div><h3><a name="virSchedParameterType"
id="virSchedParameterType"><code>virSchedParameterType</code></a></h3><div
class="api"><pre>enum virSchedParameterType {
+</pre><table><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_INT"
id="VIR_DOMAIN_SCHED_FIELD_INT">VIR_DOMAIN_SCHED_FIELD_INT</a></td><td>
= </td><td>1</td><td> : integer
case</td></tr><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_UINT"
id="VIR_DOMAIN_SCHED_FIELD_UINT">VIR_DOMAIN_SCHED_FIELD_UINT</a></td><td>
= </td><td>2</td><td> : unsigned integer
case</td></tr><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_LLONG"
id="VIR_DOMAIN_SCHED_FIELD_LLONG">VIR_DOMAIN_SCHED_FIELD_LLONG</a></td><td>
= </td><td>3</td><td> : long long
case</td></tr><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_ULLONG"
id="VIR_DOMAIN_SCHED_FIELD_ULLONG">VIR_DOMAIN_SCHED_FIELD_ULLONG</a></td><td>
= </td><td>4</td><td> : unsigned long long
case</td></tr><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_DOUBLE"
id="VIR_DOMAIN_SCHED_FIELD_DOUBLE">VIR_DOMAIN_SCHED_FIELD_DOUBLE</a></td><td>
= </td><td>5</td><td> : double
case</td></tr><tr><td><a
name="VIR_DOMAIN_SCHED_FIELD_BOOLEAN"
id="VIR_DOMAIN_SCHED_FIELD_BOOLEAN">VIR_DOMAIN_SCHED_FIELD_BOOLEAN</a></td><td>
= </td><td>6</td><td> : boolean(character)
case</td></tr></table><pre>}
+</pre></div><h3><a name="virSecurityLabel"
id="virSecurityLabel"><code>virSecurityLabel</code></a></h3><div
class="api"><pre>struct virSecurityLabel{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virSecurityModel"
id="virSecurityModel"><code>virSecurityModel</code></a></h3><div
class="api"><pre>struct virSecurityModel{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virStoragePool"
id="virStoragePool"><code>virStoragePool</code></a></h3><div
class="api"><pre>struct virStoragePool{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virStoragePoolBuildFlags"
id="virStoragePoolBuildFlags"><code>virStoragePoolBuildFlags</code></a></h3><div
class="api"><pre>enum virStoragePoolBuildFlags {
+</pre><table><tr><td><a
name="VIR_STORAGE_POOL_BUILD_NEW"
id="VIR_STORAGE_POOL_BUILD_NEW">VIR_STORAGE_POOL_BUILD_NEW</a></td><td>
= </td><td>0</td><td> : Regular build from
scratch</td></tr><tr><td><a
name="VIR_STORAGE_POOL_BUILD_REPAIR"
id="VIR_STORAGE_POOL_BUILD_REPAIR">VIR_STORAGE_POOL_BUILD_REPAIR</a></td><td>
= </td><td>1</td><td> : Repair /
reinitialize</td></tr><tr><td><a
name="VIR_STORAGE_POOL_BUILD_RESIZE"
id="VIR_STORAGE_POOL_BUILD_RESIZE">VIR_STORAGE_POOL_BUILD_RESIZE</a></td><td>
= </td><td>2</td><td> : Extend existing
pool</td></tr></table><pre>}
+</pre></div><h3><a name="virStoragePoolDeleteFlags"
id="virStoragePoolDeleteFlags"><code>virStoragePoolDeleteFlags</code></a></h3><div
class="api"><pre>enum virStoragePoolDeleteFlags {
+</pre><table><tr><td><a
name="VIR_STORAGE_POOL_DELETE_NORMAL"
id="VIR_STORAGE_POOL_DELETE_NORMAL">VIR_STORAGE_POOL_DELETE_NORMAL</a></td><td>
= </td><td>0</td><td> : Delete metadata only
(fast)</td></tr><tr><td><a
name="VIR_STORAGE_POOL_DELETE_ZEROED"
id="VIR_STORAGE_POOL_DELETE_ZEROED">VIR_STORAGE_POOL_DELETE_ZEROED</a></td><td>
= </td><td>1</td><td> : Clear all data to zeros
(slow)</td></tr></table><pre>}
+</pre></div><h3><a name="virStoragePoolInfo"
id="virStoragePoolInfo"><code>virStoragePoolInfo</code></a></h3><div
class="api"><pre>struct virStoragePoolInfo{
+</pre><table><tr><td>int</td><td>state</td><td>
: <a
href="libvirt-libvirt.html#virStoragePoolState">virStoragePoolState</a>
flags</td></tr><tr><td>unsigned long
long</td><td>capacity</td><td> : Logical size
bytes</td></tr><tr><td>unsigned long
long</td><td>allocation</td><td> : Current allocation
bytes</td></tr><tr><td>unsigned long
long</td><td>available</td><td> : Remaining free space
bytes</td></tr></table><pre>
+}
+</pre></div><h3><a name="virStoragePoolState"
id="virStoragePoolState"><code>virStoragePoolState</code></a></h3><div
class="api"><pre>enum virStoragePoolState {
+</pre><table><tr><td><a
name="VIR_STORAGE_POOL_INACTIVE"
id="VIR_STORAGE_POOL_INACTIVE">VIR_STORAGE_POOL_INACTIVE</a></td><td>
= </td><td>0</td><td> : Not
running</td></tr><tr><td><a
name="VIR_STORAGE_POOL_BUILDING"
id="VIR_STORAGE_POOL_BUILDING">VIR_STORAGE_POOL_BUILDING</a></td><td>
= </td><td>1</td><td> : Initializing pool, not
available</td></tr><tr><td><a
name="VIR_STORAGE_POOL_RUNNING"
id="VIR_STORAGE_POOL_RUNNING">VIR_STORAGE_POOL_RUNNING</a></td><td>
= </td><td>2</td><td> : Running
normally</td></tr><tr><td><a
name="VIR_STORAGE_POOL_DEGRADED"
id="VIR_STORAGE_POOL_DEGRADED">VIR_STORAGE_POOL_DEGRADED</a></td><td>
= </td><td>3</td><td> : Running
degraded</td></tr></table><pre>}
+</pre></div><h3><a name="virStorageVol"
id="virStorageVol"><code>virStorageVol</code></a></h3><div
class="api"><pre>struct virStorageVol{
+</pre><table><tr><td colspan="3">The content of this
structure is not made public by the API</td></tr></table><pre>
+}
+</pre></div><h3><a name="virStorageVolDeleteFlags"
id="virStorageVolDeleteFlags"><code>virStorageVolDeleteFlags</code></a></h3><div
class="api"><pre>enum virStorageVolDeleteFlags {
+</pre><table><tr><td><a
name="VIR_STORAGE_VOL_DELETE_NORMAL"
id="VIR_STORAGE_VOL_DELETE_NORMAL">VIR_STORAGE_VOL_DELETE_NORMAL</a></td><td>
= </td><td>0</td><td> : Delete metadata only
(fast)</td></tr><tr><td><a
name="VIR_STORAGE_VOL_DELETE_ZEROED"
id="VIR_STORAGE_VOL_DELETE_ZEROED">VIR_STORAGE_VOL_DELETE_ZEROED</a></td><td>
= </td><td>1</td><td> : Clear all data to zeros
(slow)</td></tr></table><pre>}
+</pre></div><h3><a name="virStorageVolInfo"
id="virStorageVolInfo"><code>virStorageVolInfo</code></a></h3><div
class="api"><pre>struct virStorageVolInfo{
+</pre><table><tr><td>int</td><td>type</td><td>
: <a
href="libvirt-libvirt.html#virStorageVolType">virStorageVolType</a>
flags</td></tr><tr><td>unsigned long
long</td><td>capacity</td><td> : Logical size
bytes</td></tr><tr><td>unsigned long
long</td><td>allocation</td><td> : Current allocation
bytes</td></tr></table><pre>
+}
+</pre></div><h3><a name="virStorageVolType"
id="virStorageVolType"><code>virStorageVolType</code></a></h3><div
class="api"><pre>enum virStorageVolType {
+</pre><table><tr><td><a name="VIR_STORAGE_VOL_FILE"
id="VIR_STORAGE_VOL_FILE">VIR_STORAGE_VOL_FILE</a></td><td>
= </td><td>0</td><td> : Regular file based
volumes</td></tr><tr><td><a
name="VIR_STORAGE_VOL_BLOCK"
id="VIR_STORAGE_VOL_BLOCK">VIR_STORAGE_VOL_BLOCK</a></td><td>
= </td><td>1</td><td> : Block based
volumes</td></tr></table><pre>}
+</pre></div><h3><a name="virVcpuInfo"
id="virVcpuInfo"><code>virVcpuInfo</code></a></h3><div
class="api"><pre>struct virVcpuInfo{
+</pre><table><tr><td>unsigned
int</td><td>number</td><td> : virtual CPU
number</td></tr><tr><td>int</td><td>state</td><td>
: value from <a
href="libvirt-libvirt.html#virVcpuState">virVcpuState</a></td></tr><tr><td>unsigned
long long</td><td>cpuTime</td><td> : CPU time used, in
nanoseconds</td></tr><tr><td>int</td><td>cpu</td><td>
: real CPU number, or -1 if offline</td></tr></table><pre>
+}
+</pre></div><h3><a name="virVcpuState"
id="virVcpuState"><code>virVcpuState</code></a></h3><div
class="api"><pre>enum virVcpuState {
+</pre><table><tr><td><a name="VIR_VCPU_OFFLINE"
id="VIR_VCPU_OFFLINE">VIR_VCPU_OFFLINE</a></td><td> =
</td><td>0</td><td> : the virtual CPU is
offline</td></tr><tr><td><a name="VIR_VCPU_RUNNING"
id="VIR_VCPU_RUNNING">VIR_VCPU_RUNNING</a></td><td> =
</td><td>1</td><td> : the virtual CPU is
running</td></tr><tr><td><a name="VIR_VCPU_BLOCKED"
id="VIR_VCPU_BLOCKED">VIR_VCPU_BLOCKED</a></td><td> =
</td><td>2</td><td> : the virtual CPU is blocked on
resource</td></tr></table><pre>}
+</pre></div><h3><a name="functions"
id="functions">Functions</a></h3><h3><a
name="virConnectAuthCallbackPtr"
id="virConnectAuthCallbackPtr"><code>virConnectAuthCallbackPtr</code></a></h3><pre
class="programlisting">typedef int (*virConnectAuthCallbackPtr) (<a
href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a>
cred, <br /> unsigned int ncred, <br /> void * cbdata)
+</pre><p></p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>cred</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>ncred</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>cbdata</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br
/><h3><a name="virConnectClose"
id="virConnectClose"><code>virConnectClose</code></a></h3><pre
class="programlisting">int virConnectClose (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of
error.</td></tr></tbody></table></div><h3><a
name="virConnectDomainEventCallback"
id="virConnectDomainEventCallback"><code>virConnectDomainEventCallback</code></a></h3><pre
class="programlisting">typedef int (*virConnectDomainEventCallback) (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> int event, <br /> int detail, <br /> void * opaque)
+</pre><p>A callback function to be registered, and called when a domain event
occurs</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td><a
href="libvirt-libvirt.html#virConnect">virConnect</a>
connection</td></tr><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>The
domain on which the event occured</td></tr><tr><td><span
class="term"><i><tt>event</tt></i>:</span></td><td>The
specfic <a
href="libvirt-libvirt.html#virDomainEventType">virDomainEventType</a>
which occured</td></tr><tr><td><span
class="term"><i><tt>detail</tt></i>:</span></td><td>event
specific detail information</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
user data</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br
/><h3><a name="virConnectDomainEventDeregister"
id="virConnectDomainEventDeregister"><code>virConnectDomainEventDeregister</code></a></h3><pre
class="programlisting">int virConnectDomainEventDeregister (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb)<br />
+</pre><p>Removes a Domain Event Callback. De-registering for a domain
callback will disable delivery of this event type</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virConnectDomainEventRegister"
id="virConnectDomainEventRegister"><code>virConnectDomainEventRegister</code></a></h3><pre
class="programlisting">int virConnectDomainEventRegister (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a>
freecb)<br />
+</pre><p>Adds a Domain Event Callback. Registering for a domain callback will
enable delivery of the events The <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle
passed into the callback upon delivery of an event is only valid for the duration of
execution of the callback. If the callback wishes to keep the domain object after the
callback</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the connection</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>callback
to the function handling domain events</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque
data to pass on to the callback</td></tr><tr><td><span
class="term"><i><tt>freecb</tt></i>:</span></td><td>optional
function to deallocate opaque when not used
anymore</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>it
shall take a reference to it, by calling virDomainRef. The reference can be released once
the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virConnectDomainXMLFromNative"
id="virConnectDomainXMLFromNative"><code>virConnectDomainXMLFromNative</code></a></h3><pre
class="programlisting">char * virConnectDomainXMLFromNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * nativeConfig,
<br /> unsigned int flags)<br />
+</pre><p>Reads native configuration data describing a domain, and generates
libvirt domain XML. The format of the native data is hypervisor
dependant.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format importing from</td></tr><tr><td><span
class="term"><i><tt>nativeConfig</tt></i>:</span></td><td>the
configuration data to import</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free()
the returned
value.</td></tr></tbody></table></div><h3><a
name="virConnectDomainXMLToNative"
id="virConnectDomainXMLToNative"><code>virConnectDomainXMLToNative</code></a></h3><pre
class="programlisting">char * virConnectDomainXMLToNative (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * nativeFormat, <br /> const char * domainXml,
<br /> unsigned int flags)<br />
+</pre><p>Reads a domain XML configuration document, and generates generates a
native configuration file describing the domain. The format of the native data is
hypervisor dependant.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration
format exporting to</td></tr><tr><td><span
class="term"><i><tt>domainXml</tt></i>:</span></td><td>the
domain configuration to export</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>currently
unused, pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller
must free() the returned
value.</td></tr></tbody></table></div><h3><a
name="virConnectFindStoragePoolSources"
id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre
class="programlisting">char * virConnectFindStoragePoolSources (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type, <br /> const char * srcSpec, <br
/> unsigned int flags)<br />
+</pre><p>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)</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>type</tt></i>:</span></td><td>type
of storage pool sources to discover</td></tr><tr><td><span
class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML
document specifying discovery source</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for discovery (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>an
xml document consisting of a SourceList element containing a source document appropriate
to the given pool type for each discovered
source.</td></tr></tbody></table></div><h3><a
name="virConnectGetCapabilities"
id="virConnectGetCapabilities"><code>virConnectGetCapabilities</code></a></h3><pre
class="programlisting">char * virConnectGetCapabilities (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides capabilities of the hypervisor / driver.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error, or an XML string defining the capabilities. The client must free the
returned string after
use.</td></tr></tbody></table></div><h3><a
name="virConnectGetHostname"
id="virConnectGetHostname"><code>virConnectGetHostname</code></a></h3><pre
class="programlisting">char * virConnectGetHostname (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to a hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
hostname which must be freed by the caller, or NULL if there was an
error.</td></tr></tbody></table></div><h3><a
name="virConnectGetMaxVcpus"
id="virConnectGetMaxVcpus"><code>virConnectGetMaxVcpus</code></a></h3><pre
class="programlisting">int virConnectGetMaxVcpus (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * type)<br />
+</pre><p>Provides the maximum number of virtual CPUs supported for a guest VM
of a specific type. The 'type' parameter here corresponds to the 'type'
attribute in the <domain> element of the XML.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>type</tt></i>:</span></td><td>value
of the 'type' attribute in the <domain>
element</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
maximum of virtual CPU or -1 in case of
error.</td></tr></tbody></table></div><h3><a
name="virConnectGetType"
id="virConnectGetType"><code>virConnectGetType</code></a></h3><pre
class="programlisting">const char * virConnectGetType (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Get the name of the Hypervisor software used.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error, a static zero terminated string otherwise. See also:
http://www.redhat.com/archives/libvir-list/2007-February/msg00096.html<...
name="virConnectGetURI"
id="virConnectGetURI"><code>virConnectGetURI</code></a></h3><pre
class="programlisting">char * virConnectGetURI (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>This returns the URI (name) of the hypervisor connection. Normally
this is the same as or similar to the string passed to the
virConnectOpen/virConnectOpenReadOnly call, but the driver may make the URI canonical. If
name == NULL was passed to virConnectOpen, then the driver will return a non-NULL URI
which can be used to connect to the same hypervisor later.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to a hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
URI string which must be freed by the caller, or NULL if there was an
error.</td></tr></tbody></table></div><h3><a
name="virConnectGetVersion"
id="virConnectGetVersion"><code>virConnectGetVersion</code></a></h3><pre
class="programlisting">int virConnectGetVersion (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> unsigned long * hvVer)<br />
+</pre><p>Get the version level of the Hypervisor running. This may work only
with hypervisor call, i.e. with privileged access to the hypervisor, not with a Read-Only
connection.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>hvVer</tt></i>:</span></td><td>return
value for the version of the running hypervisor
(OUT)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 otherwise. if the version can't be extracted by lack of capacities
returns 0 and @hvVer is 0, otherwise @hvVer value is major * 1,000,000 + minor * 1,000 +
release</td></tr></tbody></table></div><h3><a
name="virConnectListDefinedDomains"
id="virConnectListDefinedDomains"><code>virConnectListDefinedDomains</code></a></h3><pre
class="programlisting">int virConnectListDefinedDomains (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>list the defined but inactive domains, stores the pointers to the
names in @names</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>pointer
to an array to store the names</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of the array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of names provided in the array or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectListDefinedNetworks"
id="virConnectListDefinedNetworks"><code>virConnectListDefinedNetworks</code></a></h3><pre
class="programlisting">int virConnectListDefinedNetworks (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>list the inactive networks, stores the pointers to the names in
@names</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>pointer
to an array to store the names</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of the array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of names provided in the array or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectListDefinedStoragePools"
id="virConnectListDefinedStoragePools"><code>virConnectListDefinedStoragePools</code></a></h3><pre
class="programlisting">int virConnectListDefinedStoragePools (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>Provides the list of names of inactive storage pools upto maxnames.
If there are more than maxnames, the remaining names will be silently
ignored.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
of char * to fill with pool names (allocated by
caller)</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of the names array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
error</td></tr></tbody></table></div><h3><a
name="virConnectListDomains"
id="virConnectListDomains"><code>virConnectListDomains</code></a></h3><pre
class="programlisting">int virConnectListDomains (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> int * ids, <br /> int maxids)<br />
+</pre><p>Collect the list of active domains, and store their ID in
@maxids</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>ids</tt></i>:</span></td><td>array
to collect the list of IDs of active
domains</td></tr><tr><td><span
class="term"><i><tt>maxids</tt></i>:</span></td><td>size
of @ids</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of domain found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectListNetworks"
id="virConnectListNetworks"><code>virConnectListNetworks</code></a></h3><pre
class="programlisting">int virConnectListNetworks (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>Collect the list of active networks, and store their names in
@names</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
to collect the list of names of active
networks</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of @names</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of networks found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectListStoragePools"
id="virConnectListStoragePools"><code>virConnectListStoragePools</code></a></h3><pre
class="programlisting">int virConnectListStoragePools (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>Provides the list of names of active storage pools upto maxnames. If
there are more than maxnames, the remaining names will be silently
ignored.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
of char * to fill with pool names (allocated by
caller)</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of the names array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfDefinedDomains"
id="virConnectNumOfDefinedDomains"><code>virConnectNumOfDefinedDomains</code></a></h3><pre
class="programlisting">int virConnectNumOfDefinedDomains (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of defined but inactive
domains.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of domain found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfDefinedNetworks"
id="virConnectNumOfDefinedNetworks"><code>virConnectNumOfDefinedNetworks</code></a></h3><pre
class="programlisting">int virConnectNumOfDefinedNetworks (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of inactive networks.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of networks found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfDefinedStoragePools"
id="virConnectNumOfDefinedStoragePools"><code>virConnectNumOfDefinedStoragePools</code></a></h3><pre
class="programlisting">int virConnectNumOfDefinedStoragePools (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of inactive storage pools</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of pools found, or -1 on
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfDomains"
id="virConnectNumOfDomains"><code>virConnectNumOfDomains</code></a></h3><pre
class="programlisting">int virConnectNumOfDomains (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of active domains.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of domain found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfNetworks"
id="virConnectNumOfNetworks"><code>virConnectNumOfNetworks</code></a></h3><pre
class="programlisting">int virConnectNumOfNetworks (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of active networks.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of network found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virConnectNumOfStoragePools"
id="virConnectNumOfStoragePools"><code>virConnectNumOfStoragePools</code></a></h3><pre
class="programlisting">int virConnectNumOfStoragePools (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Provides the number of active storage pools</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of pools found, or -1 on
error</td></tr></tbody></table></div><h3><a
name="virConnectOpen"
id="virConnectOpen"><code>virConnectOpen</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpen (const
char * name)<br />
+</pre><p>This function should be called first to get a connection to the
Hypervisor and xen store</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>URI
of the hypervisor</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the hypervisor connection or NULL in case of error URIs are documented at
http://libvirt.org/uri.html</td></tr></tbody></table...
name="virConnectOpenAuth"
id="virConnectOpenAuth"><code>virConnectOpenAuth</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpenAuth (const
char * name, <br /> <a
href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a>
auth, <br /> int flags)<br />
+</pre><p>This function should be called first to get a connection to the
Hypervisor. If necessary, authentication will be performed fetching credentials via the
callback</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>URI
of the hypervisor</td></tr><tr><td><span
class="term"><i><tt>auth</tt></i>:</span></td><td>Authenticate
callback parameters</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>Open
flags</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the hypervisor connection or NULL in case of error URIs are documented at
http://libvirt.org/uri.html</td></tr></tbody></table...
name="virConnectOpenReadOnly"
id="virConnectOpenReadOnly"><code>virConnectOpenReadOnly</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpenReadOnly (const
char * name)<br />
+</pre><p>This function should be called first to get a restricted connection
to the library functionalities. The set of APIs usable are then restricted on the
available methods to control the domains.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>URI
of the hypervisor</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the hypervisor connection or NULL in case of error URIs are documented at
http://libvirt.org/uri.html</td></tr></tbody></table...
name="virConnectRef"
id="virConnectRef"><code>virConnectRef</code></a></h3><pre
class="programlisting">int virConnectRef (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>Increment the reference count on the connection. For each additional
call to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a connection would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>the
connection to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure</td></tr></tbody></table></div><h3><a
name="virDomainAttachDevice"
id="virDomainAttachDevice"><code>virDomainAttachDevice</code></a></h3><pre
class="programlisting">int virDomainAttachDevice (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * xml)<br />
+</pre><p>Create a virtual device attachment to backend.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>xml</tt></i>:</span></td><td>pointer
to XML description of one device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainBlockPeek"
id="virDomainBlockPeek"><code>virDomainBlockPeek</code></a></h3><pre
class="programlisting">int virDomainBlockPeek (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> unsigned long long offset, <br
/> size_t size, <br /> void * buffer, <br /> unsigned int
flags)<br />
+</pre><p>This function allows you to read the contents of a domain's disk
device. Typical uses for this are to determine if the domain has written a Master Boot
Record (indicating that the domain has completed installation), or to try to work out the
state of the domain's filesystems. (Note that in the local case you might try to open
the block device or file directly, but that won't work in the remote case, nor if you
don't have sufficient permission. Hence the need for this call). 'path' must
be a device or file corresponding to the domain. In other words it must be the precise
string returned in a <disk><source
dev='...'/></disk> from virDomainGetXMLDesc. 'offset'
and 'size' represent an area which must lie entirely within the device or file.
'size' may be 0 to test if the call would succeed. 'buffer' is the return
buffer and must be at least 'size' bytes. NB. The remote driver imposes a 64K byte
limit on 'size'. For your program to be able to work reliably over a remote
connection you should split large requests to <= 65536 bytes.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>pointer
to the domain object</td></tr><tr><td><span
class="term"><i><tt>path</tt></i>:</span></td><td>path
to the block device</td></tr><tr><td><span
class="term"><i><tt>offset</tt></i>:</span></td><td>offset
within block device</td></tr><tr><td><span
class="term"><i><tt>size</tt></i>:</span></td><td>size
to read</td></tr><tr><td><span
class="term"><i><tt>buffer</tt></i>:</span></td><td>return
buffer (must be at least size bytes)</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>unused,
always pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of failure. really 64
bits</td></tr></tbody></table></div><h3><a
name="virDomainBlockStats"
id="virDomainBlockStats"><code>virDomainBlockStats</code></a></h3><pre
class="programlisting">int virDomainBlockStats (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> <a
href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a>
stats, <br /> size_t size)<br />
+</pre><p>This function returns block device (disk) stats for block devices
attached to the domain. The path parameter is the name of the block device. Get this by
calling <a
href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>
and finding the <target dev='...'> attribute within
//domain/devices/disk. (For example, "xvda"). Domains may have more than one
block device. To get stats for each you should make multiple calls to this function.
Individual fields within the stats structure may be returned as -1, which indicates that
the hypervisor does not support that particular statistic.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>pointer
to the domain object</td></tr><tr><td><span
class="term"><i><tt>path</tt></i>:</span></td><td>path
to the block device</td></tr><tr><td><span
class="term"><i><tt>stats</tt></i>:</span></td><td>block
device stats (returned)</td></tr><tr><td><span
class="term"><i><tt>size</tt></i>:</span></td><td>size
of stats structure</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainCoreDump"
id="virDomainCoreDump"><code>virDomainCoreDump</code></a></h3><pre
class="programlisting">int virDomainCoreDump (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * to, <br /> int flags)<br />
+</pre><p>This method will dump the core of a domain on a given file for
analysis. Note that for remote Xen Daemon the file path will be interpreted in the remote
host.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>to</tt></i>:</span></td><td>path
for the core file</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>extra
flags, currently unused</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainCreate"
id="virDomainCreate"><code>virDomainCreate</code></a></h3><pre
class="programlisting">int virDomainCreate (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>launch a defined domain. If the call succeed the domain moves from
the defined to the running domains pools.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to a defined domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virDomainCreateLinux"
id="virDomainCreateLinux"><code>virDomainCreateLinux</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainCreateLinux (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)<br />
+</pre><p>Deprecated after 0.4.6. Renamed to virDomainCreateXML() providing
identical functionality. This existing name will left indefinitely for API
compatability.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string
containing an XML description of the
domain</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>callers
should always pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of
failure</td></tr></tbody></table></div><h3><a
name="virDomainCreateXML"
id="virDomainCreateXML"><code>virDomainCreateXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainCreateXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)<br />
+</pre><p>Launch a new guest domain, based on an XML description similar to
the one returned by virDomainGetXMLDesc() This function may requires privileged access to
the hypervisor. The domain is not persistent, so its definition will disappear when it is
destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent
domains).</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string
containing an XML description of the
domain</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>callers
should always pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of
failure</td></tr></tbody></table></div><h3><a
name="virDomainDefineXML"
id="virDomainDefineXML"><code>virDomainDefineXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainDefineXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml)<br />
+</pre><p>Define a domain, but does not start it. This definition is
persistent, until explicitly undefined with virDomainUndefine(). A previous definition for
this domain would be overriden if it already exists.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xml</tt></i>:</span></td><td>the
XML description for the domain, preferably in
UTF-8</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error, a pointer to the domain
otherwise</td></tr></tbody></table></div><h3><a
name="virDomainDestroy"
id="virDomainDestroy"><code>virDomainDestroy</code></a></h3><pre
class="programlisting">int virDomainDestroy (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Destroy the domain object. The running instance is shutdown if not
down already and all resources used by it are given back to the hypervisor. This does not
free the associated <a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object. This
function may require privileged access</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainDetachDevice"
id="virDomainDetachDevice"><code>virDomainDetachDevice</code></a></h3><pre
class="programlisting">int virDomainDetachDevice (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * xml)<br />
+</pre><p>Destroy a virtual device attachment to backend.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>xml</tt></i>:</span></td><td>pointer
to XML description of one device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainFree"
id="virDomainFree"><code>virDomainFree</code></a></h3><pre
class="programlisting">int virDomainFree (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Free the domain object. The running instance is kept alive. The data
structure is freed and should not be used thereafter.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainGetAutostart"
id="virDomainGetAutostart"><code>virDomainGetAutostart</code></a></h3><pre
class="programlisting">int virDomainGetAutostart (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int * autostart)<br />
+</pre><p>Provides a boolean value indicating whether the domain configured to
be automatically started when the host machine boots.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>the
value returned</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virDomainGetConnect"
id="virDomainGetConnect"><code>virDomainGetConnect</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virDomainGetConnect (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br
/>
+</pre><p>Provides the connection pointer associated with a domain. The
reference counter on the connection is not increased by this call. WARNING: When writing
libvirt bindings in other languages, do not use this function. Instead, store the
connection and the domain object together.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>pointer
to a domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or
NULL in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainGetID"
id="virDomainGetID"><code>virDomainGetID</code></a></h3><pre
class="programlisting">unsigned int virDomainGetID (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Get the hypervisor ID number for the domain</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
domain ID number or (unsigned int) -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virDomainGetInfo"
id="virDomainGetInfo"><code>virDomainGetInfo</code></a></h3><pre
class="programlisting">int virDomainGetInfo (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virDomainInfoPtr">virDomainInfoPtr</a>
info)<br />
+</pre><p>Extract information about a domain. Note that if the connection used
to get the domain is limited only a partial set of the information can be
extracted.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>info</tt></i>:</span></td><td>pointer
to a <a href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a>
structure allocated by the user</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainGetMaxMemory"
id="virDomainGetMaxMemory"><code>virDomainGetMaxMemory</code></a></h3><pre
class="programlisting">unsigned long virDomainGetMaxMemory (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Retrieve the maximum amount of physical memory allocated to a
domain. If domain is NULL, then this get the amount of memory reserved to Domain0 i.e. the
domain where the application runs.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object or NULL</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
memory size in kilobytes or 0 in case of
error.</td></tr></tbody></table></div><h3><a
name="virDomainGetMaxVcpus"
id="virDomainGetMaxVcpus"><code>virDomainGetMaxVcpus</code></a></h3><pre
class="programlisting">int virDomainGetMaxVcpus (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Provides the maximum number of virtual CPUs supported for the guest
VM. If the guest is inactive, this is basically the same as virConnectGetMaxVcpus. If the
guest is running this will reflect the maximum number of virtual CPUs the guest was booted
with.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
maximum of virtual CPU or -1 in case of
error.</td></tr></tbody></table></div><h3><a
name="virDomainGetName"
id="virDomainGetName"><code>virDomainGetName</code></a></h3><pre
class="programlisting">const char * virDomainGetName (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Get the public name for that domain</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the name or NULL, the string need not be deallocated its lifetime will be the
same as the domain
object.</td></tr></tbody></table></div><h3><a
name="virDomainGetOSType"
id="virDomainGetOSType"><code>virDomainGetOSType</code></a></h3><pre
class="programlisting">char * virDomainGetOSType (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Get the type of domain operation system.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
new string or NULL in case of error, the string must be freed by the
caller.</td></tr></tbody></table></div><h3><a
name="virDomainGetSchedulerParameters"
id="virDomainGetSchedulerParameters"><code>virDomainGetSchedulerParameters</code></a></h3><pre
class="programlisting">int virDomainGetSchedulerParameters (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a>
params, <br /> int * nparams)<br />
+</pre><p>Get the scheduler parameters, the @params array will be filled with
the values.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>params</tt></i>:</span></td><td>pointer
to scheduler parameter object (return
value)</td></tr><tr><td><span
class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer
to number of scheduler parameter (this value should be same than the returned value
nparams of virDomainGetSchedulerType)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success.</td></tr></tbody></table></div><h3><a
name="virDomainGetSchedulerType"
id="virDomainGetSchedulerType"><code>virDomainGetSchedulerType</code></a></h3><pre
class="programlisting">char * virDomainGetSchedulerType (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int * nparams)<br />
+</pre><p>Get the scheduler type.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>nparams</tt></i>:</span></td><td>number
of scheduler parameters(return value)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error. The caller must free the returned
string.</td></tr></tbody></table></div><h3><a
name="virDomainGetSecurityLabel"
id="virDomainGetSecurityLabel"><code>virDomainGetSecurityLabel</code></a></h3><pre
class="programlisting">int virDomainGetSecurityLabel (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSecurityLabelPtr">virSecurityLabelPtr</a>
seclabel)<br />
+</pre><p>Extract security label of an active domain.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>seclabel</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a>
structure</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of failure, and -2 if the operation is not supported
(caller decides if that's an
error).</td></tr></tbody></table></div><h3><a
name="virDomainGetUUID"
id="virDomainGetUUID"><code>virDomainGetUUID</code></a></h3><pre
class="programlisting">int virDomainGetUUID (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned char * uuid)<br />
+</pre><p>Get the UUID for a domain</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes
array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virDomainGetUUIDString"
id="virDomainGetUUIDString"><code>virDomainGetUUIDString</code></a></h3><pre
class="programlisting">int virDomainGetUUIDString (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> char * buf)<br />
+</pre><p>Get the UUID for a domain as string. For more information about UUID
see RFC4122.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>buf</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a>
bytes array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virDomainGetVcpus"
id="virDomainGetVcpus"><code>virDomainGetVcpus</code></a></h3><pre
class="programlisting">int virDomainGetVcpus (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virVcpuInfoPtr">virVcpuInfoPtr</a> info,
<br /> int maxinfo, <br /> unsigned char * cpumaps, <br
/> int maplen)<br />
+</pre><p>Extract information about virtual CPUs of domain, store it in info
array and also in cpumaps if this pointer isn't NULL.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object, or NULL for Domain0</td></tr><tr><td><span
class="term"><i><tt>info</tt></i>:</span></td><td>pointer
to an array of <a
href="libvirt-libvirt.html#virVcpuInfo">virVcpuInfo</a> structures
(OUT)</td></tr><tr><td><span
class="term"><i><tt>maxinfo</tt></i>:</span></td><td>number
of structures in info array</td></tr><tr><td><span
class="term"><i><tt>cpumaps</tt></i>:</span></td><td>pointer
to an bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) If cpumaps
is NULL, then no cpumap information is returned by the API. It's assumed there is
<maxinfo> cpumap in cpumaps array. The memory allocated to cpumaps must be
(maxinfo * maplen) bytes (ie: calloc(maxinfo, maplen)). One cpumap inside cpumaps has the
format described in virDomainPinVcpu()
API.</td></tr><tr><td><span
class="term"><i><tt>maplen</tt></i>:</span></td><td>number
of bytes in one cpumap, from 1 up to size of CPU map in underlying virtualization system
(Xen...).</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of info filled in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainGetXMLDesc"
id="virDomainGetXMLDesc"><code>virDomainGetXMLDesc</code></a></h3><pre
class="programlisting">char * virDomainGetXMLDesc (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int flags)<br />
+</pre><p>Provide an XML description of the domain. The description may be
reused later to relaunch the domain with virDomainCreateXML().</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>an
OR'ed set of <a
href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free()
the returned
value.</td></tr></tbody></table></div><h3><a
name="virDomainInterfaceStats"
id="virDomainInterfaceStats"><code>virDomainInterfaceStats</code></a></h3><pre
class="programlisting">int virDomainInterfaceStats (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> const char * path, <br /> <a
href="libvirt-libvirt.html#virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a>
stats, <br /> size_t size)<br />
+</pre><p>This function returns network interface stats for interfaces
attached to the domain. The path parameter is the name of the network interface. Domains
may have more than network interface. To get stats for each you should make multiple calls
to this function. Individual fields within the stats structure may be returned as -1,
which indicates that the hypervisor does not support that particular
statistic.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>pointer
to the domain object</td></tr><tr><td><span
class="term"><i><tt>path</tt></i>:</span></td><td>path
to the interface</td></tr><tr><td><span
class="term"><i><tt>stats</tt></i>:</span></td><td>network
interface stats (returned)</td></tr><tr><td><span
class="term"><i><tt>size</tt></i>:</span></td><td>size
of stats structure</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainLookupByID"
id="virDomainLookupByID"><code>virDomainLookupByID</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainLookupByID (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> int id)<br />
+</pre><p>Try to find a domain based on the hypervisor ID number Note that
this won't work for inactive domains which have an ID of -1, in that case a lookup
based on the Name or UUId need to be done instead.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>id</tt></i>:</span></td><td>the
domain ID number</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of failure. If the domain cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virDomainLookupByName"
id="virDomainLookupByName"><code>virDomainLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainLookupByName (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)<br />
+</pre><p>Try to lookup a domain on the given hypervisor based on its
name.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>name
for the domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of failure. If the domain cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virDomainLookupByUUID"
id="virDomainLookupByUUID"><code>virDomainLookupByUUID</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainLookupByUUID (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)<br />
+</pre><p>Try to lookup a domain on the given hypervisor based on its
UUID.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>the
raw UUID for the domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of failure. If the domain cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virDomainLookupByUUIDString"
id="virDomainLookupByUUIDString"><code>virDomainLookupByUUIDString</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainLookupByUUIDString (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)<br />
+</pre><p>Try to lookup a domain on the given hypervisor based on its
UUID.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuidstr</tt></i>:</span></td><td>the
string UUID for the domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new domain object or NULL in case of failure. If the domain cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virDomainMemoryPeek"
id="virDomainMemoryPeek"><code>virDomainMemoryPeek</code></a></h3><pre
class="programlisting">int virDomainMemoryPeek (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br
/> unsigned long long start, <br /> size_t size, <br /> void
* buffer, <br /> unsigned int flags)<br />
+</pre><p>This function allows you to read the contents of a domain's
memory. The memory which is read is controlled by the 'start', 'size' and
'flags' parameters. If 'flags' is <a
href="libvirt-libvirt.html#VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a>
then the 'start' and 'size' parameters are interpreted as virtual memory
addresses for whichever task happens to be running on the domain at the moment. Although
this sounds haphazard it is in fact what you want in order to read Linux kernel state,
because it ensures that pointers in the kernel image can be interpreted coherently.
'buffer' is the return buffer and must be at least 'size' bytes.
'size' may be 0 to test if the call would succeed. NB. The remote driver imposes a
64K byte limit on 'size'. For your program to be able to work reliably over a
remote connection you should split large requests to <= 65536
bytes.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dom</tt></i>:</span></td><td>pointer
to the domain object</td></tr><tr><td><span
class="term"><i><tt>start</tt></i>:</span></td><td>start
of memory to peek</td></tr><tr><td><span
class="term"><i><tt>size</tt></i>:</span></td><td>size
of memory to peek</td></tr><tr><td><span
class="term"><i><tt>buffer</tt></i>:</span></td><td>return
buffer (must be at least size bytes)</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags,
see below</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success or -1 in case of failure. really 64
bits</td></tr></tbody></table></div><h3><a
name="virDomainMigrate"
id="virDomainMigrate"><code>virDomainMigrate</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainMigrate (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn,
<br /> unsigned long flags, <br /> const char * dname, <br
/> const char * uri, <br /> unsigned long bandwidth)<br />
+</pre><p>Migrate the domain object from its current host to the destination
host given by dconn (a connection to the destination host). Flags may be one of more of
the following: <a
href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a>
Attempt a live migration. If a hypervisor supports renaming domains during migration, then
you may set the dname parameter to the new name (otherwise it keeps the same name). If
this is not supported by the hypervisor, dname must be NULL or else you will get an error.
Since typically the two hypervisors connect directly to each other in order to perform the
migration, you may need to specify a path from the source to the destination. This is the
purpose of the uri parameter. If uri is NULL, then libvirt will try to find the best
method. Uri may specify the hostname or IP address of the destination host as seen from
the source. Or uri may be a URI giving transport, hostname, user, port, etc. in the usual
form. Refer to driver documentation for the particular URIs supported. The maximum
bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth
parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not
support this feature and will return an error if bandwidth is not 0. To see which features
are supported by the current hypervisor, see virConnectGetCapabilities,
/capabilities/host/migration_features. There are many limitations on migration imposed by
the underlying technology - for example it may not be possible to migrate between
different processors even with the same architecture, or between different types of
hypervisor.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>dconn</tt></i>:</span></td><td>destination
host (a connection object)</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span
class="term"><i><tt>dname</tt></i>:</span></td><td>(optional)
rename domain to this at destination</td></tr><tr><td><span
class="term"><i><tt>uri</tt></i>:</span></td><td>(optional)
dest hostname/URI as seen from the source
host</td></tr><tr><td><span
class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional)
specify migration bandwidth limit in
Mbps</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
new domain object if the migration was successful, or NULL in case of error. Note that the
new domain object exists in the scope of the destination connection
(dconn).</td></tr></tbody></table></div><h3><a
name="virDomainPinVcpu"
id="virDomainPinVcpu"><code>virDomainPinVcpu</code></a></h3><pre
class="programlisting">int virDomainPinVcpu (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int vcpu, <br /> unsigned char * cpumap, <br
/> int maplen)<br />
+</pre><p>Dynamically change the real CPUs which can be allocated to a virtual
CPU. This function requires privileged access to the hypervisor.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object, or NULL for Domain0</td></tr><tr><td><span
class="term"><i><tt>vcpu</tt></i>:</span></td><td>virtual
CPU number</td></tr><tr><td><span
class="term"><i><tt>cpumap</tt></i>:</span></td><td>pointer
to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding
CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte,
lowest CPU number is least significant
bit.</td></tr><tr><td><span
class="term"><i><tt>maplen</tt></i>:</span></td><td>number
of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system
(Xen...). If maplen < size, missing bytes are set to zero. If maplen > size,
failure code is returned.</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainReboot"
id="virDomainReboot"><code>virDomainReboot</code></a></h3><pre
class="programlisting">int virDomainReboot (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int flags)<br />
+</pre><p>Reboot a domain, the domain object is still usable there after but
the domain OS is being stopped for a restart. Note that the guest OS may ignore the
request.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>extra
flags for the reboot operation, not used
yet</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainRef"
id="virDomainRef"><code>virDomainRef</code></a></h3><pre
class="programlisting">int virDomainRef (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Increment the reference count on the domain. For each additional
call to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virDomainFree">virDomainFree</a> to release
the reference count, once the caller no longer needs the reference to this object. This
method is typically useful for applications where multiple threads are using a connection,
and it is required that the connection remain open until all threads have finished using
it. ie, each new thread using a domain would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>the
domain to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainRestore"
id="virDomainRestore"><code>virDomainRestore</code></a></h3><pre
class="programlisting">int virDomainRestore (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * from)<br />
+</pre><p>This method will restore a domain saved to disk by
virDomainSave().</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>from</tt></i>:</span></td><td>path
to the</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainResume"
id="virDomainResume"><code>virDomainResume</code></a></h3><pre
class="programlisting">int virDomainResume (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Resume an suspended domain, the process is restarted from the state
where it was frozen by calling virSuspendDomain(). This function may requires privileged
access</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainSave"
id="virDomainSave"><code>virDomainSave</code></a></h3><pre
class="programlisting">int virDomainSave (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> const char * to)<br />
+</pre><p>This method will suspend a domain and save its memory contents to a
file on disk. After the call, if successful, the domain is not listed as running anymore
(this may be a problem). Use virDomainRestore() to restore a domain after
saving.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>to</tt></i>:</span></td><td>path
for the output file</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainSetAutostart"
id="virDomainSetAutostart"><code>virDomainSetAutostart</code></a></h3><pre
class="programlisting">int virDomainSetAutostart (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> int autostart)<br />
+</pre><p>Configure the domain to be automatically started when the host
machine boots.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>whether
the domain should be automatically started 0 or
1</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virDomainSetMaxMemory"
id="virDomainSetMaxMemory"><code>virDomainSetMaxMemory</code></a></h3><pre
class="programlisting">int virDomainSetMaxMemory (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned long memory)<br />
+</pre><p>Dynamically change the maximum amount of physical memory allocated
to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0
i.e. the domain where the application runs. This function requires privileged access to
the hypervisor.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object or NULL</td></tr><tr><td><span
class="term"><i><tt>memory</tt></i>:</span></td><td>the
memory size in kilobytes</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainSetMemory"
id="virDomainSetMemory"><code>virDomainSetMemory</code></a></h3><pre
class="programlisting">int virDomainSetMemory (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned long memory)<br />
+</pre><p>Dynamically change the target amount of physical memory allocated to
a domain. If domain is NULL, then this change the amount of memory reserved to Domain0
i.e. the domain where the application runs. This function may requires privileged access
to the hypervisor.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object or NULL</td></tr><tr><td><span
class="term"><i><tt>memory</tt></i>:</span></td><td>the
memory size in kilobytes</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainSetSchedulerParameters"
id="virDomainSetSchedulerParameters"><code>virDomainSetSchedulerParameters</code></a></h3><pre
class="programlisting">int virDomainSetSchedulerParameters (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> <a
href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a>
params, <br /> int nparams)<br />
+</pre><p>Change the scheduler parameters</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object</td></tr><tr><td><span
class="term"><i><tt>params</tt></i>:</span></td><td>pointer
to scheduler parameter objects</td></tr><tr><td><span
class="term"><i><tt>nparams</tt></i>:</span></td><td>number
of scheduler parameter (this value should be same or less than the returned value nparams
of virDomainGetSchedulerType)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success.</td></tr></tbody></table></div><h3><a
name="virDomainSetVcpus"
id="virDomainSetVcpus"><code>virDomainSetVcpus</code></a></h3><pre
class="programlisting">int virDomainSetVcpus (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain,
<br /> unsigned int nvcpus)<br />
+</pre><p>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.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to domain object, or NULL for Domain0</td></tr><tr><td><span
class="term"><i><tt>nvcpus</tt></i>:</span></td><td>the
new number of virtual CPUs for this
domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainShutdown"
id="virDomainShutdown"><code>virDomainShutdown</code></a></h3><pre
class="programlisting">int virDomainShutdown (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>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
?</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainSuspend"
id="virDomainSuspend"><code>virDomainSuspend</code></a></h3><pre
class="programlisting">int virDomainSuspend (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>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.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>a
domain object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virDomainUndefine"
id="virDomainUndefine"><code>virDomainUndefine</code></a></h3><pre
class="programlisting">int virDomainUndefine (<a
href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br
/>
+</pre><p>Undefine a domain but does not stop it if it is
running</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>domain</tt></i>:</span></td><td>pointer
to a defined domain</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virEventAddHandleFunc"
id="virEventAddHandleFunc"><code>virEventAddHandleFunc</code></a></h3><pre
class="programlisting">typedef int (*virEventAddHandleFunc ) (int fd, <br
/> int event, <br /> <a
href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
+</pre><p>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.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>fd</tt></i>:</span></td><td>file
descriptor to listen on</td></tr><tr><td><span
class="term"><i><tt>event</tt></i>:</span></td><td>bitset
of events on which to fire the callback</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>the
callback to be called when an event
occurrs</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>user
data to pass to the callback</td></tr><tr><td><span
class="term"><i><tt>ff</tt></i>:</span></td><td>the
callback invoked to free opaque data
blob</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
handle watch number to be used for updating and unregistering for
events</td></tr></tbody></table></div><br
/><h3><a name="virEventAddTimeoutFunc"
id="virEventAddTimeoutFunc"><code>virEventAddTimeoutFunc</code></a></h3><pre
class="programlisting">typedef int (*virEventAddTimeoutFunc ) (int timeout,
<br /> <a
href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a>
cb, <br /> void * opaque, <br /> <a
href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>timeout</tt></i>:</span></td><td>The
timeout to monitor</td></tr><tr><td><span
class="term"><i><tt>cb</tt></i>:</span></td><td>the
callback to call when timeout has
expired</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>user
data to pass to the callback</td></tr><tr><td><span
class="term"><i><tt>ff</tt></i>:</span></td><td>the
callback invoked to free opaque data
blob</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
timer value</td></tr></tbody></table></div><br
/><h3><a name="virEventHandleCallback"
id="virEventHandleCallback"><code>virEventHandleCallback</code></a></h3><pre
class="programlisting">typedef void (*virEventHandleCallback ) (int watch,
<br /> int fd, <br /> int events, <br /> void * opaque)
+</pre><p>Callback for receiving file handle events. The callback will be
invoked once for each event which is pending.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>watch</tt></i>:</span></td><td>watch
on which the event occurred</td></tr><tr><td><span
class="term"><i><tt>fd</tt></i>:</span></td><td>file
handle on which the event occurred</td></tr><tr><td><span
class="term"><i><tt>events</tt></i>:</span></td><td>bitset
of events from <a
href="libvirt-libvirt.html#virEventHandleType">virEventHandleType</a>
constants</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>user
data registered with
handle</td></tr></tbody></table></div><br
/><h3><a name="virEventRegisterImpl"
id="virEventRegisterImpl"><code>virEventRegisterImpl</code></a></h3><pre
class="programlisting">void virEventRegisterImpl (<a
href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a>
addHandle, <br /> <a
href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a>
updateHandle, <br /> <a
href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a>
removeHandle, <br /> <a
href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a>
addTimeout, <br /> <a
href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a>
updateTimeout, <br /> <a
href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a>
removeTimeout)<br />
+</pre><p></p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>addHandle</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>updateHandle</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>removeHandle</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>addTimeout</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>updateTimeout</tt></i>:</span></td><td></td></tr><tr><td><span
class="term"><i><tt>removeTimeout</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a
name="virEventRemoveHandleFunc"
id="virEventRemoveHandleFunc"><code>virEventRemoveHandleFunc</code></a></h3><pre
class="programlisting">typedef int (*virEventRemoveHandleFunc) (int watch)
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>watch</tt></i>:</span></td><td>file
descriptor watch to stop listening on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br
/><h3><a name="virEventRemoveTimeoutFunc"
id="virEventRemoveTimeoutFunc"><code>virEventRemoveTimeoutFunc</code></a></h3><pre
class="programlisting">typedef int (*virEventRemoveTimeoutFunc) (int timer)
+</pre><p>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.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>timer</tt></i>:</span></td><td>the
timer to remove</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
failure</td></tr></tbody></table></div><br
/><h3><a name="virEventTimeoutCallback"
id="virEventTimeoutCallback"><code>virEventTimeoutCallback</code></a></h3><pre
class="programlisting">typedef void (*virEventTimeoutCallback ) (int timer,
<br /> void * opaque)
+</pre><p>callback for receiving timer events</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>timer</tt></i>:</span></td><td>timer
id emitting the event</td></tr><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td>user
data registered with
handle</td></tr></tbody></table></div><br
/><h3><a name="virEventUpdateHandleFunc"
id="virEventUpdateHandleFunc"><code>virEventUpdateHandleFunc</code></a></h3><pre
class="programlisting">typedef void (*virEventUpdateHandleFunc) (int watch,
<br /> int event)
+</pre><p>Part of the EventImpl, this user-provided callback is notified when
events to listen on change</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>watch</tt></i>:</span></td><td>file
descriptor watch to modify</td></tr><tr><td><span
class="term"><i><tt>event</tt></i>:</span></td><td>new
events to listen on</td></tr></tbody></table></div><br
/><h3><a name="virEventUpdateTimeoutFunc"
id="virEventUpdateTimeoutFunc"><code>virEventUpdateTimeoutFunc</code></a></h3><pre
class="programlisting">typedef void (*virEventUpdateTimeoutFunc) (int timer,
<br /> int timeout)
+</pre><p>Part of the EventImpl, this user-defined callback updates an event
timeout.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>timer</tt></i>:</span></td><td>the
timer to modify</td></tr><tr><td><span
class="term"><i><tt>timeout</tt></i>:</span></td><td>the
new timeout value</td></tr></tbody></table></div><br
/><h3><a name="virFreeCallback"
id="virFreeCallback"><code>virFreeCallback</code></a></h3><pre
class="programlisting">typedef void (*virFreeCallback ) (void * opaque)
+</pre><p></p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>opaque</tt></i>:</span></td><td></td></tr></tbody></table></div><br
/><h3><a name="virGetVersion"
id="virGetVersion"><code>virGetVersion</code></a></h3><pre
class="programlisting">int virGetVersion (unsigned long * libVer, <br
/> const char * type, <br /> unsigned long * typeVer)<br />
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>libVer</tt></i>:</span></td><td>return
value for the library version (OUT)</td></tr><tr><td><span
class="term"><i><tt>type</tt></i>:</span></td><td>the
type of connection/driver looked at</td></tr><tr><td><span
class="term"><i><tt>typeVer</tt></i>:</span></td><td>return
value for the version of the hypervisor
(OUT)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major
* 1,000,000 + minor * 1,000 +
release.</td></tr></tbody></table></div><h3><a
name="virInitialize"
id="virInitialize"><code>virInitialize</code></a></h3><pre
class="programlisting">int virInitialize (void)<br />
+</pre><p>Initialize the library. It's better to call this routine at
startup in multithreaded applications to avoid potential race when initializing the
library.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virNetworkCreate"
id="virNetworkCreate"><code>virNetworkCreate</code></a></h3><pre
class="programlisting">int virNetworkCreate (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Create and start a defined network. If the call succeed the network
moves from the defined to the running networks pools.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>pointer
to a defined network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virNetworkCreateXML"
id="virNetworkCreateXML"><code>virNetworkCreateXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkCreateXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc)<br />
+</pre><p>Create and start a new virtual network, based on an XML description
similar to the one returned by virNetworkGetXMLDesc()</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>an
XML description of the network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new network object or NULL in case of
failure</td></tr></tbody></table></div><h3><a
name="virNetworkDefineXML"
id="virNetworkDefineXML"><code>virNetworkDefineXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkDefineXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml)<br />
+</pre><p>Define a network, but does not create it</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xml</tt></i>:</span></td><td>the
XML description for the network, preferably in
UTF-8</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL
in case of error, a pointer to the network
otherwise</td></tr></tbody></table></div><h3><a
name="virNetworkDestroy"
id="virNetworkDestroy"><code>virNetworkDestroy</code></a></h3><pre
class="programlisting">int virNetworkDestroy (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Destroy the network object. The running instance is shutdown if not
down already and all resources used by it are given back to the hypervisor. This does not
free the associated <a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> object.
This function may require privileged access</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNetworkFree"
id="virNetworkFree"><code>virNetworkFree</code></a></h3><pre
class="programlisting">int virNetworkFree (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Free the network object. The running instance is kept alive. The
data structure is freed and should not be used thereafter.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNetworkGetAutostart"
id="virNetworkGetAutostart"><code>virNetworkGetAutostart</code></a></h3><pre
class="programlisting">int virNetworkGetAutostart (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int * autostart)<br />
+</pre><p>Provides a boolean value indicating whether the network configured
to be automatically started when the host machine boots.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>the
value returned</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virNetworkGetBridgeName"
id="virNetworkGetBridgeName"><code>virNetworkGetBridgeName</code></a></h3><pre
class="programlisting">char * virNetworkGetBridgeName (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Provides a bridge interface name to which a domain may connect a
network interface in order to join the network.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated interface name, or NULL in case of error. the caller must free() the returned
value.</td></tr></tbody></table></div><h3><a
name="virNetworkGetConnect"
id="virNetworkGetConnect"><code>virNetworkGetConnect</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virNetworkGetConnect (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net)<br
/>
+</pre><p>Provides the connection pointer associated with a network. The
reference counter on the connection is not increased by this call. WARNING: When writing
libvirt bindings in other languages, do not use this function. Instead, store the
connection and the network object together.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>net</tt></i>:</span></td><td>pointer
to a network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or
NULL in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNetworkGetName"
id="virNetworkGetName"><code>virNetworkGetName</code></a></h3><pre
class="programlisting">const char * virNetworkGetName (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Get the public name for that network</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
pointer to the name or NULL, the string need not be deallocated its lifetime will be the
same as the network
object.</td></tr></tbody></table></div><h3><a
name="virNetworkGetUUID"
id="virNetworkGetUUID"><code>virNetworkGetUUID</code></a></h3><pre
class="programlisting">int virNetworkGetUUID (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> unsigned char * uuid)<br />
+</pre><p>Get the UUID for a network</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes
array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virNetworkGetUUIDString"
id="virNetworkGetUUIDString"><code>virNetworkGetUUIDString</code></a></h3><pre
class="programlisting">int virNetworkGetUUIDString (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> char * buf)<br />
+</pre><p>Get the UUID for a network as string. For more information about
UUID see RFC4122.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>buf</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a>
bytes array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virNetworkGetXMLDesc"
id="virNetworkGetXMLDesc"><code>virNetworkGetXMLDesc</code></a></h3><pre
class="programlisting">char * virNetworkGetXMLDesc (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int flags)<br />
+</pre><p>Provide an XML description of the network. The description may be
reused later to relaunch the network with virNetworkCreateXML().</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>and
OR'ed set of extraction flags, not used
yet</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free()
the returned
value.</td></tr></tbody></table></div><h3><a
name="virNetworkLookupByName"
id="virNetworkLookupByName"><code>virNetworkLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByName (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)<br />
+</pre><p>Try to lookup a network on the given hypervisor based on its
name.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>name
for the network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new network object or NULL in case of failure. If the network cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virNetworkLookupByUUID"
id="virNetworkLookupByUUID"><code>virNetworkLookupByUUID</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByUUID (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)<br />
+</pre><p>Try to lookup a network on the given hypervisor based on its
UUID.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>the
raw UUID for the network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new network object or NULL in case of failure. If the network cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virNetworkLookupByUUIDString"
id="virNetworkLookupByUUIDString"><code>virNetworkLookupByUUIDString</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByUUIDString (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)<br />
+</pre><p>Try to lookup a network on the given hypervisor based on its
UUID.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuidstr</tt></i>:</span></td><td>the
string UUID for the network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
new network object or NULL in case of failure. If the network cannot be found, then <a
href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a>
error is
raised.</td></tr></tbody></table></div><h3><a
name="virNetworkRef"
id="virNetworkRef"><code>virNetworkRef</code></a></h3><pre
class="programlisting">int virNetworkRef (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Increment the reference count on the network. For each additional
call to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virNetworkFree">virNetworkFree</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a network would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>the
network to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNetworkSetAutostart"
id="virNetworkSetAutostart"><code>virNetworkSetAutostart</code></a></h3><pre
class="programlisting">int virNetworkSetAutostart (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network,
<br /> int autostart)<br />
+</pre><p>Configure the network to be automatically started when the host
machine boots.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>a
network object</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>whether
the network should be automatically started 0 or
1</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>-1
in case of error, 0 in case of
success</td></tr></tbody></table></div><h3><a
name="virNetworkUndefine"
id="virNetworkUndefine"><code>virNetworkUndefine</code></a></h3><pre
class="programlisting">int virNetworkUndefine (<a
href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>
network)<br />
+</pre><p>Undefine a network but does not stop it if it is
running</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>network</tt></i>:</span></td><td>pointer
to a defined network</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virNodeDeviceCreateXML"
id="virNodeDeviceCreateXML"><code>virNodeDeviceCreateXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> virNodeDeviceCreateXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)<br
/>
+</pre><p>Create a new device on the VM host machine, for example, virtual
HBAs created using vport_create.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string
containing an XML description of the device to be
created</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>callers
should always pass 0</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
node device object if successful, NULL in case of
failure</td></tr></tbody></table></div><h3><a
name="virNodeDeviceDestroy"
id="virNodeDeviceDestroy"><code>virNodeDeviceDestroy</code></a></h3><pre
class="programlisting">int virNodeDeviceDestroy (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Destroy the device object. The virtual device is removed from the
host operating system. This function may require privileged access</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>a
device object</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceDettach"
id="virNodeDeviceDettach"><code>virNodeDeviceDettach</code></a></h3><pre
class="programlisting">int virNodeDeviceDettach (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Dettach the node device from the node itself so that it may be
assigned to a guest domain. Depending on the hypervisor, this may involve operations such
as unbinding any device drivers from the device, binding the device to a dummy device
driver and resetting the device. If the device is currently in use by the node, this
method may fail. Once the device is not assigned to any guest, it may be re-attached to
the node using the virNodeDeviceReattach() method.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>pointer
to the node device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceFree"
id="virNodeDeviceFree"><code>virNodeDeviceFree</code></a></h3><pre
class="programlisting">int virNodeDeviceFree (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Drops a reference to the node device, freeing it if this was the
last reference.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>pointer
to the node device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
0 for success, -1 for
error.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceGetName"
id="virNodeDeviceGetName"><code>virNodeDeviceGetName</code></a></h3><pre
class="programlisting">const char * virNodeDeviceGetName (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Just return the device name</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>the
device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
device name or NULL in case of
error</td></tr></tbody></table></div><h3><a
name="virNodeDeviceGetParent"
id="virNodeDeviceGetParent"><code>virNodeDeviceGetParent</code></a></h3><pre
class="programlisting">const char * virNodeDeviceGetParent (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Accessor for the parent of the device</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>the
device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
name of the device's parent, or NULL if the device has no
parent.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceGetXMLDesc"
id="virNodeDeviceGetXMLDesc"><code>virNodeDeviceGetXMLDesc</code></a></h3><pre
class="programlisting">char * virNodeDeviceGetXMLDesc (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev,
<br /> unsigned int flags)<br />
+</pre><p>Fetch an XML document describing all aspects of the
device.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>pointer
to the node device</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for XML generation (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
XML document, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virNodeDeviceListCaps"
id="virNodeDeviceListCaps"><code>virNodeDeviceListCaps</code></a></h3><pre
class="programlisting">int virNodeDeviceListCaps (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev,
<br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>Lists the names of the capabilities supported by the
device.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>the
device</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
to collect the list of capability names</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of @names</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of capability names listed in
@names.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceLookupByName"
id="virNodeDeviceLookupByName"><code>virNodeDeviceLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> virNodeDeviceLookupByName (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)<br />
+</pre><p>Lookup a node device by its name.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>unique
device name</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
if found, NULL
otherwise.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceNumOfCaps"
id="virNodeDeviceNumOfCaps"><code>virNodeDeviceNumOfCaps</code></a></h3><pre
class="programlisting">int virNodeDeviceNumOfCaps (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Accessor for the number of capabilities supported by the
device.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>the
device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of capabilities supported by the
device.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceReAttach"
id="virNodeDeviceReAttach"><code>virNodeDeviceReAttach</code></a></h3><pre
class="programlisting">int virNodeDeviceReAttach (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Re-attach a previously dettached node device to the node so that it
may be used by the node again. Depending on the hypervisor, this may involve operations
such as resetting the device, unbinding it from a dummy device driver and binding it to
its appropriate driver. If the device is currently in use by a guest, this method may
fail.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>pointer
to the node device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceRef"
id="virNodeDeviceRef"><code>virNodeDeviceRef</code></a></h3><pre
class="programlisting">int virNodeDeviceRef (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Increment the reference count on the dev. For each additional call
to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virNodeDeviceFree">virNodeDeviceFree</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a dev would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>the
dev to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeDeviceReset"
id="virNodeDeviceReset"><code>virNodeDeviceReset</code></a></h3><pre
class="programlisting">int virNodeDeviceReset (<a
href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>
dev)<br />
+</pre><p>Reset a previously dettached node device to the node before or after
assigning it to a guest. The exact reset semantics depends on the hypervisor and device
type but, for example, KVM will attempt to reset PCI devices with a Function Level Reset,
Secondary Bus Reset or a Power Management D-State reset. If the reset will affect other
devices which are currently in use, this function may fail.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>dev</tt></i>:</span></td><td>pointer
to the node device</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeGetCellsFreeMemory"
id="virNodeGetCellsFreeMemory"><code>virNodeGetCellsFreeMemory</code></a></h3><pre
class="programlisting">int virNodeGetCellsFreeMemory (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> unsigned long long * freeMems, <br /> int startCell, <br
/> int maxCells)<br />
+</pre><p>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.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>freeMems</tt></i>:</span></td><td>pointer
to the array of unsigned long long</td></tr><tr><td><span
class="term"><i><tt>startCell</tt></i>:</span></td><td>index
of first cell to return freeMems info
on.</td></tr><tr><td><span
class="term"><i><tt>maxCells</tt></i>:</span></td><td>Maximum
number of cells for which freeMems information can be
returned.</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of entries filled in freeMems, or -1 in case of
error.</td></tr></tbody></table></div><h3><a
name="virNodeGetFreeMemory"
id="virNodeGetFreeMemory"><code>virNodeGetFreeMemory</code></a></h3><pre
class="programlisting">unsigned long long virNodeGetFreeMemory (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br
/>
+</pre><p>provides the free memory available on the Node Note: most libvirt
APIs provide memory sizes in kilobytes, but in this function the returned value is in
bytes. Divide by 1024 as necessary.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
available free memory in bytes or 0 in case of
error</td></tr></tbody></table></div><h3><a
name="virNodeGetInfo"
id="virNodeGetInfo"><code>virNodeGetInfo</code></a></h3><pre
class="programlisting">int virNodeGetInfo (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a>
info)<br />
+</pre><p>Extract hardware information about the node.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>info</tt></i>:</span></td><td>pointer
to a <a href="libvirt-libvirt.html#virNodeInfo">virNodeInfo</a>
structure allocated by the user</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success and -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virNodeGetSecurityModel"
id="virNodeGetSecurityModel"><code>virNodeGetSecurityModel</code></a></h3><pre
class="programlisting">int virNodeGetSecurityModel (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> <a
href="libvirt-libvirt.html#virSecurityModelPtr">virSecurityModelPtr</a>
secmodel)<br />
+</pre><p>Extract the security model of a hypervisor.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>a
connection object</td></tr><tr><td><span
class="term"><i><tt>secmodel</tt></i>:</span></td><td>pointer
to a <a
href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a>
structure</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of failure, and -2 if the operation is not supported
(caller decides if that's an
error).</td></tr></tbody></table></div><h3><a
name="virNodeListDevices"
id="virNodeListDevices"><code>virNodeListDevices</code></a></h3><pre
class="programlisting">int virNodeListDevices (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * cap, <br /> char ** const names, <br
/> int maxnames, <br /> unsigned int flags)<br />
+</pre><p>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</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>cap</tt></i>:</span></td><td>capability
name</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
to collect the list of node device names</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of @names</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
(unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of node devices found or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virNodeNumOfDevices"
id="virNodeNumOfDevices"><code>virNodeNumOfDevices</code></a></h3><pre
class="programlisting">int virNodeNumOfDevices (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * cap, <br /> unsigned int flags)<br />
+</pre><p>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</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to the hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>cap</tt></i>:</span></td><td>capability
name</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
(unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of node devices or -1 in case of
error</td></tr></tbody></table></div><h3><a
name="virStoragePoolBuild"
id="virStoragePoolBuild"><code>virStoragePoolBuild</code></a></h3><pre
class="programlisting">int virStoragePoolBuild (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)<br />
+</pre><p>Build the underlying storage pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>future
flags, use 0 for now</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 upon
failure</td></tr></tbody></table></div><h3><a
name="virStoragePoolCreate"
id="virStoragePoolCreate"><code>virStoragePoolCreate</code></a></h3><pre
class="programlisting">int virStoragePoolCreate (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)<br />
+</pre><p>Starts an inactive storage pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>future
flags, use 0 for now</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 if it could not be
started</td></tr></tbody></table></div><h3><a
name="virStoragePoolCreateXML"
id="virStoragePoolCreateXML"><code>virStoragePoolCreateXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolCreateXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xmlDesc, <br /> unsigned int flags)<br
/>
+</pre><p>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</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML
description for new pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>future
flags, use 0 for now</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if creation
failed</td></tr></tbody></table></div><h3><a
name="virStoragePoolDefineXML"
id="virStoragePoolDefineXML"><code>virStoragePoolDefineXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolDefineXML (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * xml, <br /> unsigned int flags)<br />
+</pre><p>Define a new inactive storage pool based on its XML description. The
pool is persistent, until explicitly undefined.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>xml</tt></i>:</span></td><td>XML
description for new pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>future
flags, use 0 for now</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if creation
failed</td></tr></tbody></table></div><h3><a
name="virStoragePoolDelete"
id="virStoragePoolDelete"><code>virStoragePoolDelete</code></a></h3><pre
class="programlisting">int virStoragePoolDelete (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)<br />
+</pre><p>Delete the underlying pool resources. This is a non-recoverable
operation. The <a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object itself is not free'd.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for obliteration process</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 if it could not be
obliterate</td></tr></tbody></table></div><h3><a
name="virStoragePoolDestroy"
id="virStoragePoolDestroy"><code>virStoragePoolDestroy</code></a></h3><pre
class="programlisting">int virStoragePoolDestroy (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Destroy an active storage pool. This will deactivate the pool on the
host, but keep any persistent config associated with it. If it has a persistent config it
can later be restarted with virStoragePoolCreate(). This does not free the associated
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 if it could not be
destroyed</td></tr></tbody></table></div><h3><a
name="virStoragePoolFree"
id="virStoragePoolFree"><code>virStoragePoolFree</code></a></h3><pre
class="programlisting">int virStoragePoolFree (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Free a storage pool object, releasing all memory associated with it.
Does not change the state of the pool on the host.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 if it could not be
free'd.</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetAutostart"
id="virStoragePoolGetAutostart"><code>virStoragePoolGetAutostart</code></a></h3><pre
class="programlisting">int virStoragePoolGetAutostart (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> int * autostart)<br />
+</pre><p>Fetches the value of the autostart flag, which determines whether
the pool is automatically started at boot time</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>location
in which to store autostart flag</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetConnect"
id="virStoragePoolGetConnect"><code>virStoragePoolGetConnect</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virStoragePoolGetConnect (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Provides the connection pointer associated with a storage pool. The
reference counter on the connection is not increased by this call. WARNING: When writing
libvirt bindings in other languages, do not use this function. Instead, store the
connection and the pool object together.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to a pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or
NULL in case of
failure.</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetInfo"
id="virStoragePoolGetInfo"><code>virStoragePoolGetInfo</code></a></h3><pre
class="programlisting">int virStoragePoolGetInfo (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> <a
href="libvirt-libvirt.html#virStoragePoolInfoPtr">virStoragePoolInfoPtr</a>
info)<br />
+</pre><p>Get volatile information about the storage pool such as free space /
usage summary</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>info</tt></i>:</span></td><td>pointer
at which to store info</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
failure.</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetName"
id="virStoragePoolGetName"><code>virStoragePoolGetName</code></a></h3><pre
class="programlisting">const char * virStoragePoolGetName (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Fetch the locally unique name of the storage pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
name of the pool, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetUUID"
id="virStoragePoolGetUUID"><code>virStoragePoolGetUUID</code></a></h3><pre
class="programlisting">int virStoragePoolGetUUID (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned char * uuid)<br />
+</pre><p>Fetch the globally unique ID of the storage pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>buffer
of <a
href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes
in size</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
error;</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetUUIDString"
id="virStoragePoolGetUUIDString"><code>virStoragePoolGetUUIDString</code></a></h3><pre
class="programlisting">int virStoragePoolGetUUIDString (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> char * buf)<br />
+</pre><p>Fetch the globally unique ID of the storage pool as a
string</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>buf</tt></i>:</span></td><td>buffer
of <a
href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a>
bytes in size</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
error;</td></tr></tbody></table></div><h3><a
name="virStoragePoolGetXMLDesc"
id="virStoragePoolGetXMLDesc"><code>virStoragePoolGetXMLDesc</code></a></h3><pre
class="programlisting">char * virStoragePoolGetXMLDesc (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)<br />
+</pre><p>Fetch an XML document describing all aspects of the storage pool.
This is suitable for later feeding back into the <a
href="libvirt-libvirt.html#virStoragePoolCreateXML">virStoragePoolCreateXML</a>
method.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for XML format options (set of
virDomainXMLFlags)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
XML document, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStoragePoolListVolumes"
id="virStoragePoolListVolumes"><code>virStoragePoolListVolumes</code></a></h3><pre
class="programlisting">int virStoragePoolListVolumes (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> char ** const names, <br /> int maxnames)<br />
+</pre><p>Fetch list of storage volume names, limiting to at most
maxnames.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>names</tt></i>:</span></td><td>array
in which to storage volume names</td></tr><tr><td><span
class="term"><i><tt>maxnames</tt></i>:</span></td><td>size
of names array</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of names fetched, or -1 on
error</td></tr></tbody></table></div><h3><a
name="virStoragePoolLookupByName"
id="virStoragePoolLookupByName"><code>virStoragePoolLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByName (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * name)<br />
+</pre><p>Fetch a storage pool based on its unique name</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>name
of pool to fetch</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if no matching pool is
found</td></tr></tbody></table></div><h3><a
name="virStoragePoolLookupByUUID"
id="virStoragePoolLookupByUUID"><code>virStoragePoolLookupByUUID</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByUUID (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const unsigned char * uuid)<br />
+</pre><p>Fetch a storage pool based on its globally unique
id</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuid</tt></i>:</span></td><td>globally
unique id of pool to fetch</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if no matching pool is
found</td></tr></tbody></table></div><h3><a
name="virStoragePoolLookupByUUIDString"
id="virStoragePoolLookupByUUIDString"><code>virStoragePoolLookupByUUIDString</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByUUIDString (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * uuidstr)<br />
+</pre><p>Fetch a storage pool based on its globally unique
id</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>uuidstr</tt></i>:</span></td><td>globally
unique id of pool to fetch</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if no matching pool is
found</td></tr></tbody></table></div><h3><a
name="virStoragePoolLookupByVolume"
id="virStoragePoolLookupByVolume"><code>virStoragePoolLookupByVolume</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByVolume (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Fetch a storage pool which contains a particular
volume</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if no matching pool is
found</td></tr></tbody></table></div><h3><a
name="virStoragePoolNumOfVolumes"
id="virStoragePoolNumOfVolumes"><code>virStoragePoolNumOfVolumes</code></a></h3><pre
class="programlisting">int virStoragePoolNumOfVolumes (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Fetch the number of storage volumes within a pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
number of storage pools, or -1 on
failure</td></tr></tbody></table></div><h3><a
name="virStoragePoolRef"
id="virStoragePoolRef"><code>virStoragePoolRef</code></a></h3><pre
class="programlisting">int virStoragePoolRef (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Increment the reference count on the pool. For each additional call
to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virStoragePoolFree">virStoragePoolFree</a>
to release the reference count, once the caller no longer needs the reference to this
object. This method is typically useful for applications where multiple threads are using
a connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a pool would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>the
pool to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h3><a
name="virStoragePoolRefresh"
id="virStoragePoolRefresh"><code>virStoragePoolRefresh</code></a></h3><pre
class="programlisting">int virStoragePoolRefresh (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> unsigned int flags)<br />
+</pre><p>Request that the pool refresh its list of volumes. This may involve
communicating with a remote server, and/or initializing new devices at the OS
layer</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
to control refresh behaviour (currently unused, use
0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
if the volume list was refreshed, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virStoragePoolSetAutostart"
id="virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a></h3><pre
class="programlisting">int virStoragePoolSetAutostart (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> int autostart)<br />
+</pre><p>Sets the autostart flag</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>autostart</tt></i>:</span></td><td>new
flag setting</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, -1 on
failure</td></tr></tbody></table></div><h3><a
name="virStoragePoolUndefine"
id="virStoragePoolUndefine"><code>virStoragePoolUndefine</code></a></h3><pre
class="programlisting">int virStoragePoolUndefine (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool)<br />
+</pre><p>Undefine an inactive storage pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
object, or NULL if creation
failed</td></tr></tbody></table></div><h3><a
name="virStorageVolCreateXML"
id="virStorageVolCreateXML"><code>virStorageVolCreateXML</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolCreateXML (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * xmldesc, <br /> unsigned int
flags)<br />
+</pre><p>Create a storage volume within a pool based on an XML description.
Not all pools support creation of volumes</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description
of volume to create</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for creation (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
storage volume, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolCreateXMLFrom"
id="virStorageVolCreateXMLFrom"><code>virStorageVolCreateXMLFrom</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolCreateXMLFrom (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * xmldesc, <br /> <a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
clonevol, <br /> unsigned int flags)<br />
+</pre><p>Create a storage volume in the parent pool, using the
'clonevol' volume as input. Information for the new volume (name, perms) are
passed via a typical volume XML description.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to parent pool for the new volume</td></tr><tr><td><span
class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description
of volume to create</td></tr><tr><td><span
class="term"><i><tt>clonevol</tt></i>:</span></td><td>storage
volume to use as input</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for creation (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
storage volume, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolDelete"
id="virStorageVolDelete"><code>virStorageVolDelete</code></a></h3><pre
class="programlisting">int virStorageVolDelete (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> unsigned int flags)<br />
+</pre><p>Delete the storage volume from the pool</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>future
flags, use 0 for now</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolFree"
id="virStorageVolFree"><code>virStorageVolFree</code></a></h3><pre
class="programlisting">int virStorageVolFree (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Release the storage volume handle. The underlying storage volume
continues to exist.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolGetConnect"
id="virStorageVolGetConnect"><code>virStorageVolGetConnect</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virStorageVolGetConnect (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Provides the connection pointer associated with a storage volume.
The reference counter on the connection is not increased by this call. WARNING: When
writing libvirt bindings in other languages, do not use this function. Instead, store the
connection and the volume object together.</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to a pool</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or
NULL in case of
failure.</td></tr></tbody></table></div><h3><a
name="virStorageVolGetInfo"
id="virStorageVolGetInfo"><code>virStorageVolGetInfo</code></a></h3><pre
class="programlisting">int virStorageVolGetInfo (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> <a
href="libvirt-libvirt.html#virStorageVolInfoPtr">virStorageVolInfoPtr</a>
info)<br />
+</pre><p>Fetches volatile information about the storage volume such as its
current allocation</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>info</tt></i>:</span></td><td>pointer
at which to store info</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
on success, or -1 on
failure</td></tr></tbody></table></div><h3><a
name="virStorageVolGetKey"
id="virStorageVolGetKey"><code>virStorageVolGetKey</code></a></h3><pre
class="programlisting">const char * virStorageVolGetKey (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Fetch the storage volume key. This is globally unique, so the same
volume will have the same key no matter what host it is accessed from</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
volume key, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolGetName"
id="virStorageVolGetName"><code>virStorageVolGetName</code></a></h3><pre
class="programlisting">const char * virStorageVolGetName (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Fetch the storage volume name. This is unique within the scope of a
pool</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
volume name, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolGetPath"
id="virStorageVolGetPath"><code>virStorageVolGetPath</code></a></h3><pre
class="programlisting">char * virStorageVolGetPath (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Fetch the storage volume path. Depending on the pool configuration
this is either persistent across hosts, or dynamically assigned at pool startup. Consult
pool documentation for information on getting the persistent naming</p><div
class="variablelist"><table border="0"><col
align="left" /><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
storage volume path, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolGetXMLDesc"
id="virStorageVolGetXMLDesc"><code>virStorageVolGetXMLDesc</code></a></h3><pre
class="programlisting">char * virStorageVolGetXMLDesc (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol,
<br /> unsigned int flags)<br />
+</pre><p>Fetch an XML document describing all aspects of the storage
volume</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>pointer
to storage volume</td></tr><tr><td><span
class="term"><i><tt>flags</tt></i>:</span></td><td>flags
for XML generation (unused, pass 0)</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>the
XML document, or NULL on
error</td></tr></tbody></table></div><h3><a
name="virStorageVolLookupByKey"
id="virStorageVolLookupByKey"><code>virStorageVolLookupByKey</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByKey (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * key)<br />
+</pre><p>Fetch a pointer to a storage volume based on its globally unique
key</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>key</tt></i>:</span></td><td>globally
unique key</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolLookupByName"
id="virStorageVolLookupByName"><code>virStorageVolLookupByName</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByName (<a
href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>
pool, <br /> const char * name)<br />
+</pre><p>Fetch a pointer to a storage volume based on its name within a
pool</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>pool</tt></i>:</span></td><td>pointer
to storage pool</td></tr><tr><td><span
class="term"><i><tt>name</tt></i>:</span></td><td>name
of storage volume</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolLookupByPath"
id="virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a></h3><pre
class="programlisting"><a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByPath (<a
href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn,
<br /> const char * path)<br />
+</pre><p>Fetch a pointer to a storage volume based on its locally (host)
unique path</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>conn</tt></i>:</span></td><td>pointer
to hypervisor connection</td></tr><tr><td><span
class="term"><i><tt>path</tt></i>:</span></td><td>locally
unique path</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>a
storage volume, or NULL if not found /
error</td></tr></tbody></table></div><h3><a
name="virStorageVolRef"
id="virStorageVolRef"><code>virStorageVolRef</code></a></h3><pre
class="programlisting">int virStorageVolRef (<a
href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>
vol)<br />
+</pre><p>Increment the reference count on the vol. For each additional call
to this method, there shall be a corresponding call to <a
href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> to
release the reference count, once the caller no longer needs the reference to this object.
This method is typically useful for applications where multiple threads are using a
connection, and it is required that the connection remain open until all threads have
finished using it. ie, each new thread using a vol would increment the reference
count.</p><div class="variablelist"><table
border="0"><col align="left"
/><tbody><tr><td><span
class="term"><i><tt>vol</tt></i>:</span></td><td>the
vol to hold a reference on</td></tr><tr><td><span
class="term"><i><tt>Returns</tt></i>:</span></td><td>0
in case of success, -1 in case of
failure.</td></tr></tbody></table></div><h1>Reference
Manual for libvirt</h1><h2>Table of
Contents</h2><ul><li><a
href="libvirt-libvirt.html">libvirt</a>: core interfaces for the
libvirt library</li><li><a
href="libvirt-virterror.html">virterror</a>: error handling interfaces
for the libvirt library</li></ul></div></div><div
id="footer"><p id="sponsor">
Sponsored by:<br /><a
href="http://et.redhat.com/"><img
src="../et.png" alt="Project sponsored by Red Hat Emerging Technology"
/></a></p></div></body></html>
diff -r 803e91762b86 docs/libvirt-api.xml
--- a/docs/libvirt-api.xml Wed May 13 09:34:19 2009 -0400
+++ b/docs/libvirt-api.xml Wed May 13 09:41:37 2009 -0400
@@ -172,6 +172,7 @@
<exports symbol='virInitialize' type='function'/>
<exports symbol='virNodeDeviceGetName' type='function'/>
<exports symbol='virStoragePoolSetAutostart'
type='function'/>
+ <exports symbol='virConnectDomainXMLFromNative'
type='function'/>
<exports symbol='virNodeDeviceDettach' type='function'/>
<exports symbol='virDomainGetSecurityLabel' type='function'/>
<exports symbol='virConnectDomainEventDeregister'
type='function'/>
@@ -212,6 +213,7 @@
<exports symbol='virNetworkGetAutostart' type='function'/>
<exports symbol='virNetworkGetBridgeName' type='function'/>
<exports symbol='virStorageVolGetXMLDesc' type='function'/>
+ <exports symbol='virConnectDomainXMLToNative'
type='function'/>
<exports symbol='virDomainSetSchedulerParameters'
type='function'/>
<exports symbol='virConnectGetType' type='function'/>
<exports symbol='virStorageVolCreateXML' type='function'/>
@@ -371,11 +373,10 @@
<exports symbol='VIR_ERR_INVALID_CONN' type='enum'/>
<exports symbol='VIR_ERR_NONE' type='enum'/>
<exports symbol='VIR_ERR_OK' type='enum'/>
- <exports symbol='VIR_FROM_XENXM' type='enum'/>
<exports symbol='VIR_FROM_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_XML_DETAIL' type='enum'/>
<exports symbol='VIR_FROM_NET' type='enum'/>
- <exports symbol='VIR_FROM_XENSTORE' type='enum'/>
+ <exports symbol='VIR_FROM_XENXM' type='enum'/>
<exports symbol='VIR_ERR_NO_NAME' type='enum'/>
<exports symbol='VIR_ERR_NO_ROOT' type='enum'/>
<exports symbol='VIR_ERR_OPERATION_FAILED' type='enum'/>
@@ -384,6 +385,7 @@
<exports symbol='VIR_ERR_DRIVER_FULL' type='enum'/>
<exports symbol='VIR_ERR_HTTP_ERROR' type='enum'/>
<exports symbol='VIR_ERR_INVALID_NODE_DEVICE' type='enum'/>
+ <exports symbol='VIR_FROM_XENSTORE' type='enum'/>
<exports symbol='VIR_ERR_PARSE_FAILED' type='enum'/>
<exports symbol='VIR_ERR_NO_SOURCE' type='enum'/>
<exports symbol='VIR_FROM_DOMAIN' type='enum'/>
@@ -871,6 +873,22 @@ see note above'/>
<arg name='opaque' type='void *' info='opaque data to pass
on to the callback'/>
<arg name='freecb' type='virFreeCallback' info='optional
function to deallocate opaque when not used anymore'/>
</function>
+ <function name='virConnectDomainXMLFromNative' file='libvirt'
module='libvirt'>
+ <info>Reads native configuration data describing a domain, and generates
libvirt domain XML. The format of the native data is hypervisor dependant.</info>
+ <return type='char *' info='a 0 terminated UTF-8 encoded XML
instance, or NULL in case of error. the caller must free() the returned value.'/>
+ <arg name='conn' type='virConnectPtr' info='a connection
object'/>
+ <arg name='nativeFormat' type='const char *'
info='configuration format importing from'/>
+ <arg name='nativeConfig' type='const char *' info='the
configuration data to import'/>
+ <arg name='flags' type='unsigned int' info='currently
unused, pass 0'/>
+ </function>
+ <function name='virConnectDomainXMLToNative' file='libvirt'
module='libvirt'>
+ <info>Reads a domain XML configuration document, and generates generates a
native configuration file describing the domain. The format of the native data is
hypervisor dependant.</info>
+ <return type='char *' info='a 0 terminated UTF-8 encoded native
config datafile, or NULL in case of error. the caller must free() the returned
value.'/>
+ <arg name='conn' type='virConnectPtr' info='a connection
object'/>
+ <arg name='nativeFormat' type='const char *'
info='configuration format exporting to'/>
+ <arg name='domainXml' type='const char *' info='the domain
configuration to export'/>
+ <arg name='flags' type='unsigned int' info='currently
unused, pass 0'/>
+ </function>
<function name='virConnectFindStoragePoolSources' file='libvirt'
module='libvirt'>
<info>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)</info>
<return type='char *' info='an xml document consisting of a
SourceList element containing a source document appropriate to the given pool type for
each discovered source.'/>
diff -r 803e91762b86 docs/libvirt-refs.xml
--- a/docs/libvirt-refs.xml Wed May 13 09:34:19 2009 -0400
+++ b/docs/libvirt-refs.xml Wed May 13 09:41:37 2009 -0400
@@ -199,6 +199,8 @@
<reference name='virConnectDomainEventCallback'
href='html/libvirt-libvirt.html#virConnectDomainEventCallback'/>
<reference name='virConnectDomainEventDeregister'
href='html/libvirt-libvirt.html#virConnectDomainEventDeregister'/>
<reference name='virConnectDomainEventRegister'
href='html/libvirt-libvirt.html#virConnectDomainEventRegister'/>
+ <reference name='virConnectDomainXMLFromNative'
href='html/libvirt-libvirt.html#virConnectDomainXMLFromNative'/>
+ <reference name='virConnectDomainXMLToNative'
href='html/libvirt-libvirt.html#virConnectDomainXMLToNative'/>
<reference name='virConnectFindStoragePoolSources'
href='html/libvirt-libvirt.html#virConnectFindStoragePoolSources'/>
<reference name='virConnectFlags'
href='html/libvirt-libvirt.html#virConnectFlags'/>
<reference name='virConnectGetCapabilities'
href='html/libvirt-libvirt.html#virConnectGetCapabilities'/>
@@ -629,6 +631,8 @@
<ref name='virConnectDomainEventCallback'/>
<ref name='virConnectDomainEventDeregister'/>
<ref name='virConnectDomainEventRegister'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virConnectFlags'/>
<ref name='virConnectGetCapabilities'/>
@@ -954,6 +958,8 @@
</type>
<type name='unsigned int'>
<ref name='virConnectAuthCallbackPtr'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainCreateLinux'/>
@@ -1013,6 +1019,8 @@
<ref name='virConnectDomainEventCallback'/>
<ref name='virConnectDomainEventDeregister'/>
<ref name='virConnectDomainEventRegister'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virConnectGetCapabilities'/>
<ref name='virConnectGetHostname'/>
@@ -1367,6 +1375,8 @@
<ref name='virConnectDomainEventCallback'/>
<ref name='virConnectDomainEventDeregister'/>
<ref name='virConnectDomainEventRegister'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virConnectFlags'/>
<ref name='virConnectGetCapabilities'/>
@@ -2208,6 +2218,10 @@
<word name='Read-Only'>
<ref name='virConnectGetVersion'/>
</word>
+ <word name='Reads'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
+ </word>
<word name='Reboot'>
<ref name='virDomainReboot'/>
</word>
@@ -2340,6 +2354,8 @@
<ref name='VIR_USE_CPU'/>
</word>
<word name='UTF-8'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainDefineXML'/>
<ref name='virDomainGetXMLDesc'/>
<ref name='virNetworkDefineXML'/>
@@ -2936,6 +2952,8 @@
</word>
<word name='caller'>
<ref name='cpumap'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetHostname'/>
<ref name='virConnectGetURI'/>
<ref name='virConnectListDefinedStoragePools'/>
@@ -3112,9 +3130,12 @@
<ref name='virResetLastError'/>
</word>
<word name='config'>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virStoragePoolDestroy'/>
</word>
<word name='configuration'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virStorageVolGetPath'/>
</word>
<word name='configured'>
@@ -3268,6 +3289,8 @@
<ref name='virStorageVolGetInfo'/>
</word>
<word name='currently'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainCoreDump'/>
<ref name='virNodeDeviceDettach'/>
<ref name='virNodeDeviceReAttach'/>
@@ -3282,6 +3305,8 @@
<ref name='virConnSetErrorFunc'/>
<ref name='virConnectDomainEventCallback'/>
<ref name='virConnectDomainEventRegister'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainFree'/>
<ref name='virErrorFunc'/>
<ref name='virEventAddHandleFunc'/>
@@ -3293,6 +3318,9 @@
<ref name='virNetworkFree'/>
<ref name='virSetErrorFunc'/>
</word>
+ <word name='datafile'>
+ <ref name='virConnectDomainXMLToNative'/>
+ </word>
<word name='dconn'>
<ref name='virDomainMigrate'/>
</word>
@@ -3342,6 +3370,10 @@
<ref name='virConnectDomainEventDeregister'/>
<ref name='virConnectDomainEventRegister'/>
</word>
+ <word name='dependant'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
+ </word>
<word name='depends'>
<ref name='virNodeDeviceReset'/>
</word>
@@ -3352,6 +3384,8 @@
<ref name='virDomainGetVcpus'/>
</word>
<word name='describing'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virNodeDeviceGetXMLDesc'/>
<ref name='virStoragePoolGetXMLDesc'/>
<ref name='virStorageVolGetXMLDesc'/>
@@ -3453,6 +3487,7 @@
<ref name='virDomainShutdown'/>
</word>
<word name='document'>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virNodeDeviceGetXMLDesc'/>
<ref name='virStoragePoolGetXMLDesc'/>
@@ -3573,6 +3608,8 @@
<ref name='virConnectDomainEventRegister'/>
</word>
<word name='encoded'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainGetXMLDesc'/>
<ref name='virNetworkGetXMLDesc'/>
</word>
@@ -3648,8 +3685,14 @@
<ref name='virDomainDefineXML'/>
<ref name='virStoragePoolDefineXML'/>
</word>
+ <word name='export'>
+ <ref name='virConnectDomainXMLToNative'/>
+ </word>
<word name='exported'>
<ref name='virConnectFindStoragePoolSources'/>
+ </word>
+ <word name='exporting'>
+ <ref name='virConnectDomainXMLToNative'/>
</word>
<word name='extra'>
<ref name='_virError'/>
@@ -3713,6 +3756,7 @@
<ref name='virDomainInterfaceStats'/>
</word>
<word name='file'>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainCoreDump'/>
<ref name='virDomainSave'/>
@@ -3794,6 +3838,8 @@
<ref name='virDomainMigrate'/>
</word>
<word name='format'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virDomainGetVcpus'/>
<ref name='virGetVersion'/>
<ref name='virStoragePoolGetXMLDesc'/>
@@ -3829,6 +3875,8 @@
<word name='free'>
<ref name='_virStoragePoolInfo'/>
<ref name='virConnCopyLastError'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetCapabilities'/>
<ref name='virCopyLastError'/>
<ref name='virDomainDestroy'/>
@@ -3873,6 +3921,7 @@
<ref name='_virVcpuInfo'/>
<ref name='virConnCopyLastError'/>
<ref name='virConnGetLastError'/>
+ <ref name='virConnectDomainXMLFromNative'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainCreate'/>
<ref name='virDomainGetVcpus'/>
@@ -3912,6 +3961,10 @@
<letter name='g'>
<word name='general'>
<ref name='virDomainShutdown'/>
+ </word>
+ <word name='generates'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
</word>
<word name='generation'>
<ref name='virNodeDeviceGetXMLDesc'/>
@@ -4115,6 +4168,12 @@
<word name='image'>
<ref name='virDomainMemoryPeek'/>
</word>
+ <word name='import'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ </word>
+ <word name='importing'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ </word>
<word name='imposed'>
<ref name='virDomainMigrate'/>
</word>
@@ -4207,6 +4266,7 @@
</word>
<word name='instance'>
<ref name='nodeinfo'/>
+ <ref name='virConnectDomainXMLFromNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virDomainDestroy'/>
<ref name='virDomainFree'/>
@@ -4420,6 +4480,7 @@
<ref name='virConnectGetType'/>
</word>
<word name='libvirt'>
+ <ref name='virConnectDomainXMLFromNative'/>
<ref name='virConnectOpen'/>
<ref name='virConnectOpenAuth'/>
<ref name='virConnectOpenReadOnly'/>
@@ -4737,6 +4798,8 @@
</word>
<word name='must'>
<ref name='cpumap'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetCapabilities'/>
<ref name='virConnectGetHostname'/>
<ref name='virConnectGetURI'/>
@@ -4775,6 +4838,10 @@
<ref name='_virDomainInfo'/>
<ref name='_virVcpuInfo'/>
</word>
+ <word name='native'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
+ </word>
<word name='necessary'>
<ref name='VIR_NODEINFO_MAXCPUS'/>
<ref name='virConnectOpenAuth'/>
@@ -5058,6 +5125,8 @@
<word name='pass'>
<ref name='virConnSetErrorFunc'/>
<ref name='virConnectDomainEventRegister'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainCreateLinux'/>
@@ -5509,6 +5578,8 @@
<ref name='virNodeGetCellsFreeMemory'/>
</word>
<word name='returned'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetCapabilities'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainBlockStats'/>
@@ -5983,6 +6054,8 @@
<ref name='virDomainMigrate'/>
</word>
<word name='terminated'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetType'/>
<ref name='virDomainGetXMLDesc'/>
<ref name='virNetworkGetBridgeName'/>
@@ -6214,6 +6287,8 @@
<ref name='virStorageVolRef'/>
</word>
<word name='unused'>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectFindStoragePoolSources'/>
<ref name='virDomainBlockPeek'/>
<ref name='virDomainCoreDump'/>
@@ -6365,6 +6440,8 @@
<ref name='VIR_CPU_USABLE'/>
<ref name='VIR_SECURITY_LABEL_BUFLEN'/>
<ref name='_virVcpuInfo'/>
+ <ref name='virConnectDomainXMLFromNative'/>
+ <ref name='virConnectDomainXMLToNative'/>
<ref name='virConnectGetMaxVcpus'/>
<ref name='virConnectGetVersion'/>
<ref name='virDomainGetAutostart'/>
diff -r 803e91762b86 include/libvirt/libvirt.h
--- a/include/libvirt/libvirt.h Wed May 13 09:34:19 2009 -0400
+++ b/include/libvirt/libvirt.h Wed May 13 09:47:20 2009 -0400
@@ -590,6 +590,16 @@ typedef enum {
char * virDomainGetXMLDesc (virDomainPtr domain,
int flags);
+
+
+char * virConnectDomainXMLFromNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *nativeConfig,
+ unsigned int flags);
+char * virConnectDomainXMLToNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *domainXml,
+ unsigned int flags);
int virDomainBlockStats (virDomainPtr dom,
const char *path,
diff -r 803e91762b86 include/libvirt/libvirt.h.in
--- a/include/libvirt/libvirt.h.in Wed May 13 09:34:19 2009 -0400
+++ b/include/libvirt/libvirt.h.in Wed May 13 09:34:22 2009 -0400
@@ -590,6 +590,16 @@ typedef enum {
char * virDomainGetXMLDesc (virDomainPtr domain,
int flags);
+
+
+char * virConnectDomainXMLFromNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *nativeConfig,
+ unsigned int flags);
+char * virConnectDomainXMLToNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *domainXml,
+ unsigned int flags);
int virDomainBlockStats (virDomainPtr dom,
const char *path,
diff -r 803e91762b86 src/driver.h
--- a/src/driver.h Wed May 13 09:34:19 2009 -0400
+++ b/src/driver.h Wed May 13 09:34:22 2009 -0400
@@ -152,6 +152,16 @@ typedef char *
typedef char *
(*virDrvDomainDumpXML) (virDomainPtr dom,
int flags);
+typedef char *
+ (*virDrvConnectDomainXMLFromNative) (virConnectPtr conn,
+ const char *nativeFormat,
+ const char *nativeConfig,
+ unsigned int flags);
+typedef char *
+ (*virDrvConnectDomainXMLToNative) (virConnectPtr conn,
+ const char *nativeFormat,
+ const char *domainXml,
+ unsigned int flags);
typedef int
(*virDrvListDefinedDomains) (virConnectPtr conn,
char **const names,
@@ -381,6 +391,8 @@ struct _virDriver {
virDrvDomainGetSecurityLabel domainGetSecurityLabel;
virDrvNodeGetSecurityModel nodeGetSecurityModel;
virDrvDomainDumpXML domainDumpXML;
+ virDrvConnectDomainXMLFromNative domainXMLFromNative;
+ virDrvConnectDomainXMLToNative domainXMLToNative;
virDrvListDefinedDomains listDefinedDomains;
virDrvNumOfDefinedDomains numOfDefinedDomains;
virDrvDomainCreate domainCreate;
diff -r 803e91762b86 src/libvirt.c
--- a/src/libvirt.c Wed May 13 09:34:19 2009 -0400
+++ b/src/libvirt.c Wed May 13 09:34:22 2009 -0400
@@ -2648,6 +2648,111 @@ error:
}
/**
+ * virConnectDomainXMLFromNative:
+ * @conn: a connection object
+ * @nativeFormat: configuration format importing from
+ * @nativeConfig: the configuration data to import
+ * @flags: currently unused, pass 0
+ *
+ * Reads native configuration data describing a domain, and
+ * generates libvirt domain XML. The format of the native
+ * data is hypervisor dependant.
+ *
+ * Returns a 0 terminated UTF-8 encoded XML instance, or NULL in case of error.
+ * the caller must free() the returned value.
+ */
+char *virConnectDomainXMLFromNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *nativeConfig,
+ unsigned int flags)
+{
+ DEBUG("conn=%p, format=%s config=%s flags=%u", conn, nativeFormat,
nativeConfig, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (NULL);
+ }
+
+ if (nativeFormat == NULL || nativeConfig == NULL) {
+ virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ return (NULL);
+ }
+
+ if (conn->driver->domainXMLFromNative) {
+ char *ret;
+ ret = conn->driver->domainXMLFromNative (conn,
+ nativeFormat,
+ nativeConfig,
+ flags);
+ if (!ret)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(conn);
+ return NULL;
+}
+
+/**
+ * virConnectDomainXMLToNative:
+ * @conn: a connection object
+ * @nativeFormat: configuration format exporting to
+ * @domainXml: the domain configuration to export
+ * @flags: currently unused, pass 0
+ *
+ * Reads a domain XML configuration document, and generates
+ * generates a native configuration file describing the domain.
+ * The format of the native data is hypervisor dependant.
+ *
+ * Returns a 0 terminated UTF-8 encoded native config datafile, or NULL in case of
error.
+ * the caller must free() the returned value.
+ */
+char *virConnectDomainXMLToNative(virConnectPtr conn,
+ const char *nativeFormat,
+ const char *domainXml,
+ unsigned int flags)
+{
+ DEBUG("conn=%p, format=%s xml=%s flags=%u", conn, nativeFormat, domainXml,
flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (NULL);
+ }
+
+ if (nativeFormat == NULL || domainXml == NULL) {
+ virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ return (NULL);
+ }
+
+ if (conn->driver->domainXMLToNative) {
+ char *ret;
+ ret = conn->driver->domainXMLToNative(conn,
+ nativeFormat,
+ domainXml,
+ flags);
+ if (!ret)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(conn);
+ return NULL;
+}
+
+
+/**
* virDomainMigrate:
* @domain: a domain object
* @dconn: destination host (a connection object)
diff -r 803e91762b86 src/libvirt_public.syms
--- a/src/libvirt_public.syms Wed May 13 09:34:19 2009 -0400
+++ b/src/libvirt_public.syms Wed May 13 09:54:04 2009 -0400
@@ -264,9 +264,11 @@ LIBVIRT_0.6.3 {
virNodeDeviceDestroy;
} LIBVIRT_0.6.1;
+LIBVIRT_0.6.4 {
+ global:
+ virStorageVolCreateXMLFrom;
+ virConnectDomainXMLFromNative;
+ virConnectDomainXMLToNative;
+} LIBVIRT_0.6.3;
+
# .... define new API here using predicted next version number ....
-
-LIBVIRT_0.6.4 {
- global:
- virStorageVolCreateXMLFrom;
-} LIBVIRT_0.6.3;
diff -r 803e91762b86 src/lxc_driver.c
--- a/src/lxc_driver.c Wed May 13 09:34:19 2009 -0400
+++ b/src/lxc_driver.c Wed May 13 09:34:22 2009 -0400
@@ -1457,6 +1457,8 @@ static virDriver lxcDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
lxcDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
lxcListDefinedDomains, /* listDefinedDomains */
lxcNumDefinedDomains, /* numOfDefinedDomains */
lxcDomainStart, /* domainCreate */
diff -r 803e91762b86 src/openvz_driver.c
--- a/src/openvz_driver.c Wed May 13 09:34:19 2009 -0400
+++ b/src/openvz_driver.c Wed May 13 09:34:22 2009 -0400
@@ -1344,6 +1344,8 @@ static virDriver openvzDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
openvzDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
openvzListDefinedDomains, /* listDefinedDomains */
openvzNumDefinedDomains, /* numOfDefinedDomains */
openvzDomainCreate, /* domainCreate */
diff -r 803e91762b86 src/qemu_driver.c
--- a/src/qemu_driver.c Wed May 13 09:34:19 2009 -0400
+++ b/src/qemu_driver.c Wed May 13 09:34:22 2009 -0400
@@ -5231,6 +5231,8 @@ static virDriver qemuDriver = {
qemudDomainGetSecurityLabel, /* domainGetSecurityLabel */
qemudNodeGetSecurityModel, /* nodeGetSecurityModel */
qemudDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
qemudListDefinedDomains, /* listDefinedDomains */
qemudNumDefinedDomains, /* numOfDefinedDomains */
qemudDomainStart, /* domainCreate */
diff -r 803e91762b86 src/remote_internal.c
--- a/src/remote_internal.c Wed May 13 09:34:19 2009 -0400
+++ b/src/remote_internal.c Wed May 13 09:53:16 2009 -0400
@@ -6968,6 +6968,8 @@ static virDriver driver = {
remoteDomainGetSecurityLabel, /* domainGetSecurityLabel */
remoteNodeGetSecurityModel, /* nodeGetSecurityModel */
remoteDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
remoteListDefinedDomains, /* listDefinedDomains */
remoteNumOfDefinedDomains, /* numOfDefinedDomains */
remoteDomainCreate, /* domainCreate */
diff -r 803e91762b86 src/test.c
--- a/src/test.c Wed May 13 09:34:19 2009 -0400
+++ b/src/test.c Wed May 13 09:34:22 2009 -0400
@@ -3594,6 +3594,8 @@ static virDriver testDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
testDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
testListDefinedDomains, /* listDefinedDomains */
testNumOfDefinedDomains, /* numOfDefinedDomains */
testDomainCreate, /* domainCreate */
diff -r 803e91762b86 src/uml_driver.c
--- a/src/uml_driver.c Wed May 13 09:34:19 2009 -0400
+++ b/src/uml_driver.c Wed May 13 09:34:22 2009 -0400
@@ -1854,6 +1854,8 @@ static virDriver umlDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
umlDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
umlListDefinedDomains, /* listDefinedDomains */
umlNumDefinedDomains, /* numOfDefinedDomains */
umlDomainStart, /* domainCreate */
diff -r 803e91762b86 src/virsh.c
--- a/src/virsh.c Wed May 13 09:34:19 2009 -0400
+++ b/src/virsh.c Wed May 13 09:53:16 2009 -0400
@@ -2206,6 +2206,98 @@ cmdDumpXML(vshControl *ctl, const vshCmd
}
virDomainFree(dom);
+ return ret;
+}
+
+/*
+ * "domxml-from-native" command
+ */
+static const vshCmdInfo info_domxmlfromnative[] = {
+ {"help", gettext_noop("Import native config as domain XML")},
+ {"desc", gettext_noop("Import native guest configuration format to
domain XML format.")},
+ {NULL, NULL}
+};
+
+static const vshCmdOptDef opts_domxmlfromnative[] = {
+ {"format", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("source config
data format")},
+ {"config", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("config data file
to import from")},
+ {NULL, 0, 0, NULL}
+};
+
+static int
+cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd)
+{
+ int ret = TRUE;
+ char *format;
+ char *configFile;
+ char *configData;
+ char *xmlData;
+ int flags = 0;
+
+ if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ return FALSE;
+
+ format = vshCommandOptString(cmd, "format", NULL);
+ configFile = vshCommandOptString(cmd, "config", NULL);
+
+ if (virFileReadAll(configFile, 1024*1024, &configData) < 0) {
+ return FALSE;
+ }
+
+ xmlData = virConnectDomainXMLFromNative(ctl->conn, format, configData, flags);
+ if (xmlData != NULL) {
+ printf("%s", xmlData);
+ free(xmlData);
+ } else {
+ ret = FALSE;
+ }
+
+ return ret;
+}
+
+/*
+ * "domxml-to-native" command
+ */
+static const vshCmdInfo info_domxmltonative[] = {
+ {"help", gettext_noop("Export domain XML as native config")},
+ {"desc", gettext_noop("Export domain XML config to a native guest
configuration format.")},
+ {NULL, NULL}
+};
+
+static const vshCmdOptDef opts_domxmltonative[] = {
+ {"format", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("target config
data type format")},
+ {"xml", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("xml data file to
export from")},
+ {NULL, 0, 0, NULL}
+};
+
+static int
+cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
+{
+ int ret = TRUE;
+ char *format;
+ char *xmlFile;
+ char *configData;
+ char *xmlData;
+ int flags = 0;
+
+ if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ return FALSE;
+
+ format = vshCommandOptString(cmd, "format", NULL);
+ xmlFile = vshCommandOptString(cmd, "xml", NULL);
+
+ if (virFileReadAll(xmlFile, 1024*1024, &xmlData) < 0) {
+ return FALSE;
+ }
+
+ configData = virConnectDomainXMLToNative(ctl->conn, format, xmlData, flags);
+ if (configData != NULL) {
+ printf("%s", configData);
+ free(configData);
+ } else {
+ ret = FALSE;
+ }
+
return ret;
}
@@ -6037,6 +6129,8 @@ static const vshCmdDef commands[] = {
{"domstate", cmdDomstate, opts_domstate, info_domstate},
{"domblkstat", cmdDomblkstat, opts_domblkstat, info_domblkstat},
{"domifstat", cmdDomIfstat, opts_domifstat, info_domifstat},
+ {"domxml-from-native", cmdDomXMLFromNative, opts_domxmlfromnative,
info_domxmlfromnative},
+ {"domxml-to-native", cmdDomXMLToNative, opts_domxmltonative,
info_domxmltonative},
{"dumpxml", cmdDumpXML, opts_dumpxml, info_dumpxml},
{"edit", cmdEdit, opts_edit, info_edit},
{"find-storage-pool-sources", cmdPoolDiscoverSources,
diff -r 803e91762b86 src/xen_unified.c
--- a/src/xen_unified.c Wed May 13 09:34:19 2009 -0400
+++ b/src/xen_unified.c Wed May 13 09:34:22 2009 -0400
@@ -1580,6 +1580,8 @@ static virDriver xenUnifiedDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
xenUnifiedDomainDumpXML, /* domainDumpXML */
+ NULL, /* domainXmlFromNative */
+ NULL, /* domainXmlToNative */
xenUnifiedListDefinedDomains, /* listDefinedDomains */
xenUnifiedNumOfDefinedDomains, /* numOfDefinedDomains */
xenUnifiedDomainCreate, /* domainCreate */
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|