public API for domain XML conversions

This commit is contained in:
Daniel P. Berrange 2009-05-21 13:46:35 +00:00
parent c9e6c8c02f
commit 4d5383fd36
20 changed files with 1005 additions and 142 deletions

View File

@ -1,3 +1,18 @@
Thu May 21 14:32:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Public APIs for domain XML conversions.
* docs/devhelp/libvirt-libvirt.html, docs/devhelp/libvirt-virterror.html,
docs/html/libvirt-libvirt.html, docs/html/libvirt-virterror.html,
docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate with new public
APIs
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in,
src/driver.h, src/libvirt.c, src/libvirt_public.syms: Add
virConnectDomainXMLFromNative and virConnectDomainXMLToNative
* src/lxc_driver.c, src/openvz_driver.c, src/qemu_driver.c,
src/remote_internal.c, src/test.c, src/uml_driver.c,
src/xen_unified.c: Stub out new API entry points
* src/virsh.c: Add domxml-to-native and domxml-from-native commands
Thu May 21 11:52:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* python/generator.py, python/libvirt_wrap.h, python/types.c: Add

View File

@ -84,9 +84,11 @@ typedef struct _virNodeDevice <a href="#virNodeDevice">virNodeDevice</a>;
typedef <a href="libvirt-libvirt.html#virConnect">virConnect</a> * <a href="#virConnectPtr">virConnectPtr</a>;
typedef struct _virStorageVol <a href="#virStorageVol">virStorageVol</a>;
typedef <a href="libvirt-libvirt.html#virNodeDevice">virNodeDevice</a> * <a href="#virNodeDevicePtr">virNodeDevicePtr</a>;
typedef struct _virInterface <a href="#virInterface">virInterface</a>;
typedef struct _virSchedParameter <a href="#virSchedParameter">virSchedParameter</a>;
typedef enum <a href="#virConnectFlags">virConnectFlags</a>;
typedef enum <a href="#virDomainEventDefinedDetailType">virDomainEventDefinedDetailType</a>;
typedef <a href="libvirt-libvirt.html#virInterface">virInterface</a> * <a href="#virInterfacePtr">virInterfacePtr</a>;
typedef enum <a href="#virDomainMemoryFlags">virDomainMemoryFlags</a>;
typedef enum <a href="#virDomainEventStoppedDetailType">virDomainEventStoppedDetailType</a>;
typedef <a href="libvirt-libvirt.html#virStorageVol">virStorageVol</a> * <a href="#virStorageVolPtr">virStorageVolPtr</a>;
@ -122,6 +124,7 @@ int <a href="#virNodeGetCellsFreeMemory">virNodeGetCellsFreeMemory</a> (<a href=
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);
@ -130,7 +133,7 @@ int <a href="#virDomainGetSchedulerParameters">virDomainGetSchedulerParameters</
int <a href="#virConnectNumOfDefinedNetworks">virConnectNumOfDefinedNetworks</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="#virNetworkGetUUID">virNetworkGetUUID</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> unsigned char * uuid);
<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);
char * <a href="#virInterfaceGetXMLDesc">virInterfaceGetXMLDesc</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags);
<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="#virConnectGetVersion">virConnectGetVersion</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned long * hvVer);
int <a href="#virDomainFree">virDomainFree</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
@ -143,6 +146,7 @@ int <a href="#virDomainSetAutostart">virDomainSetAutostart</a> (<a href="libvir
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned long memory);
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);
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceDefineXML">virInterfaceDefineXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml, <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="#virDomainSuspend">virDomainSuspend</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);
@ -151,17 +155,20 @@ typedef void <a href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> (i
int <a href="#virDomainDestroy">virDomainDestroy</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
int <a href="#virConnectNumOfNetworks">virConnectNumOfNetworks</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
<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);
int <a href="#virInterfaceCreate">virInterfaceCreate</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags);
char * <a href="#virDomainGetXMLDesc">virDomainGetXMLDesc</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> int flags);
int <a href="#virStoragePoolGetUUID">virStoragePoolGetUUID</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned char * uuid);
int <a href="#virNodeDeviceFree">virNodeDeviceFree</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
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);
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);
<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="#virNetworkDestroy">virNetworkDestroy</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
<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="#virStoragePoolCreateXML">virStoragePoolCreateXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc, <br/> unsigned int flags);
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);
@ -170,6 +177,7 @@ int <a href="#virDomainCreate">virDomainCreate</a> (<a href="libvirt-libvirt.h
int <a href="#virConnectListDomains">virConnectListDomains</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> int * ids, <br/> int maxids);
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="#virDomainSetMemory">virDomainSetMemory</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned long memory);
const char * <a href="#virInterfaceGetName">virInterfaceGetName</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
int <a href="#virStoragePoolCreate">virStoragePoolCreate</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags);
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="#virNetworkSetAutostart">virNetworkSetAutostart</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int autostart);
@ -192,6 +200,7 @@ const char * <a href="#virDomainGetName">virDomainGetName</a> (<a href="libvirt-
int <a href="#virStoragePoolRef">virStoragePoolRef</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
char * <a href="#virNetworkGetXMLDesc">virNetworkGetXMLDesc</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int flags);
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="#virInterfaceGetConnect">virInterfaceGetConnect</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
const char * <a href="#virNetworkGetName">virNetworkGetName</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virConnectListDefinedDomains">virConnectListDefinedDomains</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames);
char * <a href="#virConnectGetCapabilities">virConnectGetCapabilities</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
@ -207,21 +216,24 @@ typedef int <a href="#virConnectDomainEventCallback">virConnectDomainEventCallba
<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);
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);
int <a href="#virConnectListInterfaces">virConnectListInterfaces</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames);
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#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByUUID">virNetworkLookupByUUID</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const unsigned char * uuid);
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="#virConnectRef">virConnectRef</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
int <a href="#virDomainGetUUID">virDomainGetUUID</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned char * uuid);
<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);
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);
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);
<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="#virStoragePoolGetInfo">virStoragePoolGetInfo</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> <a href="libvirt-libvirt.html#virStoragePoolInfoPtr">virStoragePoolInfoPtr</a> info);
int <a href="#virDomainResume">virDomainResume</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
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="#virInterfaceRef">virInterfaceRef</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
const char * <a href="#virInterfaceGetMACString">virInterfaceGetMACString</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
int <a href="#virNetworkRef">virNetworkRef</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virStoragePoolRefresh">virStoragePoolRefresh</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags);
int <a href="#virConnectNumOfDefinedDomains">virConnectNumOfDefinedDomains</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
<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="#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="#virDomainUndefine">virDomainUndefine</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
int <a href="#virDomainReboot">virDomainReboot</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned int flags);
int <a href="#virNetworkGetUUIDString">virNetworkGetUUIDString</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> char * buf);
@ -245,10 +257,12 @@ typedef int <a href="#virEventAddHandleFunc">virEventAddHandleFunc</a> (int fd,
int <a href="#virNetworkUndefine">virNetworkUndefine</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
int <a href="#virConnectListDefinedStoragePools">virConnectListDefinedStoragePools</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames);
typedef void <a href="#virEventTimeoutCallback">virEventTimeoutCallback</a> (int timer, <br/> void * opaque);
<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="#virInterfaceFree">virInterfaceFree</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
int <a href="#virNodeDeviceNumOfCaps">virNodeDeviceNumOfCaps</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceLookupByMACString">virInterfaceLookupByMACString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * macstr);
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virNetworkGetConnect">virNetworkGetConnect</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net);
unsigned long long <a href="#virNodeGetFreeMemory">virNodeGetFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
int <a href="#virInterfaceDestroy">virInterfaceDestroy</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags);
<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="#virNodeNumOfDevices">virNodeNumOfDevices</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * cap, <br/> unsigned int flags);
int <a href="#virStoragePoolDestroy">virStoragePoolDestroy</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
@ -260,18 +274,22 @@ int <a href="#virConnectGetMaxVcpus">virConnectGetMaxVcpus</a> (<a href="libvir
int <a href="#virDomainGetUUIDString">virDomainGetUUIDString</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> char * buf);
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virDomainGetConnect">virDomainGetConnect</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom);
int <a href="#virConnectNumOfDefinedStoragePools">virConnectNumOfDefinedStoragePools</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
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);
const char * <a href="#virNodeDeviceGetParent">virNodeDeviceGetParent</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpen">virConnectOpen</a> (const char * name);
<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);
int <a href="#virNodeDeviceRef">virNodeDeviceRef</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
int <a href="#virInterfaceUndefine">virInterfaceUndefine</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface);
int <a href="#virDomainSetVcpus">virDomainSetVcpus</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned int nvcpus);
int <a href="#virDomainRef">virDomainRef</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
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);
int <a href="#virConnectNumOfInterfaces">virConnectNumOfInterfaces</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
unsigned int <a href="#virDomainGetID">virDomainGetID</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
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);
typedef 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);
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceLookupByName">virInterfaceLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * name);
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);
int <a href="#virConnectListNetworks">virConnectListNetworks</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames);
<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);
</pre>
</div>
<div class="refsect1" lang="en">
@ -550,6 +568,16 @@ The content of this structure is not made public by the API.
<a name="VIR_EVENT_HANDLE_HANGUP">VIR_EVENT_HANDLE_HANGUP</a> = 8
};
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterface">Structure </a>virInterface</h3><pre class="programlisting">struct _virInterface {
The content of this structure is not made public by the API.
} virInterface;
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfacePtr">Typedef </a>virInterfacePtr</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterface">virInterface</a> * virInterfacePtr;
</pre><p>a <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> is pointer to a <a href="libvirt-libvirt.html#virInterface">virInterface</a> private structure, this is the type used to reference a virtual interface in the API.</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetwork">Structure </a>virNetwork</h3><pre class="programlisting">struct _virNetwork {
@ -794,6 +822,14 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventRegister"/>virConnectDomainEventRegister ()</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></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>
@ -838,6 +874,10 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en"><h3><a name="virConnectListDomains"/>virConnectListDomains ()</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectListInterfaces"/>virConnectListInterfaces ()</h3><pre class="programlisting">int virConnectListInterfaces (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames)<br/>
</pre><p>Collect the list of physical host interfaces, 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 interfaces</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 interfaces found or -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectListNetworks"/>virConnectListNetworks ()</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>
@ -862,6 +902,10 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en"><h3><a name="virConnectNumOfDomains"/>virConnectNumOfDomains ()</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectNumOfInterfaces"/>virConnectNumOfInterfaces ()</h3><pre class="programlisting">int virConnectNumOfInterfaces (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
</pre><p>Provides the number of interfaces on the physical host.</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 interface found or -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virConnectNumOfNetworks"/>virConnectNumOfNetworks ()</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>
@ -1086,6 +1130,54 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en"><h3><a name="virInitialize"/>virInitialize ()</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceCreate"/>virInterfaceCreate ()</h3><pre class="programlisting">int virInterfaceCreate (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags)<br/>
</pre><p>Activate an interface (ie call "ifup")</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>pointer to a defined interface</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>0 in case of success, -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceDefineXML"/>virInterfaceDefineXML ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceDefineXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml, <br/> unsigned int flags)<br/>
</pre><p>Define an interface (or modify existing interface configuration)</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 interface, preferably in UTF-8</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>NULL in case of error, a pointer to the interface otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceDestroy"/>virInterfaceDestroy ()</h3><pre class="programlisting">int virInterfaceDestroy (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags)<br/>
</pre><p>deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>an interface 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>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceFree"/>virInterfaceFree ()</h3><pre class="programlisting">int virInterfaceFree (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Free the interface object. The interface itself is unaltered. 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>interface</tt></i>:</span></td><td>a interface 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceGetConnect"/>virInterfaceGetConnect ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virInterfaceGetConnect (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Provides the connection pointer associated with an interface. 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 interface object together.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceGetMACString"/>virInterfaceGetMACString ()</h3><pre class="programlisting">const char * virInterfaceGetMACString (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Get the MAC for a interface as string. For more information about MAC see RFC4122.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceGetName"/>virInterfaceGetName ()</h3><pre class="programlisting">const char * virInterfaceGetName (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Get the public name for that interface</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface 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 interface object.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceGetXMLDesc"/>virInterfaceGetXMLDesc ()</h3><pre class="programlisting">char * virInterfaceGetXMLDesc (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br/> unsigned int flags)<br/>
</pre><p>Provide an XML description of the interface. The description may be reused later to recreate the interface with virInterfaceCreateXML().</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceLookupByMACString"/>virInterfaceLookupByMACString ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceLookupByMACString (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * macstr)<br/>
</pre><p>Try to lookup an interface on the given hypervisor based on its MAC.</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>macstr</tt></i>:</span></td><td>the MAC for the interface (null-terminated ASCII format)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceLookupByName"/>virInterfaceLookupByName ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * name)<br/>
</pre><p>Try to lookup an interface 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 interface</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceRef"/>virInterfaceRef ()</h3><pre class="programlisting">int virInterfaceRef (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Increment the reference count on the interface. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virInterfaceFree">virInterfaceFree</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 interface would increment the reference count.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>the interface 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>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virInterfaceUndefine"/>virInterfaceUndefine ()</h3><pre class="programlisting">int virInterfaceUndefine (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br/>
</pre><p>Undefine an interface, ie remove it from the config. This does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>pointer to a defined interface</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="virNetworkCreate"/>virNetworkCreate ()</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>

View File

@ -107,7 +107,8 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
<a name="VIR_FROM_NODEDEV">VIR_FROM_NODEDEV</a> = 22 /* Error from node device monitor */
<a name="VIR_FROM_XEN_INOTIFY">VIR_FROM_XEN_INOTIFY</a> = 23 /* Error from xen inotify layer */
<a name="VIR_FROM_SECURITY">VIR_FROM_SECURITY</a> = 24 /* Error from security framework */
<a name="VIR_FROM_VBOX">VIR_FROM_VBOX</a> = 25 /* Error from VirtualBox driver */
<a name="VIR_FROM_VBOX">VIR_FROM_VBOX</a> = 25 /* Error from VirtualBox driver */
<a name="VIR_FROM_INTERFACE">VIR_FROM_INTERFACE</a> = 26 /* Error when operating on an interface */
};
</pre><p/>
</div>
@ -176,7 +177,10 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
<a name="VIR_ERR_INVALID_NODE_DEVICE">VIR_ERR_INVALID_NODE_DEVICE</a> = 52 /* invalid node device object */
<a name="VIR_ERR_NO_NODE_DEVICE">VIR_ERR_NO_NODE_DEVICE</a> = 53 /* node device not found */
<a name="VIR_ERR_NO_SECURITY_MODEL">VIR_ERR_NO_SECURITY_MODEL</a> = 54 /* security model not found */
<a name="VIR_ERR_OPERATION_INVALID">VIR_ERR_OPERATION_INVALID</a> = 55 /* operation is not applicable at this time */
<a name="VIR_ERR_OPERATION_INVALID">VIR_ERR_OPERATION_INVALID</a> = 55 /* operation is not applicable at this time */
<a name="VIR_WAR_NO_INTERFACE">VIR_WAR_NO_INTERFACE</a> = 56 /* failed to start interface driver */
<a name="VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> = 57 /* interface driver not running */
<a name="VIR_ERR_INVALID_INTERFACE">VIR_ERR_INVALID_INTERFACE</a> = 58 /* invalid interface object */
};
</pre><p/>
</div>

View File

@ -46,6 +46,8 @@ typedef <a href="libvirt-libvirt.html#virDomain">virDomain</a> * <a name="virDom
typedef enum <a href="#virDomainState">virDomainState</a>
typedef enum <a href="#virDomainXMLFlags">virDomainXMLFlags</a>
typedef enum <a href="#virEventHandleType">virEventHandleType</a>
typedef struct _virInterface <a href="#virInterface">virInterface</a>
typedef <a href="libvirt-libvirt.html#virInterface">virInterface</a> * <a name="virInterfacePtr" id="virInterfacePtr">virInterfacePtr</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>
@ -84,6 +86,8 @@ int <a href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a> (
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)
@ -95,12 +99,14 @@ int <a href="#virConnectListDefinedDomains">virConnectListDefinedDomains</a> (<a
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="#virConnectListInterfaces">virConnectListInterfaces</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> char ** const names, <br /> int maxnames)
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="#virConnectNumOfInterfaces">virConnectNumOfInterfaces</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)
@ -184,6 +190,18 @@ 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="#virInterfaceCreate">virInterfaceCreate</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceDefineXML">virInterfaceDefineXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * xml, <br /> unsigned int flags)
int <a href="#virInterfaceDestroy">virInterfaceDestroy</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)
int <a href="#virInterfaceFree">virInterfaceFree</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virInterfaceGetConnect">virInterfaceGetConnect</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
const char * <a href="#virInterfaceGetMACString">virInterfaceGetMACString</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
const char * <a href="#virInterfaceGetName">virInterfaceGetName</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
char * <a href="#virInterfaceGetXMLDesc">virInterfaceGetXMLDesc</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceLookupByMACString">virInterfaceLookupByMACString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * macstr)
<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> <a href="#virInterfaceLookupByName">virInterfaceLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)
int <a href="#virInterfaceRef">virInterfaceRef</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
int <a href="#virInterfaceUndefine">virInterfaceUndefine</a> (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)
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)
@ -310,6 +328,9 @@ int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.
</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="virInterface" id="virInterface"><code>virInterface</code></a></h3><div class="api"><pre>struct virInterface{
</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="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>
}
@ -362,7 +383,9 @@ int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.
</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 />
@ -373,13 +396,15 @@ int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.
</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 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="virConnectListInterfaces" id="virConnectListInterfaces"><code>virConnectListInterfaces</code></a></h3><pre class="programlisting">int virConnectListInterfaces (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> char ** const names, <br /> int maxnames)<br />
</pre><p>Collect the list of physical host interfaces, 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 interfaces</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 interfaces 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 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="virConnectNumOfInterfaces" id="virConnectNumOfInterfaces"><code>virConnectNumOfInterfaces</code></a></h3><pre class="programlisting">int virConnectNumOfInterfaces (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
</pre><p>Provides the number of interfaces on the physical host.</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 interface 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></div><h3><a 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 />
@ -444,7 +469,19 @@ int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.
</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>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="virInterfaceCreate" id="virInterfaceCreate"><code>virInterfaceCreate</code></a></h3><pre class="programlisting">int virInterfaceCreate (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)<br />
</pre><p>Activate an interface (ie call "ifup")</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>pointer to a defined interface</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>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virInterfaceDefineXML" id="virInterfaceDefineXML"><code>virInterfaceDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceDefineXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * xml, <br /> unsigned int flags)<br />
</pre><p>Define an interface (or modify existing interface configuration)</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 interface, preferably in UTF-8</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>NULL in case of error, a pointer to the interface otherwise</td></tr></tbody></table></div><h3><a name="virInterfaceDestroy" id="virInterfaceDestroy"><code>virInterfaceDestroy</code></a></h3><pre class="programlisting">int virInterfaceDestroy (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)<br />
</pre><p>deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>an interface 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>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceFree" id="virInterfaceFree"><code>virInterfaceFree</code></a></h3><pre class="programlisting">int virInterfaceFree (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Free the interface object. The interface itself is unaltered. 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>interface</tt></i>:</span></td><td>a interface 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="virInterfaceGetConnect" id="virInterfaceGetConnect"><code>virInterfaceGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virInterfaceGetConnect (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Provides the connection pointer associated with an interface. 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 interface object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td></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="virInterfaceGetMACString" id="virInterfaceGetMACString"><code>virInterfaceGetMACString</code></a></h3><pre class="programlisting">const char * virInterfaceGetMACString (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Get the MAC for a interface as string. For more information about MAC see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</td></tr></tbody></table></div><h3><a name="virInterfaceGetName" id="virInterfaceGetName"><code>virInterfaceGetName</code></a></h3><pre class="programlisting">const char * virInterfaceGetName (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Get the public name for that interface</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface 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 interface object.</td></tr></tbody></table></div><h3><a name="virInterfaceGetXMLDesc" id="virInterfaceGetXMLDesc"><code>virInterfaceGetXMLDesc</code></a></h3><pre class="programlisting">char * virInterfaceGetXMLDesc (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface, <br /> unsigned int flags)<br />
</pre><p>Provide an XML description of the interface. The description may be reused later to recreate the interface with virInterfaceCreateXML().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>a interface 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="virInterfaceLookupByMACString" id="virInterfaceLookupByMACString"><code>virInterfaceLookupByMACString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceLookupByMACString (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * macstr)<br />
</pre><p>Try to lookup an interface on the given hypervisor based on its MAC.</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>macstr</tt></i>:</span></td><td>the MAC for the interface (null-terminated ASCII format)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div><h3><a name="virInterfaceLookupByName" id="virInterfaceLookupByName"><code>virInterfaceLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)<br />
</pre><p>Try to lookup an interface 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 interface</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div><h3><a name="virInterfaceRef" id="virInterfaceRef"><code>virInterfaceRef</code></a></h3><pre class="programlisting">int virInterfaceRef (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Increment the reference count on the interface. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virInterfaceFree">virInterfaceFree</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 interface would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>the interface 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="virInterfaceUndefine" id="virInterfaceUndefine"><code>virInterfaceUndefine</code></a></h3><pre class="programlisting">int virInterfaceUndefine (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> interface)<br />
</pre><p>Undefine an interface, ie remove it from the config. This does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>interface</tt></i>:</span></td><td>pointer to a defined interface</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="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 />

File diff suppressed because one or more lines are too long

View File

@ -121,9 +121,11 @@
<exports symbol='virConnectPtr' type='typedef'/>
<exports symbol='virStorageVol' type='typedef'/>
<exports symbol='virNodeDevicePtr' type='typedef'/>
<exports symbol='virInterface' type='typedef'/>
<exports symbol='virSchedParameter' type='typedef'/>
<exports symbol='virConnectFlags' type='typedef'/>
<exports symbol='virDomainEventDefinedDetailType' type='typedef'/>
<exports symbol='virInterfacePtr' type='typedef'/>
<exports symbol='virDomainMemoryFlags' type='typedef'/>
<exports symbol='virDomainEventStoppedDetailType' type='typedef'/>
<exports symbol='virStorageVolPtr' type='typedef'/>
@ -172,6 +174,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'/>
@ -180,7 +183,7 @@
<exports symbol='virConnectNumOfDefinedNetworks' type='function'/>
<exports symbol='virConnectNumOfDomains' type='function'/>
<exports symbol='virNetworkGetUUID' type='function'/>
<exports symbol='virNodeDeviceCreateXML' type='function'/>
<exports symbol='virInterfaceGetXMLDesc' type='function'/>
<exports symbol='virStoragePoolGetConnect' type='function'/>
<exports symbol='virConnectGetVersion' type='function'/>
<exports symbol='virDomainFree' type='function'/>
@ -193,6 +196,7 @@
<exports symbol='virNetworkCreate' type='function'/>
<exports symbol='virDomainSetMaxMemory' type='function'/>
<exports symbol='virEventRegisterImpl' type='function'/>
<exports symbol='virInterfaceDefineXML' type='function'/>
<exports symbol='virDomainMigrate' type='function'/>
<exports symbol='virDomainSuspend' type='function'/>
<exports symbol='virDomainCreateLinux' type='function'/>
@ -201,17 +205,20 @@
<exports symbol='virDomainDestroy' type='function'/>
<exports symbol='virConnectNumOfNetworks' type='function'/>
<exports symbol='virStoragePoolLookupByUUIDString' type='function'/>
<exports symbol='virInterfaceCreate' type='function'/>
<exports symbol='virDomainGetXMLDesc' type='function'/>
<exports symbol='virStoragePoolGetUUID' type='function'/>
<exports symbol='virNodeDeviceFree' type='function'/>
<exports symbol='virStorageVolGetInfo' type='function'/>
<exports symbol='virDomainGetInfo' type='function'/>
<exports symbol='virNodeDeviceCreateXML' type='function'/>
<exports symbol='virNetworkDestroy' type='function'/>
<exports symbol='virStoragePoolLookupByName' type='function'/>
<exports symbol='virStoragePoolCreateXML' type='function'/>
<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'/>
@ -220,6 +227,7 @@
<exports symbol='virConnectListDomains' type='function'/>
<exports symbol='virDomainCoreDump' type='function'/>
<exports symbol='virDomainSetMemory' type='function'/>
<exports symbol='virInterfaceGetName' type='function'/>
<exports symbol='virStoragePoolCreate' type='function'/>
<exports symbol='virNodeGetInfo' type='function'/>
<exports symbol='virNetworkSetAutostart' type='function'/>
@ -242,6 +250,7 @@
<exports symbol='virStoragePoolRef' type='function'/>
<exports symbol='virNetworkGetXMLDesc' type='function'/>
<exports symbol='virConnectNumOfStoragePools' type='function'/>
<exports symbol='virInterfaceGetConnect' type='function'/>
<exports symbol='virNetworkGetName' type='function'/>
<exports symbol='virConnectListDefinedDomains' type='function'/>
<exports symbol='virConnectGetCapabilities' type='function'/>
@ -257,21 +266,24 @@
<exports symbol='virDomainLookupByID' type='function'/>
<exports symbol='virStorageVolDelete' type='function'/>
<exports symbol='virStorageVolFree' type='function'/>
<exports symbol='virConnectListInterfaces' type='function'/>
<exports symbol='virDomainMemoryPeek' type='function'/>
<exports symbol='virNetworkLookupByUUID' type='function'/>
<exports symbol='virConnectListDefinedNetworks' type='function'/>
<exports symbol='virConnectRef' type='function'/>
<exports symbol='virDomainGetUUID' type='function'/>
<exports symbol='virNetworkCreateXML' type='function'/>
<exports symbol='virConnectDomainEventRegister' type='function'/>
<exports symbol='virDomainGetVcpus' type='function'/>
<exports symbol='virNodeDeviceLookupByName' type='function'/>
<exports symbol='virStoragePoolGetInfo' type='function'/>
<exports symbol='virDomainResume' type='function'/>
<exports symbol='virNodeListDevices' type='function'/>
<exports symbol='virInterfaceRef' type='function'/>
<exports symbol='virInterfaceGetMACString' type='function'/>
<exports symbol='virNetworkRef' type='function'/>
<exports symbol='virStoragePoolRefresh' type='function'/>
<exports symbol='virConnectNumOfDefinedDomains' type='function'/>
<exports symbol='virStorageVolLookupByKey' type='function'/>
<exports symbol='virStorageVolCreateXMLFrom' type='function'/>
<exports symbol='virDomainUndefine' type='function'/>
<exports symbol='virDomainReboot' type='function'/>
<exports symbol='virNetworkGetUUIDString' type='function'/>
@ -295,10 +307,12 @@
<exports symbol='virNetworkUndefine' type='function'/>
<exports symbol='virConnectListDefinedStoragePools' type='function'/>
<exports symbol='virEventTimeoutCallback' type='function'/>
<exports symbol='virStorageVolCreateXMLFrom' type='function'/>
<exports symbol='virInterfaceFree' type='function'/>
<exports symbol='virNodeDeviceNumOfCaps' type='function'/>
<exports symbol='virInterfaceLookupByMACString' type='function'/>
<exports symbol='virNetworkGetConnect' type='function'/>
<exports symbol='virNodeGetFreeMemory' type='function'/>
<exports symbol='virInterfaceDestroy' type='function'/>
<exports symbol='virStorageVolGetConnect' type='function'/>
<exports symbol='virNodeNumOfDevices' type='function'/>
<exports symbol='virStoragePoolDestroy' type='function'/>
@ -310,108 +324,116 @@
<exports symbol='virDomainGetUUIDString' type='function'/>
<exports symbol='virDomainGetConnect' type='function'/>
<exports symbol='virConnectNumOfDefinedStoragePools' type='function'/>
<exports symbol='virNodeListDevices' type='function'/>
<exports symbol='virNodeDeviceGetParent' type='function'/>
<exports symbol='virConnectOpen' type='function'/>
<exports symbol='virDomainCreateXML' type='function'/>
<exports symbol='virNodeDeviceRef' type='function'/>
<exports symbol='virInterfaceUndefine' type='function'/>
<exports symbol='virDomainSetVcpus' type='function'/>
<exports symbol='virDomainRef' type='function'/>
<exports symbol='virConnectDomainEventRegister' type='function'/>
<exports symbol='virConnectNumOfInterfaces' type='function'/>
<exports symbol='virDomainGetID' type='function'/>
<exports symbol='virDomainBlockPeek' type='function'/>
<exports symbol='virEventAddTimeoutFunc' type='function'/>
<exports symbol='virInterfaceLookupByName' type='function'/>
<exports symbol='virDomainInterfaceStats' type='function'/>
<exports symbol='virConnectListNetworks' type='function'/>
<exports symbol='virStorageVolLookupByKey' type='function'/>
</file>
<file name='virterror'>
<summary>error handling interfaces for the libvirt library</summary>
<description>Provides the interfaces of the libvirt library to handle errors raised while using the library. </description>
<author>Daniel Veillard &lt;veillard@redhat.com&gt; </author>
<exports symbol='VIR_ERR_XML_ERROR' type='enum'/>
<exports symbol='VIR_ERR_RPC' type='enum'/>
<exports symbol='VIR_ERR_SYSTEM_ERROR' type='enum'/>
<exports symbol='VIR_FROM_TEST' type='enum'/>
<exports symbol='VIR_ERR_WARNING' type='enum'/>
<exports symbol='VIR_FROM_OPENVZ' type='enum'/>
<exports symbol='VIR_ERR_NO_XEN' type='enum'/>
<exports symbol='VIR_FROM_STATS_LINUX' type='enum'/>
<exports symbol='VIR_ERR_INVALID_ARG' type='enum'/>
<exports symbol='VIR_FROM_XEN_INOTIFY' type='enum'/>
<exports symbol='VIR_ERR_ERROR' type='enum'/>
<exports symbol='VIR_ERR_NO_OS' type='enum'/>
<exports symbol='VIR_FROM_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_NO_NODE_DEVICE' type='enum'/>
<exports symbol='VIR_ERR_NO_DEVICE' type='enum'/>
<exports symbol='VIR_ERR_NO_MEMORY' type='enum'/>
<exports symbol='VIR_FROM_SEXPR' type='enum'/>
<exports symbol='VIR_WAR_NO_NODE' type='enum'/>
<exports symbol='VIR_FROM_RPC' type='enum'/>
<exports symbol='VIR_FROM_UML' type='enum'/>
<exports symbol='VIR_ERR_INVALID_MAC' type='enum'/>
<exports symbol='VIR_ERR_NO_STORAGE_VOL' type='enum'/>
<exports symbol='VIR_FROM_NONE' type='enum'/>
<exports symbol='VIR_ERR_DOM_EXIST' type='enum'/>
<exports symbol='VIR_ERR_NO_XENSTORE' type='enum'/>
<exports symbol='VIR_FROM_DOM' type='enum'/>
<exports symbol='VIR_ERR_INVALID_DOMAIN' type='enum'/>
<exports symbol='VIR_ERR_NO_STORAGE_POOL' type='enum'/>
<exports symbol='VIR_FROM_CONF' type='enum'/>
<exports symbol='VIR_ERR_INVALID_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_AUTH_FAILED' type='enum'/>
<exports symbol='VIR_FROM_XML' type='enum'/>
<exports symbol='VIR_ERR_OPERATION_DENIED' type='enum'/>
<exports symbol='VIR_FROM_VBOX' type='enum'/>
<exports symbol='VIR_FROM_STORAGE' type='enum'/>
<exports symbol='VIR_ERR_NO_KERNEL' type='enum'/>
<exports symbol='VIR_WAR_NO_STORAGE' type='enum'/>
<exports symbol='VIR_ERR_GNUTLS_ERROR' type='enum'/>
<exports symbol='VIR_ERR_PARSE_FAILED' type='enum'/>
<exports symbol='VIR_ERR_POST_FAILED' type='enum'/>
<exports symbol='VIR_ERR_OS_TYPE' type='enum'/>
<exports symbol='VIR_ERR_OPERATION_INVALID' type='enum'/>
<exports symbol='VIR_WAR_NO_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_INVALID_CONN' type='enum'/>
<exports symbol='VIR_ERR_GET_FAILED' type='enum'/>
<exports symbol='VIR_ERR_NO_SOURCE' type='enum'/>
<exports symbol='VIR_ERR_NETWORK_EXIST' 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_REMOTE' type='enum'/>
<exports symbol='VIR_FROM_XEN_INOTIFY' type='enum'/>
<exports symbol='VIR_ERR_NO_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_READ_FAILED' type='enum'/>
<exports symbol='VIR_FROM_INTERFACE' type='enum'/>
<exports symbol='VIR_ERR_NO_CONNECT' type='enum'/>
<exports symbol='VIR_ERR_CALL_FAILED' type='enum'/>
<exports symbol='VIR_FROM_VBOX' type='enum'/>
<exports symbol='VIR_FROM_TEST' type='enum'/>
<exports symbol='VIR_ERR_NO_DEVICE' type='enum'/>
<exports symbol='VIR_FROM_SEXPR' type='enum'/>
<exports symbol='VIR_ERR_INVALID_MAC' type='enum'/>
<exports symbol='VIR_ERR_HTTP_ERROR' type='enum'/>
<exports symbol='VIR_ERR_NO_XENSTORE' type='enum'/>
<exports symbol='VIR_FROM_XEND' type='enum'/>
<exports symbol='VIR_FROM_STATS_LINUX' type='enum'/>
<exports symbol='VIR_FROM_OPENVZ' type='enum'/>
<exports symbol='VIR_ERR_OS_TYPE' type='enum'/>
<exports symbol='VIR_WAR_NO_NETWORK' type='enum'/>
<exports symbol='VIR_FROM_UML' 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'/>
<exports symbol='VIR_ERR_GET_FAILED' type='enum'/>
<exports symbol='VIR_FROM_NODEDEV' type='enum'/>
<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_ERR_PARSE_FAILED' type='enum'/>
<exports symbol='VIR_ERR_NO_SOURCE' type='enum'/>
<exports symbol='VIR_FROM_DOMAIN' type='enum'/>
<exports symbol='VIR_ERR_NO_TARGET' type='enum'/>
<exports symbol='VIR_ERR_NETWORK_EXIST' type='enum'/>
<exports symbol='VIR_FROM_SECURITY' type='enum'/>
<exports symbol='VIR_ERR_WRITE_FAILED' type='enum'/>
<exports symbol='VIR_ERR_INTERNAL_ERROR' type='enum'/>
<exports symbol='VIR_ERR_CONF_SYNTAX' type='enum'/>
<exports symbol='VIR_ERR_INVALID_STORAGE_POOL' type='enum'/>
<exports symbol='VIR_FROM_REMOTE' type='enum'/>
<exports symbol='VIR_ERR_NO_SUPPORT' type='enum'/>
<exports symbol='VIR_ERR_NO_SECURITY_MODEL' type='enum'/>
<exports symbol='VIR_FROM_QEMU' type='enum'/>
<exports symbol='VIR_FROM_XEND' type='enum'/>
<exports symbol='VIR_ERR_INVALID_STORAGE_VOL' type='enum'/>
<exports symbol='VIR_FROM_PROXY' type='enum'/>
<exports symbol='VIR_ERR_NO_NETWORK' type='enum'/>
<exports symbol='VIR_ERR_NO_DOMAIN' type='enum'/>
<exports symbol='VIR_ERR_READ_FAILED' type='enum'/>
<exports symbol='VIR_ERR_SEXPR_SERIAL' type='enum'/>
<exports symbol='VIR_FROM_LXC' type='enum'/>
<exports symbol='VIR_FROM_XEN' type='enum'/>
<exports symbol='VIR_FROM_XENSTORE' type='enum'/>
<exports symbol='VIR_ERR_OPEN_FAILED' type='enum'/>
<exports symbol='VIR_ERR_NO_OS' type='enum'/>
<exports symbol='VIR_FROM_RPC' type='enum'/>
<exports symbol='VIR_FROM_NONE' type='enum'/>
<exports symbol='VIR_FROM_DOM' type='enum'/>
<exports symbol='VIR_ERR_INVALID_DOMAIN' type='enum'/>
<exports symbol='VIR_ERR_OPERATION_INVALID' type='enum'/>
<exports symbol='VIR_WAR_NO_STORAGE' type='enum'/>
<exports symbol='VIR_ERR_GNUTLS_ERROR' type='enum'/>
<exports symbol='VIR_ERR_XML_ERROR' type='enum'/>
<exports symbol='VIR_ERR_OK' type='enum'/>
<exports symbol='VIR_ERR_INVALID_INTERFACE' type='enum'/>
<exports symbol='VIR_FROM_STORAGE' type='enum'/>
<exports symbol='VIR_FROM_PROXY' type='enum'/>
<exports symbol='VIR_ERR_DRIVER_FULL' type='enum'/>
<exports symbol='VIR_FROM_DOMAIN' type='enum'/>
<exports symbol='VIR_FROM_XML' type='enum'/>
<exports symbol='VIR_ERR_OPERATION_DENIED' type='enum'/>
<exports symbol='VIR_ERR_INVALID_STORAGE_POOL' type='enum'/>
<exports symbol='VIR_ERR_NO_DOMAIN' type='enum'/>
<exports symbol='VIR_FROM_XEN' type='enum'/>
<exports symbol='VIR_ERR_RPC' type='enum'/>
<exports symbol='VIR_ERR_WARNING' type='enum'/>
<exports symbol='VIR_ERR_INVALID_ARG' type='enum'/>
<exports symbol='VIR_ERR_ERROR' type='enum'/>
<exports symbol='VIR_WAR_NO_INTERFACE' type='enum'/>
<exports symbol='VIR_ERR_DOM_EXIST' type='enum'/>
<exports symbol='VIR_FROM_LXC' type='enum'/>
<exports symbol='VIR_ERR_NO_STORAGE_POOL' type='enum'/>
<exports symbol='VIR_ERR_NO_KERNEL' type='enum'/>
<exports symbol='VIR_ERR_NO_INTERFACE' type='enum'/>
<exports symbol='VIR_ERR_XML_DETAIL' type='enum'/>
<exports symbol='VIR_FROM_NET' type='enum'/>
<exports symbol='VIR_ERR_AUTH_FAILED' type='enum'/>
<exports symbol='VIR_ERR_INVALID_NODE_DEVICE' type='enum'/>
<exports symbol='VIR_ERR_SYSTEM_ERROR' type='enum'/>
<exports symbol='VIR_FROM_QEMU' type='enum'/>
<exports symbol='VIR_ERR_WRITE_FAILED' type='enum'/>
<exports symbol='VIR_ERR_INTERNAL_ERROR' type='enum'/>
<exports symbol='VIR_FROM_XENXM' type='enum'/>
<exports symbol='VIR_ERR_INVALID_STORAGE_VOL' type='enum'/>
<exports symbol='VIR_ERR_XEN_CALL' type='enum'/>
<exports symbol='VIR_ERR_UNKNOWN_HOST' type='enum'/>
<exports symbol='VIR_ERR_NO_CONNECT' type='enum'/>
<exports symbol='VIR_ERR_CALL_FAILED' type='enum'/>
<exports symbol='virErrorPtr' type='typedef'/>
<exports symbol='virErrorLevel' type='typedef'/>
<exports symbol='virErrorDomain' type='typedef'/>
@ -554,6 +576,7 @@
<enum name='VIR_ERR_INVALID_ARG' file='virterror' value='8' type='virErrorNumber' info='invalid function argument'/>
<enum name='VIR_ERR_INVALID_CONN' file='virterror' value='6' type='virErrorNumber' info='invalid connection object'/>
<enum name='VIR_ERR_INVALID_DOMAIN' file='virterror' value='7' type='virErrorNumber' info='invalid domain object'/>
<enum name='VIR_ERR_INVALID_INTERFACE' file='virterror' value='58' type='virErrorNumber' info=' invalid interface object'/>
<enum name='VIR_ERR_INVALID_MAC' file='virterror' value='44' type='virErrorNumber' info='invalid MAC address'/>
<enum name='VIR_ERR_INVALID_NETWORK' file='virterror' value='36' type='virErrorNumber' info='invalid network object'/>
<enum name='VIR_ERR_INVALID_NODE_DEVICE' file='virterror' value='52' type='virErrorNumber' info='invalid node device object'/>
@ -564,6 +587,7 @@
<enum name='VIR_ERR_NO_CONNECT' file='virterror' value='5' type='virErrorNumber' info='can&apos;t connect to hypervisor'/>
<enum name='VIR_ERR_NO_DEVICE' file='virterror' value='23' type='virErrorNumber' info='missing domain devices information'/>
<enum name='VIR_ERR_NO_DOMAIN' file='virterror' value='42' type='virErrorNumber' info='domain not found or unexpectedly disappeared'/>
<enum name='VIR_ERR_NO_INTERFACE' file='virterror' value='57' type='virErrorNumber' info='interface driver not running'/>
<enum name='VIR_ERR_NO_KERNEL' file='virterror' value='17' type='virErrorNumber' info='missing kernel information'/>
<enum name='VIR_ERR_NO_MEMORY' file='virterror' value='2' type='virErrorNumber' info='memory allocation failure'/>
<enum name='VIR_ERR_NO_NAME' file='virterror' value='21' type='virErrorNumber' info='missing domain name information'/>
@ -583,7 +607,7 @@
<enum name='VIR_ERR_OPEN_FAILED' file='virterror' value='30' type='virErrorNumber' info='failed to open a conf file'/>
<enum name='VIR_ERR_OPERATION_DENIED' file='virterror' value='29' type='virErrorNumber' info='operation forbidden on read-only connections'/>
<enum name='VIR_ERR_OPERATION_FAILED' file='virterror' value='9' type='virErrorNumber' info='a command to hypervisor failed'/>
<enum name='VIR_ERR_OPERATION_INVALID' file='virterror' value='55' type='virErrorNumber' info=' operation is not applicable at this time'/>
<enum name='VIR_ERR_OPERATION_INVALID' file='virterror' value='55' type='virErrorNumber' info='operation is not applicable at this time'/>
<enum name='VIR_ERR_OS_TYPE' file='virterror' value='16' type='virErrorNumber' info='unknown OS type'/>
<enum name='VIR_ERR_PARSE_FAILED' file='virterror' value='32' type='virErrorNumber' info='failed to parse a conf file'/>
<enum name='VIR_ERR_POST_FAILED' file='virterror' value='11' type='virErrorNumber' info='a HTTP POST command to failed'/>
@ -604,6 +628,7 @@
<enum name='VIR_FROM_CONF' file='virterror' value='9' type='virErrorDomain' info='Error in the configuration file handling'/>
<enum name='VIR_FROM_DOM' file='virterror' value='6' type='virErrorDomain' info='Error when operating on a domain'/>
<enum name='VIR_FROM_DOMAIN' file='virterror' value='20' type='virErrorDomain' info='Error from domain config'/>
<enum name='VIR_FROM_INTERFACE' file='virterror' value='26' type='virErrorDomain' info=' Error when operating on an interface'/>
<enum name='VIR_FROM_LXC' file='virterror' value='17' type='virErrorDomain' info='Error from Linux Container driver'/>
<enum name='VIR_FROM_NET' file='virterror' value='11' type='virErrorDomain' info='Error when operating on a network'/>
<enum name='VIR_FROM_NETWORK' file='virterror' value='19' type='virErrorDomain' info='Error from network config'/>
@ -620,7 +645,7 @@
<enum name='VIR_FROM_STORAGE' file='virterror' value='18' type='virErrorDomain' info='Error from storage driver'/>
<enum name='VIR_FROM_TEST' file='virterror' value='12' type='virErrorDomain' info='Error from test driver'/>
<enum name='VIR_FROM_UML' file='virterror' value='21' type='virErrorDomain' info='Error at the UML driver'/>
<enum name='VIR_FROM_VBOX' file='virterror' value='25' type='virErrorDomain' info=' Error from VirtualBox driver'/>
<enum name='VIR_FROM_VBOX' file='virterror' value='25' type='virErrorDomain' info='Error from VirtualBox driver'/>
<enum name='VIR_FROM_XEN' file='virterror' value='1' type='virErrorDomain' info='Error at Xen hypervisor layer'/>
<enum name='VIR_FROM_XEND' file='virterror' value='2' type='virErrorDomain' info='Error at connection with xend daemon'/>
<enum name='VIR_FROM_XENSTORE' file='virterror' value='3' type='virErrorDomain' info='Error at connection with xen store'/>
@ -645,6 +670,7 @@
<enum name='VIR_VCPU_BLOCKED' file='libvirt' value='2' type='virVcpuState' info=' the virtual CPU is blocked on resource'/>
<enum name='VIR_VCPU_OFFLINE' file='libvirt' value='0' type='virVcpuState' info='the virtual CPU is offline'/>
<enum name='VIR_VCPU_RUNNING' file='libvirt' value='1' type='virVcpuState' info='the virtual CPU is running'/>
<enum name='VIR_WAR_NO_INTERFACE' file='virterror' value='56' type='virErrorNumber' info='failed to start interface driver'/>
<enum name='VIR_WAR_NO_NETWORK' file='virterror' value='41' type='virErrorNumber' info='failed to start network'/>
<enum name='VIR_WAR_NO_NODE' file='virterror' value='51' type='virErrorNumber' info='failed to start node driver'/>
<enum name='VIR_WAR_NO_STORAGE' file='virterror' value='48' type='virErrorNumber' info='failed to start storage'/>
@ -741,6 +767,10 @@ see note above'/>
<typedef name='virErrorNumber' file='virterror' type='enum'/>
<typedef name='virErrorPtr' file='virterror' type='virError *'/>
<typedef name='virEventHandleType' file='libvirt' type='enum'/>
<struct name='virInterface' file='libvirt' type='struct _virInterface'/>
<typedef name='virInterfacePtr' file='libvirt' type='virInterface *'>
<info>a virInterfacePtr is pointer to a virInterface private structure, this is the type used to reference a virtual interface in the API.</info>
</typedef>
<struct name='virNetwork' file='libvirt' type='struct _virNetwork'/>
<typedef name='virNetworkPtr' file='libvirt' type='virNetwork *'>
<info>a virNetworkPtr is pointer to a virNetwork private structure, this is the type used to reference a virtual network in the API.</info>
@ -871,6 +901,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&apos;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.'/>
@ -939,6 +985,13 @@ see note above'/>
<arg name='ids' type='int *' info='array to collect the list of IDs of active domains'/>
<arg name='maxids' type='int' info='size of @ids'/>
</function>
<function name='virConnectListInterfaces' file='libvirt' module='libvirt'>
<info>Collect the list of physical host interfaces, and store their names in @names</info>
<return type='int' info='the number of interfaces found or -1 in case of error'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='names' type='char ** const' info='array to collect the list of names of interfaces'/>
<arg name='maxnames' type='int' info='size of @names'/>
</function>
<function name='virConnectListNetworks' file='libvirt' module='libvirt'>
<info>Collect the list of active networks, and store their names in @names</info>
<return type='int' info='the number of networks found or -1 in case of error'/>
@ -973,6 +1026,11 @@ see note above'/>
<return type='int' info='the number of domain found or -1 in case of error'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
<function name='virConnectNumOfInterfaces' file='libvirt' module='libvirt'>
<info>Provides the number of interfaces on the physical host.</info>
<return type='int' info='the number of interface found or -1 in case of error'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
<function name='virConnectNumOfNetworks' file='libvirt' module='libvirt'>
<info>Provides the number of active networks.</info>
<return type='int' info='the number of network found or -1 in case of error'/>
@ -1402,6 +1460,73 @@ see note above'/>
<info>Initialize the library. It&apos;s better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library.</info>
<return type='int' info='0 in case of success, -1 in case of error'/>
</function>
<function name='virInterfaceCreate' file='libvirt' module='libvirt'>
<info>Activate an interface (ie call &quot;ifup&quot;)</info>
<return type='int' info='0 in case of success, -1 in case of error'/>
<arg name='interface' type='virInterfacePtr' info='pointer to a defined interface'/>
<arg name='flags' type='unsigned int' info='and OR&apos;ed set of extraction flags, not used yet'/>
</function>
<function name='virInterfaceDefineXML' file='libvirt' module='libvirt'>
<info>Define an interface (or modify existing interface configuration)</info>
<return type='virInterfacePtr' info='NULL in case of error, a pointer to the interface otherwise'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='xml' type='const char *' info='the XML description for the interface, preferably in UTF-8'/>
<arg name='flags' type='unsigned int' info='and OR&apos;ed set of extraction flags, not used yet'/>
</function>
<function name='virInterfaceDestroy' file='libvirt' module='libvirt'>
<info>deactivate an interface (ie call &quot;ifdown&quot;) This does not remove the interface from the config, and does not free the associated virInterfacePtr object.</info>
<return type='int' info='0 in case of success and -1 in case of failure.'/>
<arg name='interface' type='virInterfacePtr' info='an interface object'/>
<arg name='flags' type='unsigned int' info='and OR&apos;ed set of extraction flags, not used yet'/>
</function>
<function name='virInterfaceFree' file='libvirt' module='libvirt'>
<info>Free the interface object. The interface itself is unaltered. The data structure is freed and should not be used thereafter.</info>
<return type='int' info='0 in case of success and -1 in case of failure.'/>
<arg name='interface' type='virInterfacePtr' info='a interface object'/>
</function>
<function name='virInterfaceGetConnect' file='libvirt' module='libvirt'>
<info>Provides the connection pointer associated with an interface. 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 interface object together.</info>
<return type='virConnectPtr' info='the virConnectPtr or NULL in case of failure.'/>
<arg name='interface' type='virInterfacePtr' info=''/>
</function>
<function name='virInterfaceGetMACString' file='libvirt' module='libvirt'>
<info>Get the MAC for a interface as string. For more information about MAC see RFC4122.</info>
<return type='const char *' info='a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.'/>
<arg name='interface' type='virInterfacePtr' info='a interface object'/>
</function>
<function name='virInterfaceGetName' file='libvirt' module='libvirt'>
<info>Get the public name for that interface</info>
<return type='const char *' info='a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the interface object.'/>
<arg name='interface' type='virInterfacePtr' info='a interface object'/>
</function>
<function name='virInterfaceGetXMLDesc' file='libvirt' module='libvirt'>
<info>Provide an XML description of the interface. The description may be reused later to recreate the interface with virInterfaceCreateXML().</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='interface' type='virInterfacePtr' info='a interface object'/>
<arg name='flags' type='unsigned int' info='and OR&apos;ed set of extraction flags, not used yet'/>
</function>
<function name='virInterfaceLookupByMACString' file='libvirt' module='libvirt'>
<info>Try to lookup an interface on the given hypervisor based on its MAC.</info>
<return type='virInterfacePtr' info='a new interface object or NULL in case of failure. If the interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='macstr' type='const char *' info='the MAC for the interface (null-terminated ASCII format)'/>
</function>
<function name='virInterfaceLookupByName' file='libvirt' module='libvirt'>
<info>Try to lookup an interface on the given hypervisor based on its name.</info>
<return type='virInterfacePtr' info='a new interface object or NULL in case of failure. If the interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='name' type='const char *' info='name for the interface'/>
</function>
<function name='virInterfaceRef' file='libvirt' module='libvirt'>
<info>Increment the reference count on the interface. For each additional call to this method, there shall be a corresponding call to virInterfaceFree 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 interface would increment the reference count.</info>
<return type='int' info='0 in case of success, -1 in case of failure.'/>
<arg name='interface' type='virInterfacePtr' info='the interface to hold a reference on'/>
</function>
<function name='virInterfaceUndefine' file='libvirt' module='libvirt'>
<info>Undefine an interface, ie remove it from the config. This does not free the associated virInterfacePtr object.</info>
<return type='int' info='0 in case of success, -1 in case of error'/>
<arg name='interface' type='virInterfacePtr' info='pointer to a defined interface'/>
</function>
<function name='virNetworkCreate' file='libvirt' module='libvirt'>
<info>Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.</info>
<return type='int' info='0 in case of success, -1 in case of error'/>

File diff suppressed because it is too large Load Diff

View File

@ -591,6 +591,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,
virDomainBlockStatsPtr stats,

View File

@ -591,6 +591,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,
virDomainBlockStatsPtr stats,

View File

@ -152,6 +152,16 @@ typedef int
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;

View File

@ -2730,6 +2730,111 @@ error:
return NULL;
}
/**
* 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

View File

@ -264,8 +264,6 @@ LIBVIRT_0.6.3 {
virNodeDeviceDestroy;
} LIBVIRT_0.6.1;
# .... define new API here using predicted next version number ....
LIBVIRT_0.6.4 {
global:
virInterfaceGetConnect;
@ -283,4 +281,8 @@ LIBVIRT_0.6.4 {
virInterfaceCreate;
virInterfaceDestroy;
virStorageVolCreateXMLFrom;
virConnectDomainXMLFromNative;
virConnectDomainXMLToNative;
} LIBVIRT_0.6.3;
# .... define new API here using predicted next version number ....

View File

@ -1457,6 +1457,8 @@ static virDriver lxcDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
lxcDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
lxcListDefinedDomains, /* listDefinedDomains */
lxcNumDefinedDomains, /* numOfDefinedDomains */
lxcDomainStart, /* domainCreate */

View File

@ -1344,6 +1344,8 @@ static virDriver openvzDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
openvzDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
openvzListDefinedDomains, /* listDefinedDomains */
openvzNumDefinedDomains, /* numOfDefinedDomains */
openvzDomainCreate, /* domainCreate */

View File

@ -5224,6 +5224,8 @@ static virDriver qemuDriver = {
qemudDomainGetSecurityLabel, /* domainGetSecurityLabel */
qemudNodeGetSecurityModel, /* nodeGetSecurityModel */
qemudDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
qemudListDefinedDomains, /* listDefinedDomains */
qemudNumDefinedDomains, /* numOfDefinedDomains */
qemudDomainStart, /* domainCreate */

View File

@ -7301,6 +7301,8 @@ static virDriver driver = {
remoteDomainGetSecurityLabel, /* domainGetSecurityLabel */
remoteNodeGetSecurityModel, /* nodeGetSecurityModel */
remoteDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
remoteListDefinedDomains, /* listDefinedDomains */
remoteNumOfDefinedDomains, /* numOfDefinedDomains */
remoteDomainCreate, /* domainCreate */

View File

@ -3591,6 +3591,8 @@ static virDriver testDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
testDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
testListDefinedDomains, /* listDefinedDomains */
testNumOfDefinedDomains, /* numOfDefinedDomains */
testDomainCreate, /* domainCreate */

View File

@ -1854,6 +1854,8 @@ static virDriver umlDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
umlDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
umlListDefinedDomains, /* listDefinedDomains */
umlNumDefinedDomains, /* numOfDefinedDomains */
umlDomainStart, /* domainCreate */

View File

@ -2209,6 +2209,98 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
return ret;
}
/*
* "domxml-from-native" command
*/
static const vshCmdInfo info_domxmlfromnative[] = {
{"help", gettext_noop("Convert native config to domain XML")},
{"desc", gettext_noop("Convert 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("Convert domain XML to native config")},
{"desc", gettext_noop("Convert 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;
}
/*
* "domname" command
*/
@ -6030,6 +6122,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,

View File

@ -1580,6 +1580,8 @@ static virDriver xenUnifiedDriver = {
NULL, /* domainGetSecurityLabel */
NULL, /* nodeGetSecurityModel */
xenUnifiedDomainDumpXML, /* domainDumpXML */
NULL, /* domainXmlFromNative */
NULL, /* domainXmlToNative */
xenUnifiedListDefinedDomains, /* listDefinedDomains */
xenUnifiedNumOfDefinedDomains, /* numOfDefinedDomains */
xenUnifiedDomainCreate, /* domainCreate */