mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Massive patch adding event APIs by Ben Guthro
* include/libvirt/libvirt.h include/libvirt/libvirt.h.in src/libvirt.c src/libvirt_sym.version: new libvirt event entry points, big patch provided by Ben Guthro * Makefile.am configure.in src/driver.h src/event.c src/event.h src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c src/remote_internal.c src/storage_backend_fs.c src/test.c qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h qemud/remote_protocol.c qemud/remote_protocol.h qemud/remote_protocol.x proxy/Makefile.am python/generator.py: Not much is left untouched by the patch adding the events support * docs/libvirt-api.xml docs/libvirt-refs.xml docs/html/libvirt-libvirt.html: regenerated the docs * examples/domain-events/events-c/Makefile.am examples/domain-events/events-c/event-test.c: a test example * AUTHORS: added Ben Guthro daniel
This commit is contained in:
parent
e10b79947a
commit
1509b8027f
1
AUTHORS
1
AUTHORS
@ -52,6 +52,7 @@ Patches have also been contributed by:
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Chris Wrigh <chrisw@redhat.com>
|
||||
Ben Guthro <bguthro@virtualiron.com>
|
||||
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
||||
Thu Oct 23 15:11:03 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* include/libvirt/libvirt.h include/libvirt/libvirt.h.in
|
||||
src/libvirt.c src/libvirt_sym.version: new libvirt event entry
|
||||
points, big patch provided by Ben Guthro
|
||||
* Makefile.am configure.in src/driver.h src/event.c src/event.h
|
||||
src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c
|
||||
src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c
|
||||
src/remote_internal.c src/storage_backend_fs.c src/test.c
|
||||
qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c
|
||||
qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h
|
||||
qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h
|
||||
qemud/remote_protocol.c qemud/remote_protocol.h
|
||||
qemud/remote_protocol.x proxy/Makefile.am python/generator.py:
|
||||
Not much is left untouched by the patch adding the events support
|
||||
* docs/libvirt-api.xml docs/libvirt-refs.xml
|
||||
docs/html/libvirt-libvirt.html: regenerated the docs
|
||||
* examples/domain-events/events-c/Makefile.am
|
||||
examples/domain-events/events-c/event-test.c: a test example
|
||||
* AUTHORS: added Ben Guthro
|
||||
|
||||
Thu Oct 23 13:41:49 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* docs/apps.html docs/apps.html.in: update monitoring apps section
|
||||
|
@ -4,7 +4,7 @@ LCOV = lcov
|
||||
GENHTML = genhtml
|
||||
|
||||
SUBDIRS = gnulib/lib include src qemud proxy docs gnulib/tests \
|
||||
python tests po
|
||||
python tests po examples/domain-events/events-c
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
|
||||
|
||||
|
@ -1067,7 +1067,8 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
tests/sexpr2xmldata/Makefile \
|
||||
tests/xmconfigdata/Makefile \
|
||||
tests/xencapsdata/Makefile \
|
||||
tests/virshdata/Makefile tests/confdata/Makefile)
|
||||
tests/virshdata/Makefile tests/confdata/Makefile \
|
||||
examples/domain-events/events-c/Makefile)
|
||||
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Configuration summary])
|
||||
|
@ -58,8 +58,9 @@ typedef struct _virConnect <a href="#virConnect">virConnect</a>;
|
||||
typedef struct _virVcpuInfo <a href="#virVcpuInfo">virVcpuInfo</a>;
|
||||
typedef struct _virDomainInfo <a href="#virDomainInfo">virDomainInfo</a>;
|
||||
typedef enum <a href="#virStoragePoolDeleteFlags">virStoragePoolDeleteFlags</a>;
|
||||
typedef enum <a href="#virEventHandleType">virEventHandleType</a>;
|
||||
typedef struct _virStoragePool <a href="#virStoragePool">virStoragePool</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virStoragePool">virStoragePool</a> * <a href="#virStoragePoolPtr">virStoragePoolPtr</a>;
|
||||
typedef enum <a href="#virDomainEventType">virDomainEventType</a>;
|
||||
typedef struct _virDomainInterfaceStats <a href="#virDomainInterfaceStatsStruct">virDomainInterfaceStatsStruct</a>;
|
||||
typedef struct _virStoragePoolInfo <a href="#virStoragePoolInfo">virStoragePoolInfo</a>;
|
||||
typedef enum <a href="#virDomainState">virDomainState</a>;
|
||||
@ -69,6 +70,7 @@ typedef <a href="libvirt-libvirt.html#virConnectAuth">virConnectAuth</a> * <a hr
|
||||
typedef struct _virStorageVolInfo <a href="#virStorageVolInfo">virStorageVolInfo</a>;
|
||||
typedef enum <a href="#virSchedParameterType">virSchedParameterType</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virConnectCredential">virConnectCredential</a> * <a href="#virConnectCredentialPtr">virConnectCredentialPtr</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virStoragePool">virStoragePool</a> * <a href="#virStoragePoolPtr">virStoragePoolPtr</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virNodeInfo">virNodeInfo</a> * <a href="#virNodeInfoPtr">virNodeInfoPtr</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virNetwork">virNetwork</a> * <a href="#virNetworkPtr">virNetworkPtr</a>;
|
||||
typedef <a href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a> * <a href="#virDomainInfoPtr">virDomainInfoPtr</a>;
|
||||
@ -95,14 +97,17 @@ typedef <a href="libvirt-libvirt.html#virStoragePoolInfo">virStoragePoolInfo</a>
|
||||
typedef enum <a href="#virDomainCreateFlags">virDomainCreateFlags</a>;
|
||||
char * <a href="#virStoragePoolGetXMLDesc">virStoragePoolGetXMLDesc</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags);
|
||||
const char * <a href="#virStorageVolGetKey">virStorageVolGetKey</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol);
|
||||
typedef void <a href="#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> (int timer, <br/> int timeout);
|
||||
int <a href="#virConnectClose">virConnectClose</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainDefineXML">virDomainDefineXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml);
|
||||
int <a href="#virDomainShutdown">virDomainShutdown</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
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="#virGetVersion">virGetVersion</a> (unsigned long * libVer, <br/> const char * type, <br/> unsigned long * typeVer);
|
||||
int <a href="#virNodeGetCellsFreeMemory">virNodeGetCellsFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned long long * freeMems, <br/> int startCell, <br/> int maxCells);
|
||||
int <a href="#virInitialize">virInitialize</a> (void);
|
||||
int <a href="#virStoragePoolSetAutostart">virStoragePoolSetAutostart</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> int autostart);
|
||||
<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);
|
||||
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="#virDomainGetSchedulerParameters">virDomainGetSchedulerParameters</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> <a href="libvirt-libvirt.html#virSchedParameterPtr">virSchedParameterPtr</a> params, <br/> int * nparams);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainLookupByUUIDString">virDomainLookupByUUIDString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * uuidstr);
|
||||
int <a href="#virConnectNumOfDefinedNetworks">virConnectNumOfDefinedNetworks</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
@ -118,17 +123,18 @@ int <a href="#virDomainSetAutostart">virDomainSetAutostart</a> (<a href="libvir
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByName">virStorageVolLookupByName</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> const char * name);
|
||||
<a href="libvirt-libvirt.html#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);
|
||||
int <a href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned long memory);
|
||||
int <a href="#virInitialize">virInitialize</a> (void);
|
||||
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#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);
|
||||
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
typedef void <a href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> (int fd, <br/> int event);
|
||||
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);
|
||||
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="#virStorageVolGetInfo">virStorageVolGetInfo</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br/> <a href="libvirt-libvirt.html#virStorageVolInfoPtr">virStorageVolInfoPtr</a> info);
|
||||
const char * <a href="#virNetworkGetName">virNetworkGetName</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
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);
|
||||
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);
|
||||
int <a href="#virNetworkGetAutostart">virNetworkGetAutostart</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int * autostart);
|
||||
@ -150,16 +156,17 @@ int <a href="#virStoragePoolFree">virStoragePoolFree</a> (<a href="libvirt-libv
|
||||
int <a href="#virDomainBlockStats">virDomainBlockStats</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> const char * path, <br/> <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br/> size_t size);
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpenAuth">virConnectOpenAuth</a> (const char * name, <br/> <a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> auth, <br/> int flags);
|
||||
int <a href="#virStoragePoolDelete">virStoragePoolDelete</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags);
|
||||
int <a href="#virDomainResume">virDomainResume</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
typedef int <a href="#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> (int fd);
|
||||
const char * <a href="#virStorageVolGetName">virStorageVolGetName</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol);
|
||||
int <a href="#virStoragePoolGetAutostart">virStoragePoolGetAutostart</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> int * autostart);
|
||||
int <a href="#virDomainGetAutostart">virDomainGetAutostart</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> int * autostart);
|
||||
int <a href="#virStoragePoolListVolumes">virStoragePoolListVolumes</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> char ** const names, <br/> int maxnames);
|
||||
char * <a href="#virConnectGetHostname">virConnectGetHostname</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
typedef int <a href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> (int timer);
|
||||
const char * <a href="#virDomainGetName">virDomainGetName</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainLookupByName">virDomainLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * name);
|
||||
@ -168,7 +175,9 @@ int <a href="#virDomainPinVcpu">virDomainPinVcpu</a> (<a href="libvirt-libvirt.
|
||||
int <a href="#virDomainRestore">virDomainRestore</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * from);
|
||||
char * <a href="#virStorageVolGetPath">virStorageVolGetPath</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol);
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByUUIDString">virNetworkLookupByUUIDString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * uuidstr);
|
||||
typedef int <a href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> int event, <br/> void * opaque);
|
||||
<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="#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);
|
||||
@ -178,6 +187,7 @@ int <a href="#virDomainGetUUID">virDomainGetUUID</a> (<a href="libvirt-libvirt.
|
||||
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#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="#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="#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);
|
||||
@ -186,6 +196,7 @@ int <a href="#virDomainReboot">virDomainReboot</a> (<a href="libvirt-libvirt.h
|
||||
int <a href="#virNetworkGetUUIDString">virNetworkGetUUIDString</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> char * buf);
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByName">virNetworkLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * name);
|
||||
int <a href="#virDomainGetMaxVcpus">virDomainGetMaxVcpus</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
typedef void <a href="#virEventHandleCallback">virEventHandleCallback</a> (int fd, <br/> int events, <br/> void * opaque);
|
||||
char * <a href="#virDomainGetSchedulerType">virDomainGetSchedulerType</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> int * nparams);
|
||||
int <a href="#virDomainDetachDevice">virDomainDetachDevice</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> const char * xml);
|
||||
int <a href="#virStoragePoolNumOfVolumes">virStoragePoolNumOfVolumes</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
|
||||
@ -197,9 +208,10 @@ char * <a href="#virConnectGetURI">virConnectGetURI</a> (<a href="libvirt-libvi
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpenReadOnly">virConnectOpenReadOnly</a> (const char * name);
|
||||
int <a href="#virNetworkFree">virNetworkFree</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a href="#virStoragePoolLookupByUUID">virStoragePoolLookupByUUID</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const unsigned char * uuid);
|
||||
int <a href="#virStorageVolDelete">virStorageVolDelete</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br/> unsigned int flags);
|
||||
typedef int <a href="#virEventAddHandleFunc">virEventAddHandleFunc</a> (int fd, <br/> int event, <br/> <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br/> void * opaque);
|
||||
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#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);
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virStorageVolGetConnect">virStorageVolGetConnect</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol);
|
||||
@ -215,8 +227,10 @@ int <a href="#virConnectNumOfDefinedStoragePools">virConnectNumOfDefinedStorageP
|
||||
<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="#virDomainSetVcpus">virDomainSetVcpus</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned int nvcpus);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
</pre>
|
||||
@ -353,6 +367,19 @@ The content of this structure is not made public by the API.
|
||||
<a name="VIR_DOMAIN_NONE">VIR_DOMAIN_NONE</a> = 0
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainEventType">Enum </a>virDomainEventType</h3><pre class="programlisting">enum <a href="#virDomainEventType">virDomainEventType</a> {
|
||||
<a name="VIR_DOMAIN_EVENT_ADDED">VIR_DOMAIN_EVENT_ADDED</a> = 1
|
||||
<a name="VIR_DOMAIN_EVENT_REMOVED">VIR_DOMAIN_EVENT_REMOVED</a> = 2
|
||||
<a name="VIR_DOMAIN_EVENT_STARTED">VIR_DOMAIN_EVENT_STARTED</a> = 3
|
||||
<a name="VIR_DOMAIN_EVENT_SUSPENDED">VIR_DOMAIN_EVENT_SUSPENDED</a> = 4
|
||||
<a name="VIR_DOMAIN_EVENT_RESUMED">VIR_DOMAIN_EVENT_RESUMED</a> = 5
|
||||
<a name="VIR_DOMAIN_EVENT_STOPPED">VIR_DOMAIN_EVENT_STOPPED</a> = 6
|
||||
<a name="VIR_DOMAIN_EVENT_SAVED">VIR_DOMAIN_EVENT_SAVED</a> = 7
|
||||
<a name="VIR_DOMAIN_EVENT_RESTORED">VIR_DOMAIN_EVENT_RESTORED</a> = 8
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainInfo">Structure </a>virDomainInfo</h3><pre class="programlisting">struct _virDomainInfo {
|
||||
@ -419,6 +446,15 @@ The content of this structure is not made public by the API.
|
||||
<a name="VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a> = 2 /* dump inactive domain information */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventHandleType">Enum </a>virEventHandleType</h3><pre class="programlisting">enum <a href="#virEventHandleType">virEventHandleType</a> {
|
||||
<a name="VIR_EVENT_HANDLE_READABLE">VIR_EVENT_HANDLE_READABLE</a> = 1
|
||||
<a name="VIR_EVENT_HANDLE_WRITABLE">VIR_EVENT_HANDLE_WRITABLE</a> = 2
|
||||
<a name="VIR_EVENT_HANDLE_ERROR">VIR_EVENT_HANDLE_ERROR</a> = 4
|
||||
<a name="VIR_EVENT_HANDLE_HANGUP">VIR_EVENT_HANDLE_HANGUP</a> = 8
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virNetwork">Structure </a>virNetwork</h3><pre class="programlisting">struct _virNetwork {
|
||||
@ -577,6 +613,42 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectAuthCallbackPtr"/>Function type virConnectAuthCallbackPtr</h3><pre class="programlisting">int virConnectAuthCallbackPtr (<a href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a> cred, <br/> unsigned int ncred, <br/> void * cbdata)<br/>
|
||||
</pre><p/>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>cred</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ncred</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>cbdata</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventCallback"/>Function type virConnectDomainEventCallback</h3><pre class="programlisting">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/> void * opaque)<br/>
|
||||
</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>opaque</tt></i>:</span></td><td>opaque user data</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventAddHandleFunc"/>Function type virEventAddHandleFunc</h3><pre class="programlisting">int virEventAddHandleFunc (int fd, <br/> int event, <br/> <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br/> void * opaque)<br/>
|
||||
</pre><p>Part of the EventImpl, this callback Adds a file handle callback to listen for specific events</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to listen on</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>bitset of events on which to fire the callback</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>the callback to be called</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data to pass to the callback</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventAddTimeoutFunc"/>Function type virEventAddTimeoutFunc</h3><pre class="programlisting">int virEventAddTimeoutFunc (int timeout, <br/> <a href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a> cb, <br/> void * opaque)<br/>
|
||||
</pre><p>Part of the EventImpl, this user-defined callback handles adding an event timeout.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>timeout</tt></i>:</span></td><td>The timeout to monitor</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>the callback to call when timeout has expired</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data to pass to the callback</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a timer value</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventHandleCallback"/>Function type virEventHandleCallback</h3><pre class="programlisting">void virEventHandleCallback (int fd, <br/> int events, <br/> void * opaque)<br/>
|
||||
</pre><p>callback for receiving file handle events</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file handle on which the event occurred</td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td>bitset of events from <a href="libvirt-libvirt.html#virEventHandleType">virEventHandleType</a> constants</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data registered with handle</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventRemoveHandleFunc"/>Function type virEventRemoveHandleFunc</h3><pre class="programlisting">int virEventRemoveHandleFunc (int fd)<br/>
|
||||
</pre><p>Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to stop listening on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventRemoveTimeoutFunc"/>Function type virEventRemoveTimeoutFunc</h3><pre class="programlisting">int virEventRemoveTimeoutFunc (int timer)<br/>
|
||||
</pre><p>Part of the EventImpl, this user-defined callback removes a timer</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>timer</tt></i>:</span></td><td>the timer to remove</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventTimeoutCallback"/>Function type virEventTimeoutCallback</h3><pre class="programlisting">void virEventTimeoutCallback (int timer, <br/> void * opaque)<br/>
|
||||
</pre><p>callback for receiving timer events</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>timer</tt></i>:</span></td><td>timer id emitting the event</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data registered with handle</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventUpdateHandleFunc"/>Function type virEventUpdateHandleFunc</h3><pre class="programlisting">void virEventUpdateHandleFunc (int fd, <br/> int event)<br/>
|
||||
</pre><p>Part of the EventImpl, this user-provided callback is notified when events to listen on change</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to modify</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>new events to listen on</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventUpdateTimeoutFunc"/>Function type virEventUpdateTimeoutFunc</h3><pre class="programlisting">void virEventUpdateTimeoutFunc (int timer, <br/> int timeout)<br/>
|
||||
</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></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectAuthPtrDefault">Variable </a>virConnectAuthPtrDefault</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> virConnectAuthPtrDefault;
|
||||
</pre><p/>
|
||||
@ -585,6 +657,14 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectClose"/>virConnectClose ()</h3><pre class="programlisting">int virConnectClose (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventDeregister"/>virConnectDomainEventDeregister ()</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></div>
|
||||
<hr/>
|
||||
<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/>
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</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>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</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>
|
||||
@ -853,6 +933,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainUndefine"/>virDomainUndefine ()</h3><pre class="programlisting">int virDomainUndefine (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br/>
|
||||
</pre><p>Undefine a domain but does not stop it if it is running</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virEventRegisterImpl"/>virEventRegisterImpl ()</h3><pre class="programlisting">void virEventRegisterImpl (<a href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a> addHandle, <br/> <a href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> updateHandle, <br/> <a href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> removeHandle, <br/> <a href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> addTimeout, <br/> <a href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> updateTimeout, <br/> <a href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> removeTimeout)<br/>
|
||||
</pre><p/>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>addHandle</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>updateHandle</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>removeHandle</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>addTimeout</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>updateTimeout</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>removeTimeout</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virGetVersion"/>virGetVersion ()</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>
|
||||
|
@ -26,6 +26,7 @@ typedef struct _virDomain <a href="#virDomain">virDomain</a>
|
||||
typedef <a href="libvirt-libvirt.html#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a> * <a name="virDomainBlockStatsPtr" id="virDomainBlockStatsPtr">virDomainBlockStatsPtr</a>
|
||||
typedef struct _virDomainBlockStats <a href="#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a>
|
||||
typedef enum <a href="#virDomainCreateFlags">virDomainCreateFlags</a>
|
||||
typedef enum <a href="#virDomainEventType">virDomainEventType</a>
|
||||
typedef struct _virDomainInfo <a href="#virDomainInfo">virDomainInfo</a>
|
||||
typedef <a href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a> * <a name="virDomainInfoPtr" id="virDomainInfoPtr">virDomainInfoPtr</a>
|
||||
typedef <a href="libvirt-libvirt.html#virDomainInterfaceStatsStruct">virDomainInterfaceStatsStruct</a> * <a name="virDomainInterfaceStatsPtr" id="virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a>
|
||||
@ -35,6 +36,7 @@ typedef enum <a href="#virDomainMigrateFlags">virDomainMigrateFlags</a>
|
||||
typedef <a href="libvirt-libvirt.html#virDomain">virDomain</a> * <a name="virDomainPtr" id="virDomainPtr">virDomainPtr</a>
|
||||
typedef enum <a href="#virDomainState">virDomainState</a>
|
||||
typedef enum <a href="#virDomainXMLFlags">virDomainXMLFlags</a>
|
||||
typedef enum <a href="#virEventHandleType">virEventHandleType</a>
|
||||
typedef struct _virNetwork <a href="#virNetwork">virNetwork</a>
|
||||
typedef <a href="libvirt-libvirt.html#virNetwork">virNetwork</a> * <a name="virNetworkPtr" id="virNetworkPtr">virNetworkPtr</a>
|
||||
typedef struct _virNodeInfo <a href="#virNodeInfo">virNodeInfo</a>
|
||||
@ -62,6 +64,11 @@ typedef enum <a href="#virVcpuState">virVcpuState</a>
|
||||
int <a href="#virConnectAuthCallbackPtr">virConnectAuthCallbackPtr</a> (<a href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a> cred, <br /> unsigned int ncred, <br /> void * cbdata)
|
||||
|
||||
int <a href="#virConnectClose">virConnectClose</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
|
||||
typedef <a href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a>
|
||||
int <a href="#virConnectDomainEventCallback">virConnectDomainEventCallback</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> int event, <br /> void * opaque)
|
||||
|
||||
int <a href="#virConnectDomainEventDeregister">virConnectDomainEventDeregister</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb)
|
||||
int <a href="#virConnectDomainEventRegister">virConnectDomainEventRegister</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br /> void * opaque)
|
||||
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)
|
||||
@ -129,6 +136,31 @@ int <a href="#virDomainSetVcpus">virDomainSetVcpus</a> (<a href="libvirt-libvir
|
||||
int <a href="#virDomainShutdown">virDomainShutdown</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
|
||||
int <a href="#virDomainSuspend">virDomainSuspend</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
|
||||
int <a href="#virDomainUndefine">virDomainUndefine</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
|
||||
typedef <a href="#virEventAddHandleFunc">virEventAddHandleFunc</a>
|
||||
int <a href="#virEventAddHandleFunc">virEventAddHandleFunc</a> (int fd, <br /> int event, <br /> <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br /> void * opaque)
|
||||
|
||||
typedef <a href="#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a>
|
||||
int <a href="#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> (int timeout, <br /> <a href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a> cb, <br /> void * opaque)
|
||||
|
||||
typedef <a href="#virEventHandleCallback">virEventHandleCallback</a>
|
||||
void <a href="#virEventHandleCallback">virEventHandleCallback</a> (int fd, <br /> int events, <br /> void * opaque)
|
||||
|
||||
void <a href="#virEventRegisterImpl">virEventRegisterImpl</a> (<a href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a> addHandle, <br /> <a href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> updateHandle, <br /> <a href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> removeHandle, <br /> <a href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> addTimeout, <br /> <a href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> updateTimeout, <br /> <a href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> removeTimeout)
|
||||
typedef <a href="#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a>
|
||||
int <a href="#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> (int fd)
|
||||
|
||||
typedef <a href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a>
|
||||
int <a href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> (int timer)
|
||||
|
||||
typedef <a href="#virEventTimeoutCallback">virEventTimeoutCallback</a>
|
||||
void <a href="#virEventTimeoutCallback">virEventTimeoutCallback</a> (int timer, <br /> void * opaque)
|
||||
|
||||
typedef <a href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a>
|
||||
void <a href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> (int fd, <br /> int event)
|
||||
|
||||
typedef <a href="#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a>
|
||||
void <a href="#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> (int timer, <br /> int timeout)
|
||||
|
||||
int <a href="#virGetVersion">virGetVersion</a> (unsigned long * libVer, <br /> const char * type, <br /> unsigned long * typeVer)
|
||||
int <a href="#virInitialize">virInitialize</a> (void)
|
||||
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
|
||||
@ -207,6 +239,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
}
|
||||
</pre></div><h3><a name="virDomainCreateFlags" id="virDomainCreateFlags"><code>virDomainCreateFlags</code></a></h3><div class="api"><pre>enum virDomainCreateFlags {
|
||||
</pre><table><tr><td><a name="VIR_DOMAIN_NONE" id="VIR_DOMAIN_NONE">VIR_DOMAIN_NONE</a></td><td> = </td><td>0</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="virDomainEventType" id="virDomainEventType"><code>virDomainEventType</code></a></h3><div class="api"><pre>enum virDomainEventType {
|
||||
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_ADDED" id="VIR_DOMAIN_EVENT_ADDED">VIR_DOMAIN_EVENT_ADDED</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_REMOVED" id="VIR_DOMAIN_EVENT_REMOVED">VIR_DOMAIN_EVENT_REMOVED</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED" id="VIR_DOMAIN_EVENT_STARTED">VIR_DOMAIN_EVENT_STARTED</a></td><td> = </td><td>3</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED" id="VIR_DOMAIN_EVENT_SUSPENDED">VIR_DOMAIN_EVENT_SUSPENDED</a></td><td> = </td><td>4</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED" id="VIR_DOMAIN_EVENT_RESUMED">VIR_DOMAIN_EVENT_RESUMED</a></td><td> = </td><td>5</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED" id="VIR_DOMAIN_EVENT_STOPPED">VIR_DOMAIN_EVENT_STOPPED</a></td><td> = </td><td>6</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SAVED" id="VIR_DOMAIN_EVENT_SAVED">VIR_DOMAIN_EVENT_SAVED</a></td><td> = </td><td>7</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESTORED" id="VIR_DOMAIN_EVENT_RESTORED">VIR_DOMAIN_EVENT_RESTORED</a></td><td> = </td><td>8</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="virDomainInfo" id="virDomainInfo"><code>virDomainInfo</code></a></h3><div class="api"><pre>struct virDomainInfo{
|
||||
</pre><table><tr><td>unsigned char</td><td>state</td><td> : the running state, one of <a href="libvirt-libvirt.html#virDomainState">virDomainState</a></td></tr><tr><td>unsigned long</td><td>maxMem</td><td> : the maximum memory in KBytes allowed</td></tr><tr><td>unsigned long</td><td>memory</td><td> : the memory in KBytes used by the domain</td></tr><tr><td>unsigned short</td><td>nrVirtCpu</td><td> : the number of virtual CPUs for the domain</td></tr><tr><td>unsigned long long</td><td>cpuTime</td><td> : the CPU time used in nanoseconds</td></tr></table><pre>
|
||||
}
|
||||
@ -221,6 +255,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE" id="VIR_DOMAIN_NOSTATE">VIR_DOMAIN_NOSTATE</a></td><td> = </td><td>0</td><td> : no state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING" id="VIR_DOMAIN_RUNNING">VIR_DOMAIN_RUNNING</a></td><td> = </td><td>1</td><td> : the domain is running</td></tr><tr><td><a name="VIR_DOMAIN_BLOCKED" id="VIR_DOMAIN_BLOCKED">VIR_DOMAIN_BLOCKED</a></td><td> = </td><td>2</td><td> : the domain is blocked on resource</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED" id="VIR_DOMAIN_PAUSED">VIR_DOMAIN_PAUSED</a></td><td> = </td><td>3</td><td> : the domain is paused by user</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN" id="VIR_DOMAIN_SHUTDOWN">VIR_DOMAIN_SHUTDOWN</a></td><td> = </td><td>4</td><td> : the domain is being shut down</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF" id="VIR_DOMAIN_SHUTOFF">VIR_DOMAIN_SHUTOFF</a></td><td> = </td><td>5</td><td> : the domain is shut off</td></tr><tr><td><a name="VIR_DOMAIN_CRASHED" id="VIR_DOMAIN_CRASHED">VIR_DOMAIN_CRASHED</a></td><td> = </td><td>6</td><td> : the domain is crashed</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="virDomainXMLFlags" id="virDomainXMLFlags"><code>virDomainXMLFlags</code></a></h3><div class="api"><pre>enum virDomainXMLFlags {
|
||||
</pre><table><tr><td><a name="VIR_DOMAIN_XML_SECURE" id="VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a></td><td> = </td><td>1</td><td> : dump security sensitive information too</td></tr><tr><td><a name="VIR_DOMAIN_XML_INACTIVE" id="VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a></td><td> = </td><td>2</td><td> : dump inactive domain information</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="virEventHandleType" id="virEventHandleType"><code>virEventHandleType</code></a></h3><div class="api"><pre>enum virEventHandleType {
|
||||
</pre><table><tr><td><a name="VIR_EVENT_HANDLE_READABLE" id="VIR_EVENT_HANDLE_READABLE">VIR_EVENT_HANDLE_READABLE</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_EVENT_HANDLE_WRITABLE" id="VIR_EVENT_HANDLE_WRITABLE">VIR_EVENT_HANDLE_WRITABLE</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_EVENT_HANDLE_ERROR" id="VIR_EVENT_HANDLE_ERROR">VIR_EVENT_HANDLE_ERROR</a></td><td> = </td><td>4</td></tr><tr><td><a name="VIR_EVENT_HANDLE_HANGUP" id="VIR_EVENT_HANDLE_HANGUP">VIR_EVENT_HANDLE_HANGUP</a></td><td> = </td><td>8</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="virNetwork" id="virNetwork"><code>virNetwork</code></a></h3><div class="api"><pre>struct virNetwork{
|
||||
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
|
||||
}
|
||||
@ -261,7 +297,10 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><table><tr><td><a name="VIR_VCPU_OFFLINE" id="VIR_VCPU_OFFLINE">VIR_VCPU_OFFLINE</a></td><td> = </td><td>0</td><td> : the virtual CPU is offline</td></tr><tr><td><a name="VIR_VCPU_RUNNING" id="VIR_VCPU_RUNNING">VIR_VCPU_RUNNING</a></td><td> = </td><td>1</td><td> : the virtual CPU is running</td></tr><tr><td><a name="VIR_VCPU_BLOCKED" id="VIR_VCPU_BLOCKED">VIR_VCPU_BLOCKED</a></td><td> = </td><td>2</td><td> : the virtual CPU is blocked on resource</td></tr></table><pre>}
|
||||
</pre></div><h3><a name="functions" id="functions">Functions</a></h3><h3><a name="virConnectAuthCallbackPtr" id="virConnectAuthCallbackPtr"><code>virConnectAuthCallbackPtr</code></a></h3><pre class="programlisting">typedef int (*virConnectAuthCallbackPtr) (<a href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a> cred, <br /> unsigned int ncred, <br /> void * cbdata)
|
||||
</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cred</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ncred</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>cbdata</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virConnectClose" id="virConnectClose"><code>virConnectClose</code></a></h3><pre class="programlisting">int virConnectClose (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
|
||||
</pre><p>This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="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>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 /> 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>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 />
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</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>Returns</tt></i>:</span></td><td>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>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 />
|
||||
@ -328,7 +367,16 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Dynamically change the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrary limited. This function requires privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>nvcpus</tt></i>:</span></td><td>the new number of virtual CPUs for this domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainShutdown" id="virDomainShutdown"><code>virDomainShutdown</code></a></h3><pre class="programlisting">int virDomainShutdown (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
|
||||
</pre><p>Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. Note that the guest OS may ignore the request. TODO: should we add an option for reboot, knowing it may not be doable in the general case ?</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSuspend" id="virDomainSuspend"><code>virDomainSuspend</code></a></h3><pre class="programlisting">int virDomainSuspend (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
|
||||
</pre><p>Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use virDomainResume() to reactivate the domain. This function may requires privileged access.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainUndefine" id="virDomainUndefine"><code>virDomainUndefine</code></a></h3><pre class="programlisting">int virDomainUndefine (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
|
||||
</pre><p>Undefine a domain but does not stop it if it is running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="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>Undefine a domain but does not stop it if it is running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virEventAddHandleFunc" id="virEventAddHandleFunc"><code>virEventAddHandleFunc</code></a></h3><pre class="programlisting">typedef int (*virEventAddHandleFunc ) (int fd, <br /> int event, <br /> <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br /> void * opaque)
|
||||
</pre><p>Part of the EventImpl, this callback Adds a file handle callback to listen for specific events</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to listen on</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>bitset of events on which to fire the callback</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>the callback to be called</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data to pass to the callback</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virEventAddTimeoutFunc" id="virEventAddTimeoutFunc"><code>virEventAddTimeoutFunc</code></a></h3><pre class="programlisting">typedef int (*virEventAddTimeoutFunc ) (int timeout, <br /> <a href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a> cb, <br /> void * opaque)
|
||||
</pre><p>Part of the EventImpl, this user-defined callback handles adding an event timeout.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>timeout</tt></i>:</span></td><td>The timeout to monitor</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>the callback to call when timeout has expired</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data to pass to the callback</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a timer value</td></tr></tbody></table></div><br /><h3><a name="virEventHandleCallback" id="virEventHandleCallback"><code>virEventHandleCallback</code></a></h3><pre class="programlisting">typedef void (*virEventHandleCallback ) (int fd, <br /> int events, <br /> void * opaque)
|
||||
</pre><p>callback for receiving file handle events</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file handle on which the event occurred</td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td>bitset of events from <a href="libvirt-libvirt.html#virEventHandleType">virEventHandleType</a> constants</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data registered with handle</td></tr></tbody></table></div><br /><h3><a name="virEventRegisterImpl" id="virEventRegisterImpl"><code>virEventRegisterImpl</code></a></h3><pre class="programlisting">void virEventRegisterImpl (<a href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a> addHandle, <br /> <a href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> updateHandle, <br /> <a href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> removeHandle, <br /> <a href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> addTimeout, <br /> <a href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> updateTimeout, <br /> <a href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> removeTimeout)<br />
|
||||
</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>addHandle</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>updateHandle</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>removeHandle</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>addTimeout</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>updateTimeout</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>removeTimeout</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virEventRemoveHandleFunc" id="virEventRemoveHandleFunc"><code>virEventRemoveHandleFunc</code></a></h3><pre class="programlisting">typedef int (*virEventRemoveHandleFunc) (int fd)
|
||||
</pre><p>Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to stop listening on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virEventRemoveTimeoutFunc" id="virEventRemoveTimeoutFunc"><code>virEventRemoveTimeoutFunc</code></a></h3><pre class="programlisting">typedef int (*virEventRemoveTimeoutFunc) (int timer)
|
||||
</pre><p>Part of the EventImpl, this user-defined callback removes a timer</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>timer</tt></i>:</span></td><td>the timer to remove</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><br /><h3><a name="virEventTimeoutCallback" id="virEventTimeoutCallback"><code>virEventTimeoutCallback</code></a></h3><pre class="programlisting">typedef void (*virEventTimeoutCallback ) (int timer, <br /> void * opaque)
|
||||
</pre><p>callback for receiving timer events</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>timer</tt></i>:</span></td><td>timer id emitting the event</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data registered with handle</td></tr></tbody></table></div><br /><h3><a name="virEventUpdateHandleFunc" id="virEventUpdateHandleFunc"><code>virEventUpdateHandleFunc</code></a></h3><pre class="programlisting">typedef void (*virEventUpdateHandleFunc) (int fd, <br /> int event)
|
||||
</pre><p>Part of the EventImpl, this user-provided callback is notified when events to listen on change</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to modify</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>new events to listen on</td></tr></tbody></table></div><br /><h3><a name="virEventUpdateTimeoutFunc" id="virEventUpdateTimeoutFunc"><code>virEventUpdateTimeoutFunc</code></a></h3><pre class="programlisting">typedef void (*virEventUpdateTimeoutFunc) (int timer, <br /> int timeout)
|
||||
</pre><p>Part of the EventImpl, this user-defined callback updates an event timeout.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>timer</tt></i>:</span></td><td>the timer to modify</td></tr><tr><td><span class="term"><i><tt>timeout</tt></i>:</span></td><td>the new timeout value</td></tr></tbody></table></div><br /><h3><a name="virGetVersion" id="virGetVersion"><code>virGetVersion</code></a></h3><pre class="programlisting">int virGetVersion (unsigned long * libVer, <br /> const char * type, <br /> unsigned long * typeVer)<br />
|
||||
</pre><p>Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, if @type is unknown or not available, an error code will be returned and @typeVer will be 0.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>libVer</tt></i>:</span></td><td>return value for the library version (OUT)</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the type of connection/driver looked at</td></tr><tr><td><span class="term"><i><tt>typeVer</tt></i>:</span></td><td>return value for the version of the hypervisor (OUT)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.</td></tr></tbody></table></div><h3><a name="virInitialize" id="virInitialize"><code>virInitialize</code></a></h3><pre class="programlisting">int virInitialize (void)<br />
|
||||
</pre><p>Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virNetworkCreate" id="virNetworkCreate"><code>virNetworkCreate</code></a></h3><pre class="programlisting">int virNetworkCreate (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br />
|
||||
</pre><p>Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>pointer to a defined network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virNetworkCreateXML" id="virNetworkCreateXML"><code>virNetworkCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkCreateXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * xmlDesc)<br />
|
||||
|
@ -18,48 +18,60 @@
|
||||
<exports symbol='VIR_UNUSE_CPU' type='macro'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_BUILD_REPAIR' type='enum'/>
|
||||
<exports symbol='VIR_CRED_EXTERNAL' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_ADDED' type='enum'/>
|
||||
<exports symbol='VIR_EVENT_HANDLE_READABLE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SHUTDOWN' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_UINT' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_BUILDING' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_SAVED' type='enum'/>
|
||||
<exports symbol='VIR_CRED_CNONCE' type='enum'/>
|
||||
<exports symbol='VIR_CRED_ECHOPROMPT' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_DOUBLE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_VOL_BLOCK' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_RESUMED' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_OFFLINE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_RUNNING' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_BUILD_RESIZE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_LLONG' type='enum'/>
|
||||
<exports symbol='VIR_CONNECT_RO' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_STOPPED' type='enum'/>
|
||||
<exports symbol='VIR_CRED_AUTHNAME' type='enum'/>
|
||||
<exports symbol='VIR_CRED_LANGUAGE' type='enum'/>
|
||||
<exports symbol='VIR_CRED_NOECHOPROMPT' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_BOOLEAN' type='enum'/>
|
||||
<exports symbol='VIR_MIGRATE_LIVE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_INACTIVE' type='enum'/>
|
||||
<exports symbol='VIR_CRED_USERNAME' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_OFFLINE' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_BLOCKED' type='enum'/>
|
||||
<exports symbol='VIR_MEMORY_VIRTUAL' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_REMOVED' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_RUNNING' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_BLOCKED' type='enum'/>
|
||||
<exports symbol='VIR_EVENT_HANDLE_ERROR' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_NOSTATE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SHUTOFF' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_BUILD_NEW' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_BLOCKED' type='enum'/>
|
||||
<exports symbol='VIR_EVENT_HANDLE_WRITABLE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_DELETE_NORMAL' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_VOL_DELETE_ZEROED' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_INT' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_SCHED_FIELD_ULLONG' type='enum'/>
|
||||
<exports symbol='VIR_CRED_REALM' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_STARTED' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_VOL_FILE' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_RUNNING' type='enum'/>
|
||||
<exports symbol='VIR_EVENT_HANDLE_HANGUP' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_PAUSED' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_DEGRADED' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_CRASHED' type='enum'/>
|
||||
<exports symbol='VIR_VCPU_RUNNING' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_XML_INACTIVE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_VOL_BLOCK' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_NONE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_NOSTATE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_RESTORED' type='enum'/>
|
||||
<exports symbol='VIR_CRED_PASSPHRASE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_VOL_DELETE_NORMAL' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_DELETE_ZEROED' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_BLOCKED' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_XML_SECURE' type='enum'/>
|
||||
<exports symbol='VIR_STORAGE_POOL_INACTIVE' type='enum'/>
|
||||
<exports symbol='VIR_DOMAIN_EVENT_SUSPENDED' type='enum'/>
|
||||
<exports symbol='virDomainBlockStatsStruct' type='typedef'/>
|
||||
<exports symbol='virDomainMigrateFlags' type='typedef'/>
|
||||
<exports symbol='virNodeInfo' type='typedef'/>
|
||||
@ -69,8 +81,9 @@
|
||||
<exports symbol='virVcpuInfo' type='typedef'/>
|
||||
<exports symbol='virDomainInfo' type='typedef'/>
|
||||
<exports symbol='virStoragePoolDeleteFlags' type='typedef'/>
|
||||
<exports symbol='virEventHandleType' type='typedef'/>
|
||||
<exports symbol='virStoragePool' type='typedef'/>
|
||||
<exports symbol='virStoragePoolPtr' type='typedef'/>
|
||||
<exports symbol='virDomainEventType' type='typedef'/>
|
||||
<exports symbol='virDomainInterfaceStatsStruct' type='typedef'/>
|
||||
<exports symbol='virStoragePoolInfo' type='typedef'/>
|
||||
<exports symbol='virDomainState' type='typedef'/>
|
||||
@ -80,6 +93,7 @@
|
||||
<exports symbol='virStorageVolInfo' type='typedef'/>
|
||||
<exports symbol='virSchedParameterType' type='typedef'/>
|
||||
<exports symbol='virConnectCredentialPtr' type='typedef'/>
|
||||
<exports symbol='virStoragePoolPtr' type='typedef'/>
|
||||
<exports symbol='virNodeInfoPtr' type='typedef'/>
|
||||
<exports symbol='virNetworkPtr' type='typedef'/>
|
||||
<exports symbol='virDomainInfoPtr' type='typedef'/>
|
||||
@ -117,14 +131,17 @@
|
||||
<exports symbol='virConnectAuthPtrDefault' type='variable'/>
|
||||
<exports symbol='virStoragePoolGetXMLDesc' type='function'/>
|
||||
<exports symbol='virStorageVolGetKey' type='function'/>
|
||||
<exports symbol='virEventUpdateTimeoutFunc' type='function'/>
|
||||
<exports symbol='virConnectClose' type='function'/>
|
||||
<exports symbol='virDomainDefineXML' type='function'/>
|
||||
<exports symbol='virDomainShutdown' type='function'/>
|
||||
<exports symbol='virConnectListStoragePools' type='function'/>
|
||||
<exports symbol='virGetVersion' type='function'/>
|
||||
<exports symbol='virNodeGetCellsFreeMemory' type='function'/>
|
||||
<exports symbol='virInitialize' type='function'/>
|
||||
<exports symbol='virStoragePoolSetAutostart' type='function'/>
|
||||
<exports symbol='virStorageVolCreateXML' type='function'/>
|
||||
<exports symbol='virConnectDomainEventDeregister' type='function'/>
|
||||
<exports symbol='virDomainGetSchedulerParameters' type='function'/>
|
||||
<exports symbol='virDomainLookupByUUIDString' type='function'/>
|
||||
<exports symbol='virConnectNumOfDefinedNetworks' type='function'/>
|
||||
@ -140,17 +157,18 @@
|
||||
<exports symbol='virStorageVolLookupByName' type='function'/>
|
||||
<exports symbol='virDomainCreateLinux' type='function'/>
|
||||
<exports symbol='virDomainSetMaxMemory' type='function'/>
|
||||
<exports symbol='virInitialize' type='function'/>
|
||||
<exports symbol='virEventRegisterImpl' type='function'/>
|
||||
<exports symbol='virDomainMigrate' type='function'/>
|
||||
<exports symbol='virDomainSuspend' type='function'/>
|
||||
<exports symbol='virNetworkCreate' type='function'/>
|
||||
<exports symbol='virEventUpdateHandleFunc' type='function'/>
|
||||
<exports symbol='virDomainDestroy' type='function'/>
|
||||
<exports symbol='virConnectNumOfNetworks' type='function'/>
|
||||
<exports symbol='virStoragePoolLookupByUUIDString' type='function'/>
|
||||
<exports symbol='virDomainGetXMLDesc' type='function'/>
|
||||
<exports symbol='virStoragePoolGetUUID' type='function'/>
|
||||
<exports symbol='virStorageVolGetInfo' type='function'/>
|
||||
<exports symbol='virNetworkGetName' type='function'/>
|
||||
<exports symbol='virDomainGetInfo' type='function'/>
|
||||
<exports symbol='virNetworkDestroy' type='function'/>
|
||||
<exports symbol='virStoragePoolLookupByName' type='function'/>
|
||||
<exports symbol='virNetworkGetAutostart' type='function'/>
|
||||
@ -172,16 +190,17 @@
|
||||
<exports symbol='virDomainBlockStats' type='function'/>
|
||||
<exports symbol='virConnectOpenAuth' type='function'/>
|
||||
<exports symbol='virStoragePoolDelete' type='function'/>
|
||||
<exports symbol='virDomainResume' type='function'/>
|
||||
<exports symbol='virEventRemoveHandleFunc' type='function'/>
|
||||
<exports symbol='virStorageVolGetName' type='function'/>
|
||||
<exports symbol='virStoragePoolGetAutostart' type='function'/>
|
||||
<exports symbol='virDomainGetAutostart' type='function'/>
|
||||
<exports symbol='virStoragePoolListVolumes' type='function'/>
|
||||
<exports symbol='virConnectGetHostname' type='function'/>
|
||||
<exports symbol='virEventRemoveTimeoutFunc' type='function'/>
|
||||
<exports symbol='virDomainGetName' type='function'/>
|
||||
<exports symbol='virNetworkGetXMLDesc' type='function'/>
|
||||
<exports symbol='virConnectNumOfStoragePools' type='function'/>
|
||||
<exports symbol='virDomainGetInfo' type='function'/>
|
||||
<exports symbol='virNetworkGetName' type='function'/>
|
||||
<exports symbol='virConnectListDefinedDomains' type='function'/>
|
||||
<exports symbol='virConnectGetCapabilities' type='function'/>
|
||||
<exports symbol='virDomainLookupByName' type='function'/>
|
||||
@ -190,7 +209,9 @@
|
||||
<exports symbol='virDomainRestore' type='function'/>
|
||||
<exports symbol='virStorageVolGetPath' type='function'/>
|
||||
<exports symbol='virNetworkLookupByUUIDString' type='function'/>
|
||||
<exports symbol='virConnectDomainEventCallback' type='function'/>
|
||||
<exports symbol='virDomainLookupByID' type='function'/>
|
||||
<exports symbol='virStorageVolDelete' type='function'/>
|
||||
<exports symbol='virStorageVolFree' type='function'/>
|
||||
<exports symbol='virDomainMemoryPeek' type='function'/>
|
||||
<exports symbol='virNetworkLookupByUUID' type='function'/>
|
||||
@ -200,6 +221,7 @@
|
||||
<exports symbol='virDomainGetVcpus' type='function'/>
|
||||
<exports symbol='virStoragePoolCreateXML' type='function'/>
|
||||
<exports symbol='virStoragePoolGetInfo' type='function'/>
|
||||
<exports symbol='virDomainResume' type='function'/>
|
||||
<exports symbol='virStoragePoolRefresh' type='function'/>
|
||||
<exports symbol='virConnectNumOfDefinedDomains' type='function'/>
|
||||
<exports symbol='virStorageVolLookupByKey' type='function'/>
|
||||
@ -208,6 +230,7 @@
|
||||
<exports symbol='virNetworkGetUUIDString' type='function'/>
|
||||
<exports symbol='virNetworkLookupByName' type='function'/>
|
||||
<exports symbol='virDomainGetMaxVcpus' type='function'/>
|
||||
<exports symbol='virEventHandleCallback' type='function'/>
|
||||
<exports symbol='virDomainGetSchedulerType' type='function'/>
|
||||
<exports symbol='virDomainDetachDevice' type='function'/>
|
||||
<exports symbol='virStoragePoolNumOfVolumes' type='function'/>
|
||||
@ -219,9 +242,10 @@
|
||||
<exports symbol='virConnectOpenReadOnly' type='function'/>
|
||||
<exports symbol='virNetworkFree' type='function'/>
|
||||
<exports symbol='virStoragePoolLookupByUUID' type='function'/>
|
||||
<exports symbol='virStorageVolDelete' type='function'/>
|
||||
<exports symbol='virEventAddHandleFunc' type='function'/>
|
||||
<exports symbol='virNetworkUndefine' type='function'/>
|
||||
<exports symbol='virConnectListDefinedStoragePools' type='function'/>
|
||||
<exports symbol='virEventTimeoutCallback' type='function'/>
|
||||
<exports symbol='virNetworkGetConnect' type='function'/>
|
||||
<exports symbol='virNodeGetFreeMemory' type='function'/>
|
||||
<exports symbol='virStorageVolGetConnect' type='function'/>
|
||||
@ -237,8 +261,10 @@
|
||||
<exports symbol='virConnectOpen' type='function'/>
|
||||
<exports symbol='virDomainCreateXML' type='function'/>
|
||||
<exports symbol='virDomainSetVcpus' type='function'/>
|
||||
<exports symbol='virConnectDomainEventRegister' type='function'/>
|
||||
<exports symbol='virDomainGetID' type='function'/>
|
||||
<exports symbol='virDomainBlockPeek' type='function'/>
|
||||
<exports symbol='virEventAddTimeoutFunc' type='function'/>
|
||||
<exports symbol='virDomainInterfaceStats' type='function'/>
|
||||
<exports symbol='virConnectListNetworks' type='function'/>
|
||||
</file>
|
||||
@ -403,6 +429,14 @@
|
||||
<enum name='VIR_CRED_USERNAME' file='libvirt' value='1' type='virConnectCredentialType' info='Identity to act as'/>
|
||||
<enum name='VIR_DOMAIN_BLOCKED' file='libvirt' value='2' type='virDomainState' info='the domain is blocked on resource'/>
|
||||
<enum name='VIR_DOMAIN_CRASHED' file='libvirt' value='6' type='virDomainState' info=' the domain is crashed'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_ADDED' file='libvirt' value='1' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_REMOVED' file='libvirt' value='2' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_RESTORED' file='libvirt' value='8' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_RESUMED' file='libvirt' value='5' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_SAVED' file='libvirt' value='7' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_STARTED' file='libvirt' value='3' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_STOPPED' file='libvirt' value='6' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_EVENT_SUSPENDED' file='libvirt' value='4' type='virDomainEventType'/>
|
||||
<enum name='VIR_DOMAIN_NONE' file='libvirt' value='0' type='virDomainCreateFlags'/>
|
||||
<enum name='VIR_DOMAIN_NOSTATE' file='libvirt' value='0' type='virDomainState' info='no state'/>
|
||||
<enum name='VIR_DOMAIN_PAUSED' file='libvirt' value='3' type='virDomainState' info='the domain is paused by user'/>
|
||||
@ -469,6 +503,10 @@
|
||||
<enum name='VIR_ERR_XEN_CALL' file='virterror' value='15' type='virErrorNumber' info='failure doing an hypervisor call'/>
|
||||
<enum name='VIR_ERR_XML_DETAIL' file='virterror' value='35' type='virErrorNumber' info='detail of an XML error'/>
|
||||
<enum name='VIR_ERR_XML_ERROR' file='virterror' value='27' type='virErrorNumber' info='an XML description is not well formed or broken'/>
|
||||
<enum name='VIR_EVENT_HANDLE_ERROR' file='libvirt' value='4' type='virEventHandleType'/>
|
||||
<enum name='VIR_EVENT_HANDLE_HANGUP' file='libvirt' value='8' type='virEventHandleType'/>
|
||||
<enum name='VIR_EVENT_HANDLE_READABLE' file='libvirt' value='1' type='virEventHandleType'/>
|
||||
<enum name='VIR_EVENT_HANDLE_WRITABLE' file='libvirt' value='2' type='virEventHandleType'/>
|
||||
<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'/>
|
||||
@ -544,6 +582,7 @@
|
||||
<field name='errs' type='long long' info=' In Xen this returns the mysterious 'oo_req'.'/>
|
||||
</struct>
|
||||
<typedef name='virDomainCreateFlags' file='libvirt' type='enum'/>
|
||||
<typedef name='virDomainEventType' file='libvirt' type='enum'/>
|
||||
<struct name='virDomainInfo' file='libvirt' type='struct _virDomainInfo'>
|
||||
<field name='state' type='unsigned char' info=' the running state, one of virDomainState'/>
|
||||
<field name='maxMem' type='unsigned long' info=' the maximum memory in KBytes allowed'/>
|
||||
@ -595,6 +634,7 @@ see note above'/>
|
||||
<typedef name='virErrorLevel' file='virterror' type='enum'/>
|
||||
<typedef name='virErrorNumber' file='virterror' type='enum'/>
|
||||
<typedef name='virErrorPtr' file='virterror' type='virError *'/>
|
||||
<typedef name='virEventHandleType' file='libvirt' type='enum'/>
|
||||
<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>
|
||||
@ -690,6 +730,27 @@ see note above'/>
|
||||
<return type='int' info='0 in case of success or -1 in case of error.'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
|
||||
</function>
|
||||
<functype name='virConnectDomainEventCallback' file='libvirt' module='libvirt'>
|
||||
<info>A callback function to be registered, and called when a domain event occurs</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='conn' type='virConnectPtr' info='virConnect connection'/>
|
||||
<arg name='dom' type='virDomainPtr' info='The domain on which the event occured'/>
|
||||
<arg name='event' type='int' info='The specfic virDomainEventType which occured'/>
|
||||
<arg name='opaque' type='void *' info='opaque user data'/>
|
||||
</functype>
|
||||
<function name='virConnectDomainEventDeregister' file='libvirt' module='libvirt'>
|
||||
<info>Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type</info>
|
||||
<return type='int' info='0 on success, -1 on failure'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the connection'/>
|
||||
<arg name='cb' type='virConnectDomainEventCallback' info='callback to the function handling domain events'/>
|
||||
</function>
|
||||
<function name='virConnectDomainEventRegister' file='libvirt' module='libvirt'>
|
||||
<info>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</info>
|
||||
<return type='int' info='0 on success, -1 on failure'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the connection'/>
|
||||
<arg name='cb' type='virConnectDomainEventCallback' info='callback to the function handling domain events'/>
|
||||
<arg name='opaque' type='void *' info='opaque data to pass on to the callback'/>
|
||||
</function>
|
||||
<function name='virConnectFindStoragePoolSources' file='libvirt' module='libvirt'>
|
||||
<info>Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)</info>
|
||||
<return type='char *' info='an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.'/>
|
||||
@ -1117,6 +1178,66 @@ see note above'/>
|
||||
<arg name='userData' type='void *' info='user provided data for the error callback'/>
|
||||
<arg name='error' type='virErrorPtr' info='the error being raised.'/>
|
||||
</functype>
|
||||
<functype name='virEventAddHandleFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this callback Adds a file handle callback to listen for specific events</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='fd' type='int' info='file descriptor to listen on'/>
|
||||
<arg name='event' type='int' info='bitset of events on which to fire the callback'/>
|
||||
<arg name='cb' type='virEventHandleCallback' info='the callback to be called'/>
|
||||
<arg name='opaque' type='void *' info='user data to pass to the callback'/>
|
||||
</functype>
|
||||
<functype name='virEventAddTimeoutFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this user-defined callback handles adding an event timeout.</info>
|
||||
<return type='int' info='a timer value'/>
|
||||
<arg name='timeout' type='int' info='The timeout to monitor'/>
|
||||
<arg name='cb' type='virEventTimeoutCallback' info='the callback to call when timeout has expired'/>
|
||||
<arg name='opaque' type='void *' info='user data to pass to the callback'/>
|
||||
</functype>
|
||||
<functype name='virEventHandleCallback' file='libvirt' module='libvirt'>
|
||||
<info>callback for receiving file handle events</info>
|
||||
<return type='void'/>
|
||||
<arg name='fd' type='int' info='file handle on which the event occurred'/>
|
||||
<arg name='events' type='int' info='bitset of events from virEventHandleType constants'/>
|
||||
<arg name='opaque' type='void *' info='user data registered with handle'/>
|
||||
</functype>
|
||||
<function name='virEventRegisterImpl' file='libvirt' module='libvirt'>
|
||||
<info></info>
|
||||
<return type='void'/>
|
||||
<arg name='addHandle' type='virEventAddHandleFunc' info=''/>
|
||||
<arg name='updateHandle' type='virEventUpdateHandleFunc' info=''/>
|
||||
<arg name='removeHandle' type='virEventRemoveHandleFunc' info=''/>
|
||||
<arg name='addTimeout' type='virEventAddTimeoutFunc' info=''/>
|
||||
<arg name='updateTimeout' type='virEventUpdateTimeoutFunc' info=''/>
|
||||
<arg name='removeTimeout' type='virEventRemoveTimeoutFunc' info=''/>
|
||||
</function>
|
||||
<functype name='virEventRemoveHandleFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this user-provided callback is notified when an fd is no longer being listened on</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='fd' type='int' info='file descriptor to stop listening on'/>
|
||||
</functype>
|
||||
<functype name='virEventRemoveTimeoutFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this user-defined callback removes a timer</info>
|
||||
<return type='int' info='0 on success, -1 on failure'/>
|
||||
<arg name='timer' type='int' info='the timer to remove'/>
|
||||
</functype>
|
||||
<functype name='virEventTimeoutCallback' file='libvirt' module='libvirt'>
|
||||
<info>callback for receiving timer events</info>
|
||||
<return type='void'/>
|
||||
<arg name='timer' type='int' info='timer id emitting the event'/>
|
||||
<arg name='opaque' type='void *' info='user data registered with handle'/>
|
||||
</functype>
|
||||
<functype name='virEventUpdateHandleFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this user-provided callback is notified when events to listen on change</info>
|
||||
<return type='void'/>
|
||||
<arg name='fd' type='int' info='file descriptor to modify'/>
|
||||
<arg name='event' type='int' info='new events to listen on'/>
|
||||
</functype>
|
||||
<functype name='virEventUpdateTimeoutFunc' file='libvirt' module='libvirt'>
|
||||
<info>Part of the EventImpl, this user-defined callback updates an event timeout.</info>
|
||||
<return type='void'/>
|
||||
<arg name='timer' type='int' info='the timer to modify'/>
|
||||
<arg name='timeout' type='int' info='the new timeout value'/>
|
||||
</functype>
|
||||
<function name='virGetLastError' file='virterror' module='virterror'>
|
||||
<info>Provide a pointer to the last error caught at the library level Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError()</info>
|
||||
<return type='virErrorPtr' info='a pointer to the last error or NULL if none occurred.'/>
|
||||
|
@ -17,6 +17,14 @@
|
||||
<reference name='VIR_CRED_USERNAME' href='html/libvirt-libvirt.html#VIR_CRED_USERNAME'/>
|
||||
<reference name='VIR_DOMAIN_BLOCKED' href='html/libvirt-libvirt.html#VIR_DOMAIN_BLOCKED'/>
|
||||
<reference name='VIR_DOMAIN_CRASHED' href='html/libvirt-libvirt.html#VIR_DOMAIN_CRASHED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_ADDED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_ADDED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_REMOVED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_REMOVED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_RESTORED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_RESTORED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_RESUMED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_RESUMED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_SAVED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_SAVED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_STARTED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_STARTED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_STOPPED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_STOPPED'/>
|
||||
<reference name='VIR_DOMAIN_EVENT_SUSPENDED' href='html/libvirt-libvirt.html#VIR_DOMAIN_EVENT_SUSPENDED'/>
|
||||
<reference name='VIR_DOMAIN_NONE' href='html/libvirt-libvirt.html#VIR_DOMAIN_NONE'/>
|
||||
<reference name='VIR_DOMAIN_NOSTATE' href='html/libvirt-libvirt.html#VIR_DOMAIN_NOSTATE'/>
|
||||
<reference name='VIR_DOMAIN_PAUSED' href='html/libvirt-libvirt.html#VIR_DOMAIN_PAUSED'/>
|
||||
@ -84,6 +92,10 @@
|
||||
<reference name='VIR_ERR_XEN_CALL' href='html/libvirt-virterror.html#VIR_ERR_XEN_CALL'/>
|
||||
<reference name='VIR_ERR_XML_DETAIL' href='html/libvirt-virterror.html#VIR_ERR_XML_DETAIL'/>
|
||||
<reference name='VIR_ERR_XML_ERROR' href='html/libvirt-virterror.html#VIR_ERR_XML_ERROR'/>
|
||||
<reference name='VIR_EVENT_HANDLE_ERROR' href='html/libvirt-libvirt.html#VIR_EVENT_HANDLE_ERROR'/>
|
||||
<reference name='VIR_EVENT_HANDLE_HANGUP' href='html/libvirt-libvirt.html#VIR_EVENT_HANDLE_HANGUP'/>
|
||||
<reference name='VIR_EVENT_HANDLE_READABLE' href='html/libvirt-libvirt.html#VIR_EVENT_HANDLE_READABLE'/>
|
||||
<reference name='VIR_EVENT_HANDLE_WRITABLE' href='html/libvirt-libvirt.html#VIR_EVENT_HANDLE_WRITABLE'/>
|
||||
<reference name='VIR_FROM_CONF' href='html/libvirt-virterror.html#VIR_FROM_CONF'/>
|
||||
<reference name='VIR_FROM_DOM' href='html/libvirt-virterror.html#VIR_FROM_DOM'/>
|
||||
<reference name='VIR_FROM_DOMAIN' href='html/libvirt-virterror.html#VIR_FROM_DOMAIN'/>
|
||||
@ -155,6 +167,9 @@
|
||||
<reference name='virConnectCredential' href='html/libvirt-libvirt.html#virConnectCredential'/>
|
||||
<reference name='virConnectCredentialPtr' href='html/libvirt-libvirt.html#virConnectCredentialPtr'/>
|
||||
<reference name='virConnectCredentialType' href='html/libvirt-libvirt.html#virConnectCredentialType'/>
|
||||
<reference name='virConnectDomainEventCallback' href='html/libvirt-libvirt.html#virConnectDomainEventCallback'/>
|
||||
<reference name='virConnectDomainEventDeregister' href='html/libvirt-libvirt.html#virConnectDomainEventDeregister'/>
|
||||
<reference name='virConnectDomainEventRegister' href='html/libvirt-libvirt.html#virConnectDomainEventRegister'/>
|
||||
<reference name='virConnectFindStoragePoolSources' href='html/libvirt-libvirt.html#virConnectFindStoragePoolSources'/>
|
||||
<reference name='virConnectFlags' href='html/libvirt-libvirt.html#virConnectFlags'/>
|
||||
<reference name='virConnectGetCapabilities' href='html/libvirt-libvirt.html#virConnectGetCapabilities'/>
|
||||
@ -195,6 +210,7 @@
|
||||
<reference name='virDomainDefineXML' href='html/libvirt-libvirt.html#virDomainDefineXML'/>
|
||||
<reference name='virDomainDestroy' href='html/libvirt-libvirt.html#virDomainDestroy'/>
|
||||
<reference name='virDomainDetachDevice' href='html/libvirt-libvirt.html#virDomainDetachDevice'/>
|
||||
<reference name='virDomainEventType' href='html/libvirt-libvirt.html#virDomainEventType'/>
|
||||
<reference name='virDomainFree' href='html/libvirt-libvirt.html#virDomainFree'/>
|
||||
<reference name='virDomainGetAutostart' href='html/libvirt-libvirt.html#virDomainGetAutostart'/>
|
||||
<reference name='virDomainGetConnect' href='html/libvirt-libvirt.html#virDomainGetConnect'/>
|
||||
@ -245,6 +261,16 @@
|
||||
<reference name='virErrorLevel' href='html/libvirt-virterror.html#virErrorLevel'/>
|
||||
<reference name='virErrorNumber' href='html/libvirt-virterror.html#virErrorNumber'/>
|
||||
<reference name='virErrorPtr' href='html/libvirt-virterror.html#virErrorPtr'/>
|
||||
<reference name='virEventAddHandleFunc' href='html/libvirt-libvirt.html#virEventAddHandleFunc'/>
|
||||
<reference name='virEventAddTimeoutFunc' href='html/libvirt-libvirt.html#virEventAddTimeoutFunc'/>
|
||||
<reference name='virEventHandleCallback' href='html/libvirt-libvirt.html#virEventHandleCallback'/>
|
||||
<reference name='virEventHandleType' href='html/libvirt-libvirt.html#virEventHandleType'/>
|
||||
<reference name='virEventRegisterImpl' href='html/libvirt-libvirt.html#virEventRegisterImpl'/>
|
||||
<reference name='virEventRemoveHandleFunc' href='html/libvirt-libvirt.html#virEventRemoveHandleFunc'/>
|
||||
<reference name='virEventRemoveTimeoutFunc' href='html/libvirt-libvirt.html#virEventRemoveTimeoutFunc'/>
|
||||
<reference name='virEventTimeoutCallback' href='html/libvirt-libvirt.html#virEventTimeoutCallback'/>
|
||||
<reference name='virEventUpdateHandleFunc' href='html/libvirt-libvirt.html#virEventUpdateHandleFunc'/>
|
||||
<reference name='virEventUpdateTimeoutFunc' href='html/libvirt-libvirt.html#virEventUpdateTimeoutFunc'/>
|
||||
<reference name='virGetLastError' href='html/libvirt-virterror.html#virGetLastError'/>
|
||||
<reference name='virGetVersion' href='html/libvirt-libvirt.html#virGetVersion'/>
|
||||
<reference name='virInitialize' href='html/libvirt-libvirt.html#virInitialize'/>
|
||||
@ -350,6 +376,14 @@
|
||||
<ref name='VIR_CRED_USERNAME'/>
|
||||
<ref name='VIR_DOMAIN_BLOCKED'/>
|
||||
<ref name='VIR_DOMAIN_CRASHED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_ADDED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_REMOVED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_RESTORED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_RESUMED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_SAVED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_STARTED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_STOPPED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_SUSPENDED'/>
|
||||
<ref name='VIR_DOMAIN_NONE'/>
|
||||
<ref name='VIR_DOMAIN_NOSTATE'/>
|
||||
<ref name='VIR_DOMAIN_PAUSED'/>
|
||||
@ -417,6 +451,10 @@
|
||||
<ref name='VIR_ERR_XEN_CALL'/>
|
||||
<ref name='VIR_ERR_XML_DETAIL'/>
|
||||
<ref name='VIR_ERR_XML_ERROR'/>
|
||||
<ref name='VIR_EVENT_HANDLE_ERROR'/>
|
||||
<ref name='VIR_EVENT_HANDLE_HANGUP'/>
|
||||
<ref name='VIR_EVENT_HANDLE_READABLE'/>
|
||||
<ref name='VIR_EVENT_HANDLE_WRITABLE'/>
|
||||
<ref name='VIR_FROM_CONF'/>
|
||||
<ref name='VIR_FROM_DOM'/>
|
||||
<ref name='VIR_FROM_DOMAIN'/>
|
||||
@ -492,6 +530,9 @@
|
||||
<ref name='virConnectCredential'/>
|
||||
<ref name='virConnectCredentialPtr'/>
|
||||
<ref name='virConnectCredentialType'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
<ref name='virConnectFlags'/>
|
||||
<ref name='virConnectGetCapabilities'/>
|
||||
@ -532,6 +573,7 @@
|
||||
<ref name='virDomainDefineXML'/>
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainDetachDevice'/>
|
||||
<ref name='virDomainEventType'/>
|
||||
<ref name='virDomainFree'/>
|
||||
<ref name='virDomainGetAutostart'/>
|
||||
<ref name='virDomainGetConnect'/>
|
||||
@ -582,6 +624,16 @@
|
||||
<ref name='virErrorLevel'/>
|
||||
<ref name='virErrorNumber'/>
|
||||
<ref name='virErrorPtr'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventHandleType'/>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
<ref name='virGetLastError'/>
|
||||
<ref name='virGetVersion'/>
|
||||
<ref name='virInitialize'/>
|
||||
@ -801,12 +853,19 @@
|
||||
<type name='virConnectCredentialPtr'>
|
||||
<ref name='virConnectAuthCallbackPtr'/>
|
||||
</type>
|
||||
<type name='virConnectDomainEventCallback'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</type>
|
||||
<type name='virConnectPtr'>
|
||||
<ref name='virConnCopyLastError'/>
|
||||
<ref name='virConnGetLastError'/>
|
||||
<ref name='virConnResetLastError'/>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectClose'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
<ref name='virConnectGetCapabilities'/>
|
||||
<ref name='virConnectGetHostname'/>
|
||||
@ -861,6 +920,7 @@
|
||||
<ref name='virDomainInterfaceStats'/>
|
||||
</type>
|
||||
<type name='virDomainPtr'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virDomainAttachDevice'/>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainBlockStats'/>
|
||||
@ -910,6 +970,30 @@
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virResetError'/>
|
||||
</type>
|
||||
<type name='virEventAddHandleFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virEventAddTimeoutFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virEventHandleCallback'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
</type>
|
||||
<type name='virEventRemoveHandleFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virEventRemoveTimeoutFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virEventTimeoutCallback'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
</type>
|
||||
<type name='virEventUpdateHandleFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virEventUpdateTimeoutFunc'>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
</type>
|
||||
<type name='virNetworkPtr'>
|
||||
<ref name='virNetworkCreate'/>
|
||||
<ref name='virNetworkDestroy'/>
|
||||
@ -975,9 +1059,15 @@
|
||||
<type name='void *'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectAuthCallbackPtr'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</type>
|
||||
</functions>
|
||||
@ -999,6 +1089,14 @@
|
||||
<ref name='VIR_CRED_USERNAME'/>
|
||||
<ref name='VIR_DOMAIN_BLOCKED'/>
|
||||
<ref name='VIR_DOMAIN_CRASHED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_ADDED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_REMOVED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_RESTORED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_RESUMED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_SAVED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_STARTED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_STOPPED'/>
|
||||
<ref name='VIR_DOMAIN_EVENT_SUSPENDED'/>
|
||||
<ref name='VIR_DOMAIN_NONE'/>
|
||||
<ref name='VIR_DOMAIN_NOSTATE'/>
|
||||
<ref name='VIR_DOMAIN_PAUSED'/>
|
||||
@ -1014,6 +1112,10 @@
|
||||
<ref name='VIR_DOMAIN_SHUTOFF'/>
|
||||
<ref name='VIR_DOMAIN_XML_INACTIVE'/>
|
||||
<ref name='VIR_DOMAIN_XML_SECURE'/>
|
||||
<ref name='VIR_EVENT_HANDLE_ERROR'/>
|
||||
<ref name='VIR_EVENT_HANDLE_HANGUP'/>
|
||||
<ref name='VIR_EVENT_HANDLE_READABLE'/>
|
||||
<ref name='VIR_EVENT_HANDLE_WRITABLE'/>
|
||||
<ref name='VIR_GET_CPUMAP'/>
|
||||
<ref name='VIR_MEMORY_VIRTUAL'/>
|
||||
<ref name='VIR_MIGRATE_LIVE'/>
|
||||
@ -1057,6 +1159,9 @@
|
||||
<ref name='virConnectCredential'/>
|
||||
<ref name='virConnectCredentialPtr'/>
|
||||
<ref name='virConnectCredentialType'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
<ref name='virConnectFlags'/>
|
||||
<ref name='virConnectGetCapabilities'/>
|
||||
@ -1095,6 +1200,7 @@
|
||||
<ref name='virDomainDefineXML'/>
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainDetachDevice'/>
|
||||
<ref name='virDomainEventType'/>
|
||||
<ref name='virDomainFree'/>
|
||||
<ref name='virDomainGetAutostart'/>
|
||||
<ref name='virDomainGetConnect'/>
|
||||
@ -1139,6 +1245,16 @@
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virDomainUndefine'/>
|
||||
<ref name='virDomainXMLFlags'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventHandleType'/>
|
||||
<ref name='virEventRegisterImpl'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
<ref name='virGetVersion'/>
|
||||
<ref name='virInitialize'/>
|
||||
<ref name='virNetwork'/>
|
||||
@ -1335,6 +1451,10 @@
|
||||
<word name='Additional'>
|
||||
<ref name='_virConnectCredential'/>
|
||||
</word>
|
||||
<word name='Adds'>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
</word>
|
||||
<word name='After'>
|
||||
<ref name='virDomainSave'/>
|
||||
</word>
|
||||
@ -1393,6 +1513,8 @@
|
||||
</word>
|
||||
<word name='Callback'>
|
||||
<ref name='_virConnectAuth'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='Change'>
|
||||
<ref name='virDomainSetSchedulerParameters'/>
|
||||
@ -1428,6 +1550,9 @@
|
||||
<word name='Daemon'>
|
||||
<ref name='virDomainCoreDump'/>
|
||||
</word>
|
||||
<word name='De-registering'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
</word>
|
||||
<word name='Default'>
|
||||
<ref name='virDefaultErrorFunc'/>
|
||||
</word>
|
||||
@ -1455,6 +1580,10 @@
|
||||
<word name='Does'>
|
||||
<ref name='virStoragePoolFree'/>
|
||||
</word>
|
||||
<word name='Domain'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='Domain0'>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainGetVcpus'/>
|
||||
@ -1478,6 +1607,18 @@
|
||||
<word name='Each'>
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
</word>
|
||||
<word name='Event'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='EventImpl'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='Extract'>
|
||||
<ref name='virDomainGetInfo'/>
|
||||
<ref name='virDomainGetVcpus'/>
|
||||
@ -1666,6 +1807,14 @@
|
||||
</word>
|
||||
</letter>
|
||||
<letter name='P'>
|
||||
<word name='Part'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='Prompt'>
|
||||
<ref name='_virConnectCredential'/>
|
||||
</word>
|
||||
@ -1716,12 +1865,18 @@
|
||||
<word name='Refer'>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
<word name='Registering'>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='Release'>
|
||||
<ref name='virStorageVolFree'/>
|
||||
</word>
|
||||
<word name='Remaining'>
|
||||
<ref name='_virStoragePoolInfo'/>
|
||||
</word>
|
||||
<word name='Removes'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
</word>
|
||||
<word name='Renamed'>
|
||||
<ref name='virDomainCreateLinux'/>
|
||||
</word>
|
||||
@ -1991,6 +2146,9 @@
|
||||
<word name='add'>
|
||||
<ref name='virDomainShutdown'/>
|
||||
</word>
|
||||
<word name='adding'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='additional'>
|
||||
<ref name='virNodeGetCellsFreeMemory'/>
|
||||
</word>
|
||||
@ -2254,6 +2412,7 @@
|
||||
<ref name='virDomainReboot'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virResetError'/>
|
||||
</word>
|
||||
<word name='below'>
|
||||
@ -2286,6 +2445,10 @@
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
</word>
|
||||
<word name='bitset'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
</word>
|
||||
<word name='block'>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainBlockStats'/>
|
||||
@ -2354,6 +2517,7 @@
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetVcpus'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virInitialize'/>
|
||||
<ref name='virNetworkCreate'/>
|
||||
<ref name='virNetworkGetConnect'/>
|
||||
@ -2363,16 +2527,29 @@
|
||||
</word>
|
||||
<word name='callback'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virConnectOpenAuth'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
<word name='called'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectClose'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectOpen'/>
|
||||
<ref name='virConnectOpenAuth'/>
|
||||
<ref name='virConnectOpenReadOnly'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
<word name='caller'>
|
||||
@ -2456,6 +2633,7 @@
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSetVcpus'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virStoragePoolFree'/>
|
||||
</word>
|
||||
<word name='char'>
|
||||
@ -2541,6 +2719,7 @@
|
||||
</word>
|
||||
<word name='constants'>
|
||||
<ref name='_virConnectCredential'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
</word>
|
||||
<word name='containing'>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
@ -2645,8 +2824,14 @@
|
||||
<letter name='d'>
|
||||
<word name='data'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virDomainFree'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virNetworkFree'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
@ -2688,6 +2873,10 @@
|
||||
<word name='defresult'>
|
||||
<ref name='_virConnectCredential'/>
|
||||
</word>
|
||||
<word name='delivery'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='deprecated'>
|
||||
<ref name='_virError'/>
|
||||
</word>
|
||||
@ -2712,6 +2901,11 @@
|
||||
<ref name='virStoragePoolDefineXML'/>
|
||||
<ref name='virStorageVolCreateXML'/>
|
||||
</word>
|
||||
<word name='descriptor'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='dest'>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
@ -2750,6 +2944,9 @@
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
<word name='disable'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
</word>
|
||||
<word name='disappear'>
|
||||
<ref name='virDomainCreateXML'/>
|
||||
<ref name='virStoragePoolCreateXML'/>
|
||||
@ -2860,6 +3057,12 @@
|
||||
<word name='else'>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
<word name='emitting'>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
</word>
|
||||
<word name='enable'>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='encoded'>
|
||||
<ref name='virDomainGetXMLDesc'/>
|
||||
<ref name='virNetworkGetXMLDesc'/>
|
||||
@ -2882,6 +3085,22 @@
|
||||
<word name='even'>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
<word name='event'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='events'>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='example'>
|
||||
<ref name='virDomainBlockStats'/>
|
||||
<ref name='virDomainMigrate'/>
|
||||
@ -2898,6 +3117,9 @@
|
||||
<word name='expected'>
|
||||
<ref name='_virNodeInfo'/>
|
||||
</word>
|
||||
<word name='expired'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='explicitly'>
|
||||
<ref name='virDomainDefineXML'/>
|
||||
<ref name='virStoragePoolDefineXML'/>
|
||||
@ -2964,6 +3186,10 @@
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainCoreDump'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='filesystems'>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
@ -2985,6 +3211,9 @@
|
||||
<word name='finding'>
|
||||
<ref name='virDomainBlockStats'/>
|
||||
</word>
|
||||
<word name='fire'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
</word>
|
||||
<word name='first'>
|
||||
<ref name='virConnectOpen'/>
|
||||
<ref name='virConnectOpenAuth'/>
|
||||
@ -3094,6 +3323,7 @@
|
||||
<ref name='virDomainMigrate'/>
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virNetworkCreate'/>
|
||||
<ref name='virStorageVolDelete'/>
|
||||
<ref name='virStorageVolGetKey'/>
|
||||
@ -3102,32 +3332,6 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
<word name='function'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectClose'/>
|
||||
<ref name='virConnectOpen'/>
|
||||
<ref name='virConnectOpenAuth'/>
|
||||
<ref name='virConnectOpenReadOnly'/>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainBlockStats'/>
|
||||
<ref name='virDomainCreateXML'/>
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainGetConnect'/>
|
||||
<ref name='virDomainInterfaceStats'/>
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSetVcpus'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virNetworkDestroy'/>
|
||||
<ref name='virNetworkGetConnect'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
<ref name='virStoragePoolGetConnect'/>
|
||||
<ref name='virStorageVolGetConnect'/>
|
||||
</word>
|
||||
<word name='functionalities'>
|
||||
<ref name='virConnectOpenReadOnly'/>
|
||||
</word>
|
||||
@ -3214,14 +3418,22 @@
|
||||
</letter>
|
||||
<letter name='h'>
|
||||
<word name='handle'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virStorageVolFree'/>
|
||||
</word>
|
||||
<word name='handler'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
<word name='handles'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='handling'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
<word name='haphazard'>
|
||||
@ -3236,6 +3448,7 @@
|
||||
<word name='has'>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainGetVcpus'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virStoragePoolDestroy'/>
|
||||
</word>
|
||||
<word name='have'>
|
||||
@ -3491,6 +3704,8 @@
|
||||
<ref name='virDomainShutdown'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk5'>
|
||||
<letter name='l'>
|
||||
<word name='lack'>
|
||||
<ref name='virConnectGetVersion'/>
|
||||
@ -3615,6 +3830,16 @@
|
||||
<word name='listed'>
|
||||
<ref name='virDomainSave'/>
|
||||
</word>
|
||||
<word name='listen'>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='listened'>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
</word>
|
||||
<word name='listening'>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
</word>
|
||||
<word name='little-endian'>
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
</word>
|
||||
@ -3635,6 +3860,9 @@
|
||||
<word name='long'>
|
||||
<ref name='virNodeGetCellsFreeMemory'/>
|
||||
</word>
|
||||
<word name='longer'>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
</word>
|
||||
<word name='look'>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
</word>
|
||||
@ -3654,8 +3882,6 @@
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk5'>
|
||||
<letter name='m'>
|
||||
<word name='machine'>
|
||||
<ref name='virDomainGetAutostart'/>
|
||||
@ -3787,9 +4013,16 @@
|
||||
<word name='model'>
|
||||
<ref name='_virNodeInfo'/>
|
||||
</word>
|
||||
<word name='modify'>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='moment'>
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
</word>
|
||||
<word name='monitor'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='monitoring'>
|
||||
<ref name='virConnectClose'/>
|
||||
</word>
|
||||
@ -3842,6 +4075,8 @@
|
||||
<ref name='_virDomainBlockStats'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk6'>
|
||||
<letter name='n'>
|
||||
<word name='name'>
|
||||
<ref name='_virSchedParameter'/>
|
||||
@ -3910,6 +4145,8 @@
|
||||
<ref name='virDomainLookupByUUIDString'/>
|
||||
<ref name='virDomainMigrate'/>
|
||||
<ref name='virDomainSetVcpus'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
<ref name='virNetworkCreateXML'/>
|
||||
<ref name='virNetworkLookupByName'/>
|
||||
<ref name='virNetworkLookupByUUID'/>
|
||||
@ -3943,6 +4180,10 @@
|
||||
<word name='note'>
|
||||
<ref name='_virError'/>
|
||||
</word>
|
||||
<word name='notified'>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='now'>
|
||||
<ref name='virStoragePoolBuild'/>
|
||||
<ref name='virStoragePoolCreate'/>
|
||||
@ -3965,10 +4206,17 @@
|
||||
<word name='obliteration'>
|
||||
<ref name='virStoragePoolDelete'/>
|
||||
</word>
|
||||
<word name='occured'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
</word>
|
||||
<word name='occurred'>
|
||||
<ref name='virConnGetLastError'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virGetLastError'/>
|
||||
</word>
|
||||
<word name='occurs'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
</word>
|
||||
<word name='offline'>
|
||||
<ref name='_virVcpuInfo'/>
|
||||
</word>
|
||||
@ -3998,6 +4246,10 @@
|
||||
<word name='oo_req'>
|
||||
<ref name='_virDomainBlockStats'/>
|
||||
</word>
|
||||
<word name='opaque'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
</word>
|
||||
<word name='open'>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
</word>
|
||||
@ -4059,8 +4311,6 @@
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk6'>
|
||||
<letter name='p'>
|
||||
<word name='parameter'>
|
||||
<ref name='_virSchedParameter'/>
|
||||
@ -4094,10 +4344,13 @@
|
||||
</word>
|
||||
<word name='pass'>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectDomainEventRegister'/>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
<ref name='virDomainCreateLinux'/>
|
||||
<ref name='virDomainCreateXML'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virStorageVolCreateXML'/>
|
||||
<ref name='virStorageVolGetXMLDesc'/>
|
||||
</word>
|
||||
@ -4241,6 +4494,8 @@
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk7'>
|
||||
<letter name='q'>
|
||||
<word name='querying'>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
@ -4292,6 +4547,10 @@
|
||||
<ref name='virConnCopyLastError'/>
|
||||
<ref name='virCopyLastError'/>
|
||||
</word>
|
||||
<word name='receiving'>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
</word>
|
||||
<word name='redhat'>
|
||||
<ref name='virConnectGetType'/>
|
||||
</word>
|
||||
@ -4310,6 +4569,11 @@
|
||||
<word name='refreshed'>
|
||||
<ref name='virStoragePoolRefresh'/>
|
||||
</word>
|
||||
<word name='registered'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
</word>
|
||||
<word name='related'>
|
||||
<ref name='VIR_UNUSE_CPU'/>
|
||||
<ref name='VIR_USE_CPU'/>
|
||||
@ -4340,6 +4604,12 @@
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
<ref name='virStoragePoolRefresh'/>
|
||||
</word>
|
||||
<word name='remove'>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='removes'>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='rename'>
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
@ -4499,8 +4769,6 @@
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk7'>
|
||||
<letter name='s'>
|
||||
<word name='same'>
|
||||
<ref name='virConnectGetURI'/>
|
||||
@ -4626,8 +4894,12 @@
|
||||
<ref name='_virStoragePoolInfo'/>
|
||||
<ref name='virStoragePoolGetInfo'/>
|
||||
</word>
|
||||
<word name='specfic'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
</word>
|
||||
<word name='specific'>
|
||||
<ref name='virConnectGetMaxVcpus'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
</word>
|
||||
<word name='specified'>
|
||||
<ref name='VIR_COPY_CPUMAP'/>
|
||||
@ -4702,6 +4974,7 @@
|
||||
</word>
|
||||
<word name='stop'>
|
||||
<ref name='virDomainUndefine'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virNetworkUndefine'/>
|
||||
</word>
|
||||
<word name='stopped'>
|
||||
@ -4817,6 +5090,8 @@
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk8'>
|
||||
<letter name='t'>
|
||||
<word name='target'>
|
||||
<ref name='virConnCopyLastError'/>
|
||||
@ -4921,6 +5196,16 @@
|
||||
<ref name='_virVcpuInfo'/>
|
||||
<ref name='virStoragePoolGetAutostart'/>
|
||||
</word>
|
||||
<word name='timeout'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='timer'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='together'>
|
||||
<ref name='virDomainGetConnect'/>
|
||||
<ref name='virNetworkGetConnect'/>
|
||||
@ -4946,6 +5231,7 @@
|
||||
</word>
|
||||
<word name='type'>
|
||||
<ref name='_virSchedParameter'/>
|
||||
<ref name='virConnectDomainEventDeregister'/>
|
||||
<ref name='virConnectFindStoragePoolSources'/>
|
||||
<ref name='virConnectGetMaxVcpus'/>
|
||||
<ref name='virDomainGetOSType'/>
|
||||
@ -4960,8 +5246,6 @@
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk8'>
|
||||
<letter name='u'>
|
||||
<word name='undefined'>
|
||||
<ref name='virDomainDefineXML'/>
|
||||
@ -5010,6 +5294,9 @@
|
||||
<ref name='virStorageVolCreateXML'/>
|
||||
<ref name='virStorageVolGetXMLDesc'/>
|
||||
</word>
|
||||
<word name='updates'>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='upon'>
|
||||
<ref name='virStoragePoolBuild'/>
|
||||
</word>
|
||||
@ -5077,12 +5364,26 @@
|
||||
<word name='user'>
|
||||
<ref name='_virConnectCredential'/>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virDomainGetInfo'/>
|
||||
<ref name='virDomainMigrate'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virEventTimeoutCallback'/>
|
||||
<ref name='virNodeGetInfo'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
</word>
|
||||
<word name='user-defined'>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventRemoveTimeoutFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
</word>
|
||||
<word name='user-provided'>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
</word>
|
||||
<word name='uses'>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
</word>
|
||||
@ -5090,6 +5391,8 @@
|
||||
<ref name='virDomainMigrate'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk9'>
|
||||
<letter name='v'>
|
||||
<word name='value'>
|
||||
<ref name='VIR_CPU_USABLE'/>
|
||||
@ -5101,6 +5404,8 @@
|
||||
<ref name='virDomainGetSchedulerType'/>
|
||||
<ref name='virDomainGetXMLDesc'/>
|
||||
<ref name='virDomainSetSchedulerParameters'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventUpdateTimeoutFunc'/>
|
||||
<ref name='virGetVersion'/>
|
||||
<ref name='virNetworkGetAutostart'/>
|
||||
<ref name='virNetworkGetBridgeName'/>
|
||||
@ -5131,6 +5436,9 @@
|
||||
<word name='virConnCopyLastError'>
|
||||
<ref name='virConnGetLastError'/>
|
||||
</word>
|
||||
<word name='virConnect'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
</word>
|
||||
<word name='virConnectCredentialType'>
|
||||
<ref name='_virConnectAuth'/>
|
||||
<ref name='_virConnectCredential'/>
|
||||
@ -5163,6 +5471,9 @@
|
||||
<word name='virDomainDefineXML'>
|
||||
<ref name='virDomainCreateXML'/>
|
||||
</word>
|
||||
<word name='virDomainEventType'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
</word>
|
||||
<word name='virDomainGetSchedulerType'>
|
||||
<ref name='virDomainGetSchedulerParameters'/>
|
||||
<ref name='virDomainSetSchedulerParameters'/>
|
||||
@ -5222,6 +5533,9 @@
|
||||
<word name='virErrorNumber'>
|
||||
<ref name='_virError'/>
|
||||
</word>
|
||||
<word name='virEventHandleType'>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
</word>
|
||||
<word name='virNetworkCreateXML'>
|
||||
<ref name='virNetworkGetXMLDesc'/>
|
||||
</word>
|
||||
@ -5304,8 +5618,6 @@
|
||||
<ref name='virStorageVolCreateXML'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk9'>
|
||||
<letter name='w'>
|
||||
<word name='want'>
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
@ -5326,10 +5638,14 @@
|
||||
<ref name='virStorageVolGetKey'/>
|
||||
</word>
|
||||
<word name='when'>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virDomainCreateXML'/>
|
||||
<ref name='virDomainGetAutostart'/>
|
||||
<ref name='virDomainSetAutostart'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virEventAddTimeoutFunc'/>
|
||||
<ref name='virEventRemoveHandleFunc'/>
|
||||
<ref name='virEventUpdateHandleFunc'/>
|
||||
<ref name='virInitialize'/>
|
||||
<ref name='virNetworkGetAutostart'/>
|
||||
<ref name='virNetworkSetAutostart'/>
|
||||
@ -5353,6 +5669,7 @@
|
||||
<ref name='virConnGetLastError'/>
|
||||
<ref name='virConnSetErrorFunc'/>
|
||||
<ref name='virConnectClose'/>
|
||||
<ref name='virConnectDomainEventCallback'/>
|
||||
<ref name='virConnectGetHostname'/>
|
||||
<ref name='virConnectGetURI'/>
|
||||
<ref name='virDomainBlockPeek'/>
|
||||
@ -5362,6 +5679,8 @@
|
||||
<ref name='virDomainMemoryPeek'/>
|
||||
<ref name='virDomainMigrate'/>
|
||||
<ref name='virDomainPinVcpu'/>
|
||||
<ref name='virEventAddHandleFunc'/>
|
||||
<ref name='virEventHandleCallback'/>
|
||||
<ref name='virGetLastError'/>
|
||||
<ref name='virGetVersion'/>
|
||||
<ref name='virNetworkGetBridgeName'/>
|
||||
@ -5427,6 +5746,8 @@
|
||||
<ref name='virConnectGetType'/>
|
||||
</word>
|
||||
</letter>
|
||||
</chunk>
|
||||
<chunk name='chunk10'>
|
||||
<letter name='x'>
|
||||
<word name='xen'>
|
||||
<ref name='virConnectOpen'/>
|
||||
@ -5468,12 +5789,13 @@
|
||||
<chunk name='chunk1' start='R' end='a'/>
|
||||
<chunk name='chunk2' start='b' end='c'/>
|
||||
<chunk name='chunk3' start='d' end='f'/>
|
||||
<chunk name='chunk4' start='g' end='l'/>
|
||||
<chunk name='chunk5' start='m' end='o'/>
|
||||
<chunk name='chunk6' start='p' end='r'/>
|
||||
<chunk name='chunk7' start='s' end='t'/>
|
||||
<chunk name='chunk8' start='u' end='v'/>
|
||||
<chunk name='chunk9' start='w' end='z'/>
|
||||
<chunk name='chunk4' start='g' end='k'/>
|
||||
<chunk name='chunk5' start='l' end='m'/>
|
||||
<chunk name='chunk6' start='n' end='p'/>
|
||||
<chunk name='chunk7' start='q' end='s'/>
|
||||
<chunk name='chunk8' start='t' end='u'/>
|
||||
<chunk name='chunk9' start='v' end='w'/>
|
||||
<chunk name='chunk10' start='x' end='z'/>
|
||||
</chunks>
|
||||
</index>
|
||||
</apirefs>
|
||||
|
5
examples/domain-events/events-c/Makefile.am
Normal file
5
examples/domain-events/events-c/Makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
INCLUDES = -I@top_srcdir@/include
|
||||
noinst_PROGRAMS = event-test
|
||||
event_test_CFLAGS = $(WARN_CFLAGS)
|
||||
event_test_SOURCES = event-test.c
|
||||
event_test_LDADD = @top_builddir@/src/libvirt.la
|
261
examples/domain-events/events-c/event-test.c
Normal file
261
examples/domain-events/events-c/event-test.c
Normal file
@ -0,0 +1,261 @@
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/poll.h>
|
||||
#include <libvirt/libvirt.h>
|
||||
|
||||
#define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
|
||||
__FUNCTION__, __LINE__)
|
||||
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#define STREQ(a,b) (strcmp((a),(b)) == 0)
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
/* handle globals */
|
||||
int h_fd = 0;
|
||||
virEventHandleType h_event = 0;
|
||||
virEventHandleCallback h_cb = NULL;
|
||||
void *h_opaque = NULL;
|
||||
|
||||
/* timeout globals */
|
||||
#define TIMEOUT_MS 1000
|
||||
int t_active = 0;
|
||||
int t_timeout = -1;
|
||||
virEventTimeoutCallback t_cb = NULL;
|
||||
void *t_opaque = NULL;
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
const char *eventToString(int event);
|
||||
int myDomainEventCallback1 (virConnectPtr conn, virDomainPtr dom,
|
||||
int event, void *opaque);
|
||||
int myDomainEventCallback2 (virConnectPtr conn, virDomainPtr dom,
|
||||
int event, void *opaque);
|
||||
int myEventAddHandleFunc (int fd, int event,
|
||||
virEventHandleCallback cb, void *opaque);
|
||||
void myEventUpdateHandleFunc(int fd, int event);
|
||||
int myEventRemoveHandleFunc(int fd);
|
||||
|
||||
int myEventAddTimeoutFunc(int timeout, virEventTimeoutCallback cb,
|
||||
void *opaque);
|
||||
void myEventUpdateTimeoutFunc(int timer, int timout);
|
||||
int myEventRemoveTimeoutFunc(int timer);
|
||||
|
||||
int myEventHandleTypeToPollEvent(virEventHandleType events);
|
||||
virEventHandleType myPollEventToEventHandleType(int events);
|
||||
|
||||
void usage(const char *pname);
|
||||
|
||||
/* Callback functions */
|
||||
|
||||
const char *eventToString(int event) {
|
||||
const char *ret = NULL;
|
||||
switch(event) {
|
||||
case VIR_DOMAIN_EVENT_ADDED:
|
||||
ret ="Added";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_REMOVED:
|
||||
ret ="Removed";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STARTED:
|
||||
ret ="Started";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED:
|
||||
ret ="Suspended";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESUMED:
|
||||
ret ="Resumed";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STOPPED:
|
||||
ret ="Stopped";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SAVED:
|
||||
ret ="Saved";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESTORED:
|
||||
ret ="Restored";
|
||||
break;
|
||||
default:
|
||||
ret ="Unknown Event";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int myDomainEventCallback1 (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) %s\n", __FUNCTION__, virDomainGetName(dom),
|
||||
virDomainGetID(dom), eventToString(event));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) %s\n", __FUNCTION__, virDomainGetName(dom),
|
||||
virDomainGetID(dom), eventToString(event));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* EventImpl Functions */
|
||||
int myEventHandleTypeToPollEvent(virEventHandleType events)
|
||||
{
|
||||
int ret = 0;
|
||||
if(events & VIR_EVENT_HANDLE_READABLE)
|
||||
ret |= POLLIN;
|
||||
if(events & VIR_EVENT_HANDLE_WRITABLE)
|
||||
ret |= POLLOUT;
|
||||
if(events & VIR_EVENT_HANDLE_ERROR)
|
||||
ret |= POLLERR;
|
||||
if(events & VIR_EVENT_HANDLE_HANGUP)
|
||||
ret |= POLLHUP;
|
||||
return ret;
|
||||
}
|
||||
|
||||
virEventHandleType myPollEventToEventHandleType(int events)
|
||||
{
|
||||
virEventHandleType ret = 0;
|
||||
if(events & POLLIN)
|
||||
ret |= VIR_EVENT_HANDLE_READABLE;
|
||||
if(events & POLLOUT)
|
||||
ret |= VIR_EVENT_HANDLE_WRITABLE;
|
||||
if(events & POLLERR)
|
||||
ret |= VIR_EVENT_HANDLE_ERROR;
|
||||
if(events & POLLHUP)
|
||||
ret |= VIR_EVENT_HANDLE_HANGUP;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int myEventAddHandleFunc(int fd, int event,
|
||||
virEventHandleCallback cb, void *opaque)
|
||||
{
|
||||
DEBUG("Add handle %d %d %p %p", fd, event, cb, opaque);
|
||||
h_fd = fd;
|
||||
h_event = myEventHandleTypeToPollEvent(event);
|
||||
h_cb = cb;
|
||||
h_opaque = opaque;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void myEventUpdateHandleFunc(int fd, int event)
|
||||
{
|
||||
DEBUG("Updated Handle %d %d", fd, event);
|
||||
h_event = myEventHandleTypeToPollEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
int myEventRemoveHandleFunc(int fd)
|
||||
{
|
||||
DEBUG("Removed Handle %d", fd);
|
||||
h_fd = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int myEventAddTimeoutFunc(int timeout, virEventTimeoutCallback cb,
|
||||
void *opaque)
|
||||
{
|
||||
DEBUG("Adding Timeout %d %p %p", timeout, cb, opaque);
|
||||
t_active = 1;
|
||||
t_timeout = timeout;
|
||||
t_cb = cb;
|
||||
t_opaque = opaque;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void myEventUpdateTimeoutFunc(int timer ATTRIBUTE_UNUSED, int timeout)
|
||||
{
|
||||
/*DEBUG("Timeout updated %d %d", timer, timeout);*/
|
||||
t_timeout = timeout;
|
||||
}
|
||||
|
||||
int myEventRemoveTimeoutFunc(int timer)
|
||||
{
|
||||
DEBUG("Timeout removed %d", timer);
|
||||
t_active = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* main test functions */
|
||||
|
||||
void usage(const char *pname)
|
||||
{
|
||||
printf("%s uri\n", pname);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int run=1;
|
||||
int sts;
|
||||
|
||||
if(argc > 1 && STREQ(argv[1],"--help")) {
|
||||
usage(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
virEventRegisterImpl( myEventAddHandleFunc,
|
||||
myEventUpdateHandleFunc,
|
||||
myEventRemoveHandleFunc,
|
||||
myEventAddTimeoutFunc,
|
||||
myEventUpdateTimeoutFunc,
|
||||
myEventRemoveTimeoutFunc);
|
||||
|
||||
virConnectPtr dconn = NULL;
|
||||
dconn = virConnectOpen (argv[1] ? argv[1] : "qemu:///system");
|
||||
if (!dconn) {
|
||||
printf("error opening\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
DEBUG0("Registering domain event cbs");
|
||||
|
||||
/* Add 2 callbacks to prove this works with more than just one */
|
||||
virConnectDomainEventRegister(dconn, myDomainEventCallback1, NULL);
|
||||
virConnectDomainEventRegister(dconn, myDomainEventCallback2, NULL);
|
||||
|
||||
while(run) {
|
||||
struct pollfd pfd = { .fd = h_fd,
|
||||
.events = h_event,
|
||||
.revents = 0};
|
||||
|
||||
sts = poll(&pfd, 1, TIMEOUT_MS);
|
||||
|
||||
/* We are assuming timeout of 0 here - so execute every time */
|
||||
if(t_cb && t_active)
|
||||
t_cb(t_timeout,t_opaque);
|
||||
|
||||
if (sts == 0) {
|
||||
/* DEBUG0("Poll timeout"); */
|
||||
continue;
|
||||
}
|
||||
if (sts < 0 ) {
|
||||
DEBUG0("Poll failed");
|
||||
continue;
|
||||
}
|
||||
if ( pfd.revents & POLLHUP ) {
|
||||
DEBUG0("Reset by peer");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(h_cb) {
|
||||
h_cb(h_fd,
|
||||
myPollEventToEventHandleType(pfd.revents & h_event),
|
||||
h_opaque);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( dconn && virConnectClose(dconn)<0 ) {
|
||||
printf("error closing\n");
|
||||
}
|
||||
printf("done\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -993,6 +993,159 @@ char * virStorageVolGetPath (virStorageVolPtr vol);
|
||||
virDomainPtr virDomainCreateLinux (virConnectPtr conn,
|
||||
const char *xmlDesc,
|
||||
unsigned int flags);
|
||||
|
||||
/*
|
||||
* Domain Event Notification
|
||||
*/
|
||||
|
||||
/**
|
||||
* virDomainEventType:
|
||||
*
|
||||
* a virDomainEventType is emitted during domain lifecycle events
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_EVENT_ADDED,
|
||||
VIR_DOMAIN_EVENT_REMOVED,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_SAVED,
|
||||
VIR_DOMAIN_EVENT_RESTORED,
|
||||
} virDomainEventType;
|
||||
|
||||
/**
|
||||
* virConnectDomainEventCallback:
|
||||
* @conn: virConnect connection
|
||||
* @dom: The domain on which the event occured
|
||||
* @event: The specfic virDomainEventType which occured
|
||||
* @opaque: opaque user data
|
||||
*
|
||||
* A callback function to be registered, and called when a domain event occurs
|
||||
*/
|
||||
typedef int (*virConnectDomainEventCallback)(virConnectPtr conn,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque);
|
||||
|
||||
int virConnectDomainEventRegister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb,
|
||||
void *opaque);
|
||||
|
||||
int virConnectDomainEventDeregister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb);
|
||||
|
||||
/*
|
||||
* Events Implementation
|
||||
*/
|
||||
|
||||
/**
|
||||
* virEventHandleType:
|
||||
*
|
||||
* a virEventHandleType is used similar to POLLxxx FD events, but is specific
|
||||
* to libvirt. A client app must translate to, and from POLL events when using
|
||||
* this construct.
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_EVENT_HANDLE_READABLE = (1 << 0),
|
||||
VIR_EVENT_HANDLE_WRITABLE = (1 << 1),
|
||||
VIR_EVENT_HANDLE_ERROR = (1 << 2),
|
||||
VIR_EVENT_HANDLE_HANGUP = (1 << 3),
|
||||
} virEventHandleType;
|
||||
|
||||
/**
|
||||
* virEventHandleCallback:
|
||||
*
|
||||
* @fd: file handle on which the event occurred
|
||||
* @events: bitset of events from virEventHandleType constants
|
||||
* @opaque: user data registered with handle
|
||||
*
|
||||
* callback for receiving file handle events
|
||||
*/
|
||||
typedef void (*virEventHandleCallback)(int fd, int events, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventAddHandleFunc:
|
||||
* @fd: file descriptor to listen on
|
||||
* @event: bitset of events on which to fire the callback
|
||||
* @cb: the callback to be called
|
||||
* @opaque: user data to pass to the callback
|
||||
*
|
||||
* Part of the EventImpl, this callback Adds a file handle callback to
|
||||
* listen for specific events
|
||||
*/
|
||||
typedef int (*virEventAddHandleFunc)(int fd, int event,
|
||||
virEventHandleCallback cb, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateHandleFunc:
|
||||
* @fd: file descriptor to modify
|
||||
* @event: new events to listen on
|
||||
*
|
||||
* Part of the EventImpl, this user-provided callback is notified when
|
||||
* events to listen on change
|
||||
*/
|
||||
typedef void (*virEventUpdateHandleFunc)(int fd, int event);
|
||||
|
||||
/**
|
||||
* virEventRemoveHandleFunc:
|
||||
* @fd: file descriptor to stop listening on
|
||||
*
|
||||
* Part of the EventImpl, this user-provided callback is notified when
|
||||
* an fd is no longer being listened on
|
||||
*/
|
||||
typedef int (*virEventRemoveHandleFunc)(int fd);
|
||||
|
||||
/**
|
||||
* virEventTimeoutCallback:
|
||||
*
|
||||
* @timer: timer id emitting the event
|
||||
* @opaque: user data registered with handle
|
||||
*
|
||||
* callback for receiving timer events
|
||||
*/
|
||||
typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventAddTimeoutFunc:
|
||||
* @timeout: The timeout to monitor
|
||||
* @cb: the callback to call when timeout has expired
|
||||
* @opaque: user data to pass to the callback
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback handles adding an
|
||||
* event timeout.
|
||||
*
|
||||
* Returns a timer value
|
||||
*/
|
||||
typedef int (*virEventAddTimeoutFunc)(int timeout, virEventTimeoutCallback cb,
|
||||
void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateTimeoutFunc:
|
||||
* @timer: the timer to modify
|
||||
* @timeout: the new timeout value
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback updates an
|
||||
* event timeout.
|
||||
*/
|
||||
typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout);
|
||||
|
||||
/**
|
||||
* virEventRemoveTimeoutFunc:
|
||||
* @timer: the timer to remove
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback removes a timer
|
||||
*
|
||||
* Returns 0 on success, -1 on failure
|
||||
*/
|
||||
typedef int (*virEventRemoveTimeoutFunc)(int timer);
|
||||
|
||||
void virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
||||
virEventUpdateHandleFunc updateHandle,
|
||||
virEventRemoveHandleFunc removeHandle,
|
||||
virEventAddTimeoutFunc addTimeout,
|
||||
virEventUpdateTimeoutFunc updateTimeout,
|
||||
virEventRemoveTimeoutFunc removeTimeout);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -993,6 +993,159 @@ char * virStorageVolGetPath (virStorageVolPtr vol);
|
||||
virDomainPtr virDomainCreateLinux (virConnectPtr conn,
|
||||
const char *xmlDesc,
|
||||
unsigned int flags);
|
||||
|
||||
/*
|
||||
* Domain Event Notification
|
||||
*/
|
||||
|
||||
/**
|
||||
* virDomainEventType:
|
||||
*
|
||||
* a virDomainEventType is emitted during domain lifecycle events
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_EVENT_ADDED,
|
||||
VIR_DOMAIN_EVENT_REMOVED,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_SAVED,
|
||||
VIR_DOMAIN_EVENT_RESTORED,
|
||||
} virDomainEventType;
|
||||
|
||||
/**
|
||||
* virConnectDomainEventCallback:
|
||||
* @conn: virConnect connection
|
||||
* @dom: The domain on which the event occured
|
||||
* @event: The specfic virDomainEventType which occured
|
||||
* @opaque: opaque user data
|
||||
*
|
||||
* A callback function to be registered, and called when a domain event occurs
|
||||
*/
|
||||
typedef int (*virConnectDomainEventCallback)(virConnectPtr conn,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque);
|
||||
|
||||
int virConnectDomainEventRegister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb,
|
||||
void *opaque);
|
||||
|
||||
int virConnectDomainEventDeregister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb);
|
||||
|
||||
/*
|
||||
* Events Implementation
|
||||
*/
|
||||
|
||||
/**
|
||||
* virEventHandleType:
|
||||
*
|
||||
* a virEventHandleType is used similar to POLLxxx FD events, but is specific
|
||||
* to libvirt. A client app must translate to, and from POLL events when using
|
||||
* this construct.
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_EVENT_HANDLE_READABLE = (1 << 0),
|
||||
VIR_EVENT_HANDLE_WRITABLE = (1 << 1),
|
||||
VIR_EVENT_HANDLE_ERROR = (1 << 2),
|
||||
VIR_EVENT_HANDLE_HANGUP = (1 << 3),
|
||||
} virEventHandleType;
|
||||
|
||||
/**
|
||||
* virEventHandleCallback:
|
||||
*
|
||||
* @fd: file handle on which the event occurred
|
||||
* @events: bitset of events from virEventHandleType constants
|
||||
* @opaque: user data registered with handle
|
||||
*
|
||||
* callback for receiving file handle events
|
||||
*/
|
||||
typedef void (*virEventHandleCallback)(int fd, int events, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventAddHandleFunc:
|
||||
* @fd: file descriptor to listen on
|
||||
* @event: bitset of events on which to fire the callback
|
||||
* @cb: the callback to be called
|
||||
* @opaque: user data to pass to the callback
|
||||
*
|
||||
* Part of the EventImpl, this callback Adds a file handle callback to
|
||||
* listen for specific events
|
||||
*/
|
||||
typedef int (*virEventAddHandleFunc)(int fd, int event,
|
||||
virEventHandleCallback cb, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateHandleFunc:
|
||||
* @fd: file descriptor to modify
|
||||
* @event: new events to listen on
|
||||
*
|
||||
* Part of the EventImpl, this user-provided callback is notified when
|
||||
* events to listen on change
|
||||
*/
|
||||
typedef void (*virEventUpdateHandleFunc)(int fd, int event);
|
||||
|
||||
/**
|
||||
* virEventRemoveHandleFunc:
|
||||
* @fd: file descriptor to stop listening on
|
||||
*
|
||||
* Part of the EventImpl, this user-provided callback is notified when
|
||||
* an fd is no longer being listened on
|
||||
*/
|
||||
typedef int (*virEventRemoveHandleFunc)(int fd);
|
||||
|
||||
/**
|
||||
* virEventTimeoutCallback:
|
||||
*
|
||||
* @timer: timer id emitting the event
|
||||
* @opaque: user data registered with handle
|
||||
*
|
||||
* callback for receiving timer events
|
||||
*/
|
||||
typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventAddTimeoutFunc:
|
||||
* @timeout: The timeout to monitor
|
||||
* @cb: the callback to call when timeout has expired
|
||||
* @opaque: user data to pass to the callback
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback handles adding an
|
||||
* event timeout.
|
||||
*
|
||||
* Returns a timer value
|
||||
*/
|
||||
typedef int (*virEventAddTimeoutFunc)(int timeout, virEventTimeoutCallback cb,
|
||||
void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateTimeoutFunc:
|
||||
* @timer: the timer to modify
|
||||
* @timeout: the new timeout value
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback updates an
|
||||
* event timeout.
|
||||
*/
|
||||
typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout);
|
||||
|
||||
/**
|
||||
* virEventRemoveTimeoutFunc:
|
||||
* @timer: the timer to remove
|
||||
*
|
||||
* Part of the EventImpl, this user-defined callback removes a timer
|
||||
*
|
||||
* Returns 0 on success, -1 on failure
|
||||
*/
|
||||
typedef int (*virEventRemoveTimeoutFunc)(int timer);
|
||||
|
||||
void virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
||||
virEventUpdateHandleFunc updateHandle,
|
||||
virEventRemoveHandleFunc removeHandle,
|
||||
virEventAddTimeoutFunc addTimeout,
|
||||
virEventUpdateTimeoutFunc updateTimeout,
|
||||
virEventRemoveTimeoutFunc removeTimeout);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -17,6 +17,7 @@ libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xend_internal.c \
|
||||
@top_srcdir@/src/memory.c \
|
||||
@top_srcdir@/src/domain_conf.c \
|
||||
@top_srcdir@/src/util.c \
|
||||
@top_srcdir@/src/event.c \
|
||||
@top_srcdir@/src/uuid.c
|
||||
libvirt_proxy_LDFLAGS = $(WARN_CFLAGS)
|
||||
libvirt_proxy_DEPENDENCIES =
|
||||
|
@ -332,6 +332,9 @@ skip_function = (
|
||||
'virCopyLastError', # Python API is called virGetLastError instead
|
||||
'virConnectOpenAuth', # Python C code is manually written
|
||||
'virDefaultErrorFunc', # Python virErrorFuncHandler impl calls this from C
|
||||
'virConnectDomainEventRegister', # TODO: generate python bindings for these below XXX
|
||||
'virConnectDomainEventDeregister',
|
||||
'virEventRegisterImpl',
|
||||
)
|
||||
|
||||
|
||||
|
@ -74,13 +74,13 @@ static struct virEventLoop eventLoop;
|
||||
/* Unique ID for the next timer to be registered */
|
||||
static int nextTimer = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Register a callback for monitoring file handle events.
|
||||
* NB, it *must* be safe to call this from within a callback
|
||||
* For this reason we only ever append to existing list.
|
||||
*/
|
||||
int virEventAddHandleImpl(int fd, int events, virEventHandleCallback cb, void *opaque) {
|
||||
int virEventAddHandleImpl(int fd, int events, virEventHandleCallback cb,
|
||||
void *opaque) {
|
||||
EVENT_DEBUG("Add handle %d %d %p %p", fd, events, cb, opaque);
|
||||
if (eventLoop.handlesCount == eventLoop.handlesAlloc) {
|
||||
EVENT_DEBUG("Used %d handle slots, adding %d more",
|
||||
@ -92,7 +92,8 @@ int virEventAddHandleImpl(int fd, int events, virEventHandleCallback cb, void *o
|
||||
}
|
||||
|
||||
eventLoop.handles[eventLoop.handlesCount].fd = fd;
|
||||
eventLoop.handles[eventLoop.handlesCount].events = events;
|
||||
eventLoop.handles[eventLoop.handlesCount].events =
|
||||
virEventHandleTypeToPollEvent(events);
|
||||
eventLoop.handles[eventLoop.handlesCount].cb = cb;
|
||||
eventLoop.handles[eventLoop.handlesCount].opaque = opaque;
|
||||
eventLoop.handles[eventLoop.handlesCount].deleted = 0;
|
||||
@ -106,7 +107,8 @@ void virEventUpdateHandleImpl(int fd, int events) {
|
||||
int i;
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].fd == fd) {
|
||||
eventLoop.handles[i].events = events;
|
||||
eventLoop.handles[i].events =
|
||||
virEventHandleTypeToPollEvent(events);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -342,6 +344,7 @@ static int virEventDispatchTimeouts(void) {
|
||||
*/
|
||||
static int virEventDispatchHandles(struct pollfd *fds) {
|
||||
int i;
|
||||
virEventHandleType hEvents;
|
||||
/* Save this now - it may be changed during dispatch */
|
||||
int nhandles = eventLoop.handlesCount;
|
||||
|
||||
@ -352,8 +355,10 @@ static int virEventDispatchHandles(struct pollfd *fds) {
|
||||
}
|
||||
|
||||
if (fds[i].revents) {
|
||||
EVENT_DEBUG("Dispatch %d %d %p", fds[i].fd, fds[i].revents, eventLoop.handles[i].opaque);
|
||||
(eventLoop.handles[i].cb)(fds[i].fd, fds[i].revents,
|
||||
hEvents = virPollEventToEventHandleType(fds[i].revents);
|
||||
EVENT_DEBUG("Dispatch %d %d %p", fds[i].fd, fds[i].revents,
|
||||
eventLoop.handles[i].opaque);
|
||||
(eventLoop.handles[i].cb)(fds[i].fd, hEvents,
|
||||
eventLoop.handles[i].opaque);
|
||||
}
|
||||
}
|
||||
@ -482,3 +487,33 @@ int virEventRunOnce(void) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
__virEventHandleTypeToPollEvent(virEventHandleType events)
|
||||
{
|
||||
int ret = 0;
|
||||
if(events & VIR_EVENT_HANDLE_READABLE)
|
||||
ret |= POLLIN;
|
||||
if(events & VIR_EVENT_HANDLE_WRITABLE)
|
||||
ret |= POLLOUT;
|
||||
if(events & VIR_EVENT_HANDLE_ERROR)
|
||||
ret |= POLLERR;
|
||||
if(events & VIR_EVENT_HANDLE_HANGUP)
|
||||
ret |= POLLHUP;
|
||||
return ret;
|
||||
}
|
||||
|
||||
virEventHandleType
|
||||
__virPollEventToEventHandleType(int events)
|
||||
{
|
||||
virEventHandleType ret = 0;
|
||||
if(events & POLLIN)
|
||||
ret |= VIR_EVENT_HANDLE_READABLE;
|
||||
if(events & POLLOUT)
|
||||
ret |= VIR_EVENT_HANDLE_WRITABLE;
|
||||
if(events & POLLERR)
|
||||
ret |= VIR_EVENT_HANDLE_ERROR;
|
||||
if(events & POLLHUP)
|
||||
ret |= VIR_EVENT_HANDLE_HANGUP;
|
||||
return ret;
|
||||
}
|
||||
|
@ -36,7 +36,8 @@
|
||||
*
|
||||
* returns -1 if the file handle cannot be registered, 0 upon success
|
||||
*/
|
||||
int virEventAddHandleImpl(int fd, int events, virEventHandleCallback cb, void *opaque);
|
||||
int virEventAddHandleImpl(int fd, int events, virEventHandleCallback cb,
|
||||
void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateHandleImpl: change event set for a monitored file handle
|
||||
|
12
qemud/mdns.c
12
qemud/mdns.c
@ -231,14 +231,16 @@ static void libvirtd_mdns_client_callback(AvahiClient *c, AvahiClientState state
|
||||
static void libvirtd_mdns_watch_dispatch(int fd, int events, void *opaque)
|
||||
{
|
||||
AvahiWatch *w = (AvahiWatch*)opaque;
|
||||
AVAHI_DEBUG("Dispatch watch FD %d Event %d", fd, events);
|
||||
w->revents = events;
|
||||
w->callback(w, fd, events, w->userdata);
|
||||
int fd_events = virEventHandleTypeToPollEvent(events);
|
||||
AVAHI_DEBUG("Dispatch watch FD %d Event %d", fd, fd_events);
|
||||
w->revents = fd_events;
|
||||
w->callback(w, fd, fd_events, w->userdata);
|
||||
}
|
||||
|
||||
static AvahiWatch *libvirtd_mdns_watch_new(const AvahiPoll *api ATTRIBUTE_UNUSED,
|
||||
int fd, AvahiWatchEvent event, AvahiWatchCallback cb, void *userdata) {
|
||||
AvahiWatch *w;
|
||||
virEventHandleType hEvents;
|
||||
if (VIR_ALLOC(w) < 0)
|
||||
return NULL;
|
||||
|
||||
@ -248,7 +250,9 @@ static AvahiWatch *libvirtd_mdns_watch_new(const AvahiPoll *api ATTRIBUTE_UNUSED
|
||||
w->userdata = userdata;
|
||||
|
||||
AVAHI_DEBUG("New handle %p FD %d Event %d", w, w->fd, event);
|
||||
if (virEventAddHandleImpl(fd, event, libvirtd_mdns_watch_dispatch, w) < 0) {
|
||||
hEvents = virPollEventToEventHandleType(event);
|
||||
if (virEventAddHandleImpl(fd, hEvents,
|
||||
libvirtd_mdns_watch_dispatch, w) < 0) {
|
||||
VIR_FREE(w);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -230,9 +230,10 @@ remoteInitializeGnuTLS (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qemudDispatchSignalEvent(int fd ATTRIBUTE_UNUSED,
|
||||
int events ATTRIBUTE_UNUSED,
|
||||
void *opaque) {
|
||||
static void
|
||||
qemudDispatchSignalEvent(int fd ATTRIBUTE_UNUSED,
|
||||
int events ATTRIBUTE_UNUSED,
|
||||
void *opaque) {
|
||||
struct qemud_server *server = (struct qemud_server *)opaque;
|
||||
siginfo_t siginfo;
|
||||
int ret;
|
||||
@ -521,10 +522,13 @@ static int qemudListenUnix(struct qemud_server *server,
|
||||
}
|
||||
|
||||
if (virEventAddHandleImpl(sock->fd,
|
||||
POLLIN| POLLERR | POLLHUP,
|
||||
VIR_EVENT_HANDLE_READABLE |
|
||||
VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
qemudDispatchServerEvent,
|
||||
server) < 0) {
|
||||
qemudLog(QEMUD_ERR, "%s", _("Failed to add server event callback"));
|
||||
qemudLog(QEMUD_ERR, "%s",
|
||||
_("Failed to add server event callback"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -650,7 +654,9 @@ remoteListenTCP (struct qemud_server *server,
|
||||
}
|
||||
|
||||
if (virEventAddHandleImpl(sock->fd,
|
||||
POLLIN| POLLERR | POLLHUP,
|
||||
VIR_EVENT_HANDLE_READABLE |
|
||||
VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
qemudDispatchServerEvent,
|
||||
server) < 0) {
|
||||
qemudLog(QEMUD_ERR, "%s", _("Failed to add server event callback"));
|
||||
@ -723,12 +729,12 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
|
||||
server->sigread = sigread;
|
||||
|
||||
__virEventRegisterImpl(virEventAddHandleImpl,
|
||||
virEventUpdateHandleImpl,
|
||||
virEventRemoveHandleImpl,
|
||||
virEventAddTimeoutImpl,
|
||||
virEventUpdateTimeoutImpl,
|
||||
virEventRemoveTimeoutImpl);
|
||||
virEventRegisterImpl(virEventAddHandleImpl,
|
||||
virEventUpdateHandleImpl,
|
||||
virEventRemoveHandleImpl,
|
||||
virEventAddTimeoutImpl,
|
||||
virEventUpdateTimeoutImpl,
|
||||
virEventRemoveTimeoutImpl);
|
||||
|
||||
virStateInitialize();
|
||||
|
||||
@ -1105,6 +1111,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
client->auth = sock->auth;
|
||||
memcpy (&client->addr, &addr, sizeof addr);
|
||||
client->addrlen = addrlen;
|
||||
client->server = server;
|
||||
|
||||
#if HAVE_POLKIT
|
||||
/* Only do policy checks for non-root - allow root user
|
||||
@ -1199,6 +1206,12 @@ static void qemudDispatchClientFailure(struct qemud_server *server, struct qemud
|
||||
|
||||
virEventRemoveHandleImpl(client->fd);
|
||||
|
||||
/* Deregister event delivery callback */
|
||||
if(client->conn) {
|
||||
qemudDebug("Deregistering to relay remote events");
|
||||
virConnectDomainEventDeregister(client->conn, remoteRelayDomainEvent);
|
||||
}
|
||||
|
||||
if (client->conn)
|
||||
virConnectClose(client->conn);
|
||||
|
||||
@ -1503,7 +1516,9 @@ static int qemudClientWrite(struct qemud_server *server,
|
||||
}
|
||||
|
||||
|
||||
static void qemudDispatchClientWrite(struct qemud_server *server, struct qemud_client *client) {
|
||||
void
|
||||
qemudDispatchClientWrite(struct qemud_server *server,
|
||||
struct qemud_client *client) {
|
||||
switch (client->mode) {
|
||||
case QEMUD_MODE_TX_PACKET: {
|
||||
if (qemudClientWrite(server, client) < 0)
|
||||
@ -1552,7 +1567,8 @@ static void qemudDispatchClientWrite(struct qemud_server *server, struct qemud_c
|
||||
}
|
||||
|
||||
|
||||
static void qemudDispatchClientEvent(int fd, int events, void *opaque) {
|
||||
static void
|
||||
qemudDispatchClientEvent(int fd, int events, void *opaque) {
|
||||
struct qemud_server *server = (struct qemud_server *)opaque;
|
||||
struct qemud_client *client = server->clients;
|
||||
|
||||
@ -1566,9 +1582,9 @@ static void qemudDispatchClientEvent(int fd, int events, void *opaque) {
|
||||
if (!client)
|
||||
return;
|
||||
|
||||
if (events == POLLOUT)
|
||||
if (events == VIR_EVENT_HANDLE_WRITABLE)
|
||||
qemudDispatchClientWrite(server, client);
|
||||
else if (events == POLLIN)
|
||||
else if (events == VIR_EVENT_HANDLE_READABLE)
|
||||
qemudDispatchClientRead(server, client);
|
||||
else
|
||||
qemudDispatchClientFailure(server, client);
|
||||
@ -1581,18 +1597,18 @@ static int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
switch (client->mode) {
|
||||
case QEMUD_MODE_TLS_HANDSHAKE:
|
||||
if (gnutls_record_get_direction (client->tlssession) == 0)
|
||||
mode = POLLIN;
|
||||
mode = VIR_EVENT_HANDLE_READABLE;
|
||||
else
|
||||
mode = POLLOUT;
|
||||
mode = VIR_EVENT_HANDLE_WRITABLE;
|
||||
break;
|
||||
|
||||
case QEMUD_MODE_RX_HEADER:
|
||||
case QEMUD_MODE_RX_PAYLOAD:
|
||||
mode = POLLIN;
|
||||
mode = VIR_EVENT_HANDLE_READABLE;
|
||||
break;
|
||||
|
||||
case QEMUD_MODE_TX_PACKET:
|
||||
mode = POLLOUT;
|
||||
mode = VIR_EVENT_HANDLE_WRITABLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1604,7 +1620,8 @@ static int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
return -1;
|
||||
|
||||
if (virEventAddHandleImpl(client->fd,
|
||||
mode | POLLERR | POLLHUP,
|
||||
mode | VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
qemudDispatchClientEvent,
|
||||
server) < 0)
|
||||
return -1;
|
||||
@ -1612,7 +1629,8 @@ static int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qemudDispatchServerEvent(int fd, int events, void *opaque) {
|
||||
static void
|
||||
qemudDispatchServerEvent(int fd, int events, void *opaque) {
|
||||
struct qemud_server *server = (struct qemud_server *)opaque;
|
||||
struct qemud_socket *sock = server->sockets;
|
||||
|
||||
@ -2215,7 +2233,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (virEventAddHandleImpl(sigpipe[0],
|
||||
POLLIN,
|
||||
VIR_EVENT_HANDLE_READABLE,
|
||||
qemudDispatchSignalEvent,
|
||||
server) < 0) {
|
||||
qemudLog(QEMUD_ERR,
|
||||
|
@ -132,6 +132,9 @@ struct qemud_client {
|
||||
*/
|
||||
virConnectPtr conn;
|
||||
|
||||
/* back-pointer to our server */
|
||||
struct qemud_server *server;
|
||||
|
||||
struct qemud_client *next;
|
||||
};
|
||||
|
||||
@ -179,8 +182,16 @@ void qemudLog(int priority, const char *fmt, ...)
|
||||
void remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client);
|
||||
|
||||
void qemudDispatchClientWrite(struct qemud_server *server,
|
||||
struct qemud_client *client);
|
||||
|
||||
#if HAVE_POLKIT
|
||||
int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid);
|
||||
#endif
|
||||
|
||||
int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque);
|
||||
|
||||
#endif
|
||||
|
143
qemud/remote.c
143
qemud/remote.c
@ -75,6 +75,12 @@ typedef int (*dispatch_fn) (struct qemud_server *server,
|
||||
char *args,
|
||||
char *ret);
|
||||
|
||||
/* Prototypes */
|
||||
static void
|
||||
remoteDispatchDomainEventSend (struct qemud_client *client,
|
||||
virDomainPtr dom,
|
||||
virDomainEventType event);
|
||||
|
||||
/* This function gets called from qemud when it detects an incoming
|
||||
* remote protocol message. At this point, client->buffer contains
|
||||
* the full call message (including length word which we skip).
|
||||
@ -405,6 +411,20 @@ remoteDispatchError (struct qemud_client *client,
|
||||
remoteDispatchSendError (client, req, VIR_ERR_RPC, msg);
|
||||
}
|
||||
|
||||
int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
void *opaque)
|
||||
{
|
||||
struct qemud_client *client = opaque;
|
||||
REMOTE_DEBUG("Relaying domain event %d", event);
|
||||
|
||||
if(client) {
|
||||
remoteDispatchDomainEventSend (client, dom, event);
|
||||
qemudDispatchClientWrite(client->server,client);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*----- Functions. -----*/
|
||||
@ -3620,6 +3640,129 @@ remoteDispatchStorageVolLookupByPath (struct qemud_server *server ATTRIBUTE_UNUS
|
||||
}
|
||||
|
||||
|
||||
/**************************
|
||||
* Async Events
|
||||
**************************/
|
||||
static int
|
||||
remoteDispatchDomainEvent (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
remote_message_header *req ATTRIBUTE_UNUSED,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_domain_event_ret *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* This call gets dispatched from a client call.
|
||||
* This does not make sense, as this should not be intiated
|
||||
* from the client side in generated code.
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
/***************************
|
||||
* Register / deregister events
|
||||
***************************/
|
||||
static int
|
||||
remoteDispatchDomainEventsRegister (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req ATTRIBUTE_UNUSED,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_domain_events_register_ret *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
CHECK_CONN(client);
|
||||
|
||||
/* Register event delivery callback */
|
||||
REMOTE_DEBUG("%s","Registering to relay remote events");
|
||||
virConnectDomainEventRegister(client->conn, remoteRelayDomainEvent, client);
|
||||
|
||||
if(ret)
|
||||
ret->cb_registered = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainEventsDeregister (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req ATTRIBUTE_UNUSED,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_domain_events_deregister_ret *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
CHECK_CONN(client);
|
||||
|
||||
/* Deregister event delivery callback */
|
||||
REMOTE_DEBUG("%s","Deregistering to relay remote events");
|
||||
virConnectDomainEventDeregister(client->conn, remoteRelayDomainEvent);
|
||||
|
||||
if(ret)
|
||||
ret->cb_registered = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
remoteDispatchDomainEventSend (struct qemud_client *client,
|
||||
virDomainPtr dom,
|
||||
virDomainEventType event)
|
||||
{
|
||||
remote_message_header rep;
|
||||
XDR xdr;
|
||||
int len;
|
||||
remote_domain_event_ret data;
|
||||
|
||||
if(!client) {
|
||||
remoteDispatchError (client, NULL, "%s", _("Invalid Client"));
|
||||
return;
|
||||
}
|
||||
|
||||
rep.prog = REMOTE_PROGRAM;
|
||||
rep.vers = REMOTE_PROTOCOL_VERSION;
|
||||
rep.proc = REMOTE_PROC_DOMAIN_EVENT;
|
||||
rep.direction = REMOTE_MESSAGE;
|
||||
rep.serial = 1;
|
||||
rep.status = REMOTE_OK;
|
||||
|
||||
/* Serialise the return header and event. */
|
||||
xdrmem_create (&xdr, client->buffer, sizeof client->buffer, XDR_ENCODE);
|
||||
|
||||
len = 0; /* We'll come back and write this later. */
|
||||
if (!xdr_int (&xdr, &len)) {
|
||||
remoteDispatchError (client, NULL, "%s", _("xdr_int failed (1)"));
|
||||
xdr_destroy (&xdr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xdr_remote_message_header (&xdr, &rep)) {
|
||||
xdr_destroy (&xdr);
|
||||
return;
|
||||
}
|
||||
|
||||
/* build return data */
|
||||
make_nonnull_domain (&data.dom, dom);
|
||||
data.event = (int) event;
|
||||
|
||||
if (!xdr_remote_domain_event_ret(&xdr, &data)) {
|
||||
remoteDispatchError (client, NULL, "%s", _("serialise return struct"));
|
||||
xdr_destroy (&xdr);
|
||||
return;
|
||||
}
|
||||
|
||||
len = xdr_getpos (&xdr);
|
||||
if (xdr_setpos (&xdr, 0) == 0) {
|
||||
remoteDispatchError (client, NULL, "%s", _("xdr_setpos failed"));
|
||||
xdr_destroy (&xdr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xdr_int (&xdr, &len)) {
|
||||
remoteDispatchError (client, NULL, "%s", _("xdr_int failed (2)"));
|
||||
xdr_destroy (&xdr);
|
||||
return;
|
||||
}
|
||||
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
/* Send it. */
|
||||
client->mode = QEMUD_MODE_TX_PACKET;
|
||||
client->bufferLength = len;
|
||||
client->bufferOffset = 0;
|
||||
}
|
||||
/*----- Helpers. -----*/
|
||||
|
||||
/* get_nonnull_domain and get_nonnull_network turn an on-wire
|
||||
|
@ -6,6 +6,7 @@ remote_domain_lookup_by_uuid_args lv_remote_domain_lookup_by_uuid_args;
|
||||
remote_domain_lookup_by_uuid_ret lv_remote_domain_lookup_by_uuid_ret;
|
||||
remote_storage_pool_list_volumes_args lv_remote_storage_pool_list_volumes_args;
|
||||
remote_storage_pool_list_volumes_ret lv_remote_storage_pool_list_volumes_ret;
|
||||
remote_domain_events_deregister_ret lv_remote_domain_events_deregister_ret;
|
||||
remote_domain_shutdown_args lv_remote_domain_shutdown_args;
|
||||
remote_list_defined_domains_args lv_remote_list_defined_domains_args;
|
||||
remote_list_defined_domains_ret lv_remote_list_defined_domains_ret;
|
||||
@ -20,6 +21,7 @@ remote_domain_get_autostart_args lv_remote_domain_get_autostart_args;
|
||||
remote_domain_get_autostart_ret lv_remote_domain_get_autostart_ret;
|
||||
remote_domain_set_vcpus_args lv_remote_domain_set_vcpus_args;
|
||||
remote_get_hostname_ret lv_remote_get_hostname_ret;
|
||||
remote_domain_events_register_ret lv_remote_domain_events_register_ret;
|
||||
remote_network_undefine_args lv_remote_network_undefine_args;
|
||||
remote_domain_create_args lv_remote_domain_create_args;
|
||||
remote_network_destroy_args lv_remote_network_destroy_args;
|
||||
@ -121,6 +123,7 @@ remote_num_of_defined_storage_pools_ret lv_remote_num_of_defined_storage_pools_r
|
||||
remote_domain_core_dump_args lv_remote_domain_core_dump_args;
|
||||
remote_list_defined_storage_pools_args lv_remote_list_defined_storage_pools_args;
|
||||
remote_list_defined_storage_pools_ret lv_remote_list_defined_storage_pools_ret;
|
||||
remote_domain_event_ret lv_remote_domain_event_ret;
|
||||
remote_domain_get_max_memory_args lv_remote_domain_get_max_memory_args;
|
||||
remote_domain_get_max_memory_ret lv_remote_domain_get_max_memory_ret;
|
||||
remote_num_of_domains_ret lv_remote_num_of_domains_ret;
|
||||
|
@ -116,6 +116,24 @@ case REMOTE_PROC_DOMAIN_DUMP_XML:
|
||||
ret = (char *) &lv_remote_domain_dump_xml_ret;
|
||||
memset (&lv_remote_domain_dump_xml_ret, 0, sizeof lv_remote_domain_dump_xml_ret);
|
||||
break;
|
||||
case REMOTE_PROC_DOMAIN_EVENT:
|
||||
fn = (dispatch_fn) remoteDispatchDomainEvent;
|
||||
ret_filter = (xdrproc_t) xdr_remote_domain_event_ret;
|
||||
ret = (char *) &lv_remote_domain_event_ret;
|
||||
memset (&lv_remote_domain_event_ret, 0, sizeof lv_remote_domain_event_ret);
|
||||
break;
|
||||
case REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER:
|
||||
fn = (dispatch_fn) remoteDispatchDomainEventsDeregister;
|
||||
ret_filter = (xdrproc_t) xdr_remote_domain_events_deregister_ret;
|
||||
ret = (char *) &lv_remote_domain_events_deregister_ret;
|
||||
memset (&lv_remote_domain_events_deregister_ret, 0, sizeof lv_remote_domain_events_deregister_ret);
|
||||
break;
|
||||
case REMOTE_PROC_DOMAIN_EVENTS_REGISTER:
|
||||
fn = (dispatch_fn) remoteDispatchDomainEventsRegister;
|
||||
ret_filter = (xdrproc_t) xdr_remote_domain_events_register_ret;
|
||||
ret = (char *) &lv_remote_domain_events_register_ret;
|
||||
memset (&lv_remote_domain_events_register_ret, 0, sizeof lv_remote_domain_events_register_ret);
|
||||
break;
|
||||
case REMOTE_PROC_DOMAIN_GET_AUTOSTART:
|
||||
fn = (dispatch_fn) remoteDispatchDomainGetAutostart;
|
||||
args_filter = (xdrproc_t) xdr_remote_domain_get_autostart_args;
|
||||
|
@ -18,6 +18,9 @@ static int remoteDispatchDomainDefineXml (struct qemud_server *server, struct qe
|
||||
static int remoteDispatchDomainDestroy (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_destroy_args *args, void *ret);
|
||||
static int remoteDispatchDomainDetachDevice (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_detach_device_args *args, void *ret);
|
||||
static int remoteDispatchDomainDumpXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_dump_xml_args *args, remote_domain_dump_xml_ret *ret);
|
||||
static int remoteDispatchDomainEvent (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_domain_event_ret *ret);
|
||||
static int remoteDispatchDomainEventsDeregister (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_domain_events_deregister_ret *ret);
|
||||
static int remoteDispatchDomainEventsRegister (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_domain_events_register_ret *ret);
|
||||
static int remoteDispatchDomainGetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_autostart_args *args, remote_domain_get_autostart_ret *ret);
|
||||
static int remoteDispatchDomainGetInfo (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_info_args *args, remote_domain_get_info_ret *ret);
|
||||
static int remoteDispatchDomainGetMaxMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_max_memory_args *args, remote_domain_get_max_memory_ret *ret);
|
||||
|
@ -1942,6 +1942,35 @@ xdr_remote_storage_vol_get_path_ret (XDR *xdrs, remote_storage_vol_get_path_ret
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain_events_register_ret (XDR *xdrs, remote_domain_events_register_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->cb_registered))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain_events_deregister_ret (XDR *xdrs, remote_domain_events_deregister_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->cb_registered))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain_event_ret (XDR *xdrs, remote_domain_event_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
|
||||
return FALSE;
|
||||
if (!xdr_int (xdrs, &objp->event))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_procedure (XDR *xdrs, remote_procedure *objp)
|
||||
{
|
||||
|
@ -1081,6 +1081,22 @@ struct remote_storage_vol_get_path_ret {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
typedef struct remote_storage_vol_get_path_ret remote_storage_vol_get_path_ret;
|
||||
|
||||
struct remote_domain_events_register_ret {
|
||||
int cb_registered;
|
||||
};
|
||||
typedef struct remote_domain_events_register_ret remote_domain_events_register_ret;
|
||||
|
||||
struct remote_domain_events_deregister_ret {
|
||||
int cb_registered;
|
||||
};
|
||||
typedef struct remote_domain_events_deregister_ret remote_domain_events_deregister_ret;
|
||||
|
||||
struct remote_domain_event_ret {
|
||||
remote_nonnull_domain dom;
|
||||
int event;
|
||||
};
|
||||
typedef struct remote_domain_event_ret remote_domain_event_ret;
|
||||
#define REMOTE_PROGRAM 0x20008086
|
||||
#define REMOTE_PROTOCOL_VERSION 1
|
||||
|
||||
@ -1189,6 +1205,9 @@ enum remote_procedure {
|
||||
REMOTE_PROC_NODE_GET_FREE_MEMORY = 102,
|
||||
REMOTE_PROC_DOMAIN_BLOCK_PEEK = 103,
|
||||
REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
|
||||
REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
|
||||
REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
|
||||
REMOTE_PROC_DOMAIN_EVENT = 107,
|
||||
};
|
||||
typedef enum remote_procedure remote_procedure;
|
||||
|
||||
@ -1394,6 +1413,9 @@ extern bool_t xdr_remote_storage_vol_get_info_args (XDR *, remote_storage_vol_g
|
||||
extern bool_t xdr_remote_storage_vol_get_info_ret (XDR *, remote_storage_vol_get_info_ret*);
|
||||
extern bool_t xdr_remote_storage_vol_get_path_args (XDR *, remote_storage_vol_get_path_args*);
|
||||
extern bool_t xdr_remote_storage_vol_get_path_ret (XDR *, remote_storage_vol_get_path_ret*);
|
||||
extern bool_t xdr_remote_domain_events_register_ret (XDR *, remote_domain_events_register_ret*);
|
||||
extern bool_t xdr_remote_domain_events_deregister_ret (XDR *, remote_domain_events_deregister_ret*);
|
||||
extern bool_t xdr_remote_domain_event_ret (XDR *, remote_domain_event_ret*);
|
||||
extern bool_t xdr_remote_procedure (XDR *, remote_procedure*);
|
||||
extern bool_t xdr_remote_message_direction (XDR *, remote_message_direction*);
|
||||
extern bool_t xdr_remote_message_status (XDR *, remote_message_status*);
|
||||
@ -1575,6 +1597,9 @@ extern bool_t xdr_remote_storage_vol_get_info_args ();
|
||||
extern bool_t xdr_remote_storage_vol_get_info_ret ();
|
||||
extern bool_t xdr_remote_storage_vol_get_path_args ();
|
||||
extern bool_t xdr_remote_storage_vol_get_path_ret ();
|
||||
extern bool_t xdr_remote_domain_events_register_ret ();
|
||||
extern bool_t xdr_remote_domain_events_deregister_ret ();
|
||||
extern bool_t xdr_remote_domain_event_ret ();
|
||||
extern bool_t xdr_remote_procedure ();
|
||||
extern bool_t xdr_remote_message_direction ();
|
||||
extern bool_t xdr_remote_message_status ();
|
||||
|
@ -965,6 +965,25 @@ struct remote_storage_vol_get_path_ret {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Events Register/Deregister:
|
||||
* It would seem rpcgen does not like both args, and ret
|
||||
* to be null. It will not generate the prototype otherwise.
|
||||
* Pass back a redundant boolean to force prototype generation.
|
||||
*/
|
||||
struct remote_domain_events_register_ret {
|
||||
int cb_registered;
|
||||
};
|
||||
|
||||
struct remote_domain_events_deregister_ret {
|
||||
int cb_registered;
|
||||
};
|
||||
|
||||
struct remote_domain_event_ret {
|
||||
remote_nonnull_domain dom;
|
||||
int event;
|
||||
};
|
||||
|
||||
/*----- Protocol. -----*/
|
||||
|
||||
/* Define the program number, protocol version and procedure numbers here. */
|
||||
@ -1086,7 +1105,11 @@ enum remote_procedure {
|
||||
REMOTE_PROC_NODE_GET_FREE_MEMORY = 102,
|
||||
|
||||
REMOTE_PROC_DOMAIN_BLOCK_PEEK = 103,
|
||||
REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104
|
||||
REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
|
||||
|
||||
REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
|
||||
REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
|
||||
REMOTE_PROC_DOMAIN_EVENT = 107
|
||||
};
|
||||
|
||||
/* Custom RPC structure. */
|
||||
|
13
src/driver.h
13
src/driver.h
@ -280,6 +280,17 @@ typedef unsigned long long
|
||||
(*virDrvNodeGetFreeMemory)
|
||||
(virConnectPtr conn);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainEventRegister)
|
||||
(virConnectPtr conn,
|
||||
void *callback,
|
||||
void *opaque);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainEventDeregister)
|
||||
(virConnectPtr conn,
|
||||
void *callback);
|
||||
|
||||
/**
|
||||
* _virDriver:
|
||||
*
|
||||
@ -352,6 +363,8 @@ struct _virDriver {
|
||||
virDrvDomainMemoryPeek domainMemoryPeek;
|
||||
virDrvNodeGetCellsFreeMemory nodeGetCellsFreeMemory;
|
||||
virDrvNodeGetFreeMemory getFreeMemory;
|
||||
virDrvDomainEventRegister domainEventRegister;
|
||||
virDrvDomainEventDeregister domainEventDeregister;
|
||||
};
|
||||
|
||||
typedef int
|
||||
|
25
src/event.c
25
src/event.c
@ -34,7 +34,8 @@ static virEventAddTimeoutFunc addTimeoutImpl = NULL;
|
||||
static virEventUpdateTimeoutFunc updateTimeoutImpl = NULL;
|
||||
static virEventRemoveTimeoutFunc removeTimeoutImpl = NULL;
|
||||
|
||||
int virEventAddHandle(int fd, int events, virEventHandleCallback cb, void *opaque) {
|
||||
int virEventAddHandle(int fd, int events, virEventHandleCallback cb,
|
||||
void *opaque) {
|
||||
if (!addHandleImpl)
|
||||
return -1;
|
||||
|
||||
@ -70,12 +71,22 @@ int virEventRemoveTimeout(int timer) {
|
||||
return removeTimeoutImpl(timer);
|
||||
}
|
||||
|
||||
void __virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
||||
virEventUpdateHandleFunc updateHandle,
|
||||
virEventRemoveHandleFunc removeHandle,
|
||||
virEventAddTimeoutFunc addTimeout,
|
||||
virEventUpdateTimeoutFunc updateTimeout,
|
||||
virEventRemoveTimeoutFunc removeTimeout) {
|
||||
/**
|
||||
* virEventRegisterImpl:
|
||||
* Register an EventImpl
|
||||
* @addHandle: the callback to add fd handles
|
||||
* @updateHandle: the callback to update fd handles
|
||||
* @removeHandle: the callback to remove fd handles
|
||||
* @addTimeout: the callback to add a timeout
|
||||
* @updateTimeout: the callback to update a timeout
|
||||
* @removeTimeout: the callback to remove a timeout
|
||||
*/
|
||||
void virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
||||
virEventUpdateHandleFunc updateHandle,
|
||||
virEventRemoveHandleFunc removeHandle,
|
||||
virEventAddTimeoutFunc addTimeout,
|
||||
virEventUpdateTimeoutFunc updateTimeout,
|
||||
virEventRemoveTimeoutFunc removeTimeout) {
|
||||
addHandleImpl = addHandle;
|
||||
updateHandleImpl = updateHandle;
|
||||
removeHandleImpl = removeHandle;
|
||||
|
44
src/event.h
44
src/event.h
@ -23,34 +23,25 @@
|
||||
|
||||
#ifndef __VIR_EVENT_H__
|
||||
#define __VIR_EVENT_H__
|
||||
|
||||
|
||||
/**
|
||||
* virEventHandleCallback: callback for receiving file handle events
|
||||
*
|
||||
* @fd: file handle on which the event occurred
|
||||
* @events: bitset of events from POLLnnn constants
|
||||
* @opaque: user data registered with handle
|
||||
*/
|
||||
typedef void (*virEventHandleCallback)(int fd, int events, void *opaque);
|
||||
|
||||
#include "internal.h"
|
||||
/**
|
||||
* virEventAddHandle: register a callback for monitoring file handle events
|
||||
*
|
||||
* @fd: file handle to monitor for events
|
||||
* @events: bitset of events to watch from POLLnnn constants
|
||||
* @events: bitset of events to watch from virEventHandleType constants
|
||||
* @cb: callback to invoke when an event occurs
|
||||
* @opaque: user data to pass to callback
|
||||
*
|
||||
* returns -1 if the file handle cannot be registered, 0 upon success
|
||||
*/
|
||||
int virEventAddHandle(int fd, int events, virEventHandleCallback cb, void *opaque);
|
||||
int virEventAddHandle(int fd, int events, virEventHandleCallback cb,
|
||||
void *opaque);
|
||||
|
||||
/**
|
||||
* virEventUpdateHandle: change event set for a monitored file handle
|
||||
*
|
||||
* @fd: file handle to monitor for events
|
||||
* @events: bitset of events to watch from POLLnnn constants
|
||||
* @events: bitset of events to watch from virEventHandleType constants
|
||||
*
|
||||
* Will not fail if fd exists
|
||||
*/
|
||||
@ -65,14 +56,6 @@ void virEventUpdateHandle(int fd, int events);
|
||||
*/
|
||||
int virEventRemoveHandle(int fd);
|
||||
|
||||
/**
|
||||
* virEventTimeoutCallback: callback for receiving timer events
|
||||
*
|
||||
* @timer: timer id emitting the event
|
||||
* @opaque: user data registered with handle
|
||||
*/
|
||||
typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
|
||||
|
||||
/**
|
||||
* virEventAddTimeout: register a callback for a timer event
|
||||
*
|
||||
@ -110,21 +93,4 @@ void virEventUpdateTimeout(int timer, int frequency);
|
||||
*/
|
||||
int virEventRemoveTimeout(int timer);
|
||||
|
||||
typedef int (*virEventAddHandleFunc)(int, int, virEventHandleCallback, void *);
|
||||
typedef void (*virEventUpdateHandleFunc)(int, int);
|
||||
typedef int (*virEventRemoveHandleFunc)(int);
|
||||
|
||||
typedef int (*virEventAddTimeoutFunc)(int, virEventTimeoutCallback, void *);
|
||||
typedef void (*virEventUpdateTimeoutFunc)(int, int);
|
||||
typedef int (*virEventRemoveTimeoutFunc)(int);
|
||||
|
||||
void __virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
||||
virEventUpdateHandleFunc updateHandle,
|
||||
virEventRemoveHandleFunc removeHandle,
|
||||
virEventAddTimeoutFunc addTimeout,
|
||||
virEventUpdateTimeoutFunc updateTimeout,
|
||||
virEventRemoveTimeoutFunc removeTimeout);
|
||||
|
||||
#define virEventRegisterImpl(ah,rh,at,rt) __virEventRegisterImpl(ah,rh,at,rt)
|
||||
|
||||
#endif /* __VIR_EVENT_H__ */
|
||||
|
@ -379,8 +379,80 @@ struct _virStringList {
|
||||
struct _virStringList *next;
|
||||
};
|
||||
|
||||
char *virStringListJoin(const virStringList *list, const char *pre,
|
||||
char *__virStringListJoin(const virStringList *list, const char *pre,
|
||||
const char *post, const char *sep);
|
||||
void virStringListFree(virStringList *list);
|
||||
void __virStringListFree(virStringList *list);
|
||||
|
||||
/**
|
||||
* Domain Event Notification
|
||||
*/
|
||||
|
||||
struct _virDomainEventCallback {
|
||||
virConnectPtr conn;
|
||||
virConnectDomainEventCallback cb;
|
||||
void *opaque;
|
||||
};
|
||||
typedef struct _virDomainEventCallback virDomainEventCallback;
|
||||
typedef virDomainEventCallback *virDomainEventCallbackPtr;
|
||||
|
||||
struct _virDomainEventCallbackList {
|
||||
unsigned int count;
|
||||
virDomainEventCallbackPtr *callbacks;
|
||||
};
|
||||
typedef struct _virDomainEventCallbackList virDomainEventCallbackList;
|
||||
typedef virDomainEventCallbackList *virDomainEventCallbackListPtr;
|
||||
|
||||
void __virDomainEventCallbackListFree(virDomainEventCallbackListPtr list);
|
||||
#define virDomainEventCallbackListFree(x) __virDomainEventCallbackListFree(x)
|
||||
|
||||
int __virDomainEventCallbackListAdd(virConnectPtr conn,
|
||||
virDomainEventCallbackListPtr cbList,
|
||||
virConnectDomainEventCallback callback,
|
||||
void *opaque);
|
||||
#define virDomainEventCallbackListAdd(a,b,c,d) \
|
||||
__virDomainEventCallbackListAdd((a),(b),(c),(d))
|
||||
|
||||
int __virDomainEventCallbackListRemove(virConnectPtr conn,
|
||||
virDomainEventCallbackListPtr cbList,
|
||||
virConnectDomainEventCallback callback);
|
||||
#define virDomainEventCallbackListRemove(a,b,c) \
|
||||
__virDomainEventCallbackListRemove((a),(b),(c))
|
||||
|
||||
int __virEventHandleTypeToPollEvent(virEventHandleType events);
|
||||
#define virEventHandleTypeToPollEvent(x) __virEventHandleTypeToPollEvent(x)
|
||||
|
||||
virEventHandleType __virPollEventToEventHandleType(int events);
|
||||
#define virPollEventToEventHandleType(x) __virPollEventToEventHandleType(x)
|
||||
|
||||
/**
|
||||
* Dispatching domain events that come in while
|
||||
* in a call / response rpc
|
||||
*/
|
||||
struct _virDomainEvent {
|
||||
virDomainPtr dom;
|
||||
virDomainEventType event;
|
||||
};
|
||||
typedef struct _virDomainEvent virDomainEvent;
|
||||
typedef virDomainEvent *virDomainEventPtr;
|
||||
|
||||
struct _virDomainEventQueue {
|
||||
unsigned int count;
|
||||
virDomainEventPtr *events;
|
||||
};
|
||||
typedef struct _virDomainEventQueue virDomainEventQueue;
|
||||
typedef virDomainEventQueue *virDomainEventQueuePtr;
|
||||
|
||||
int __virDomainEventCallbackQueuePush(virDomainEventQueuePtr evtQueue,
|
||||
virDomainPtr dom,
|
||||
virDomainEventType event);
|
||||
#define virDomainEventCallbackQueuePush(a,b,c) \
|
||||
__virDomainEventCallbackQueuePush((a),(b),(c))
|
||||
|
||||
virDomainEventPtr
|
||||
__virDomainEventCallbackQueuePop(virDomainEventQueuePtr evtQueue);
|
||||
#define virDomainEventCallbackQueuePop(x) __virDomainEventCallbackQueuePop(x)
|
||||
|
||||
void __virDomainEventQueueFree(virDomainEventQueuePtr queue);
|
||||
#define virDomainEventQueueFree(x) __virDomainEventQueueFree(x)
|
||||
|
||||
#endif /* __VIR_INTERNAL_H__ */
|
||||
|
271
src/libvirt.c
271
src/libvirt.c
@ -16,6 +16,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/poll.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
@ -5310,7 +5311,7 @@ virStorageVolGetPath(virStorageVolPtr vol)
|
||||
/* Not for public use. Combines the elements of a virStringList
|
||||
* into a single string.
|
||||
*/
|
||||
char *virStringListJoin(const virStringList *list, const char *pre,
|
||||
char *__virStringListJoin(const virStringList *list, const char *pre,
|
||||
const char *post, const char *sep)
|
||||
{
|
||||
size_t pre_len = strlen(pre);
|
||||
@ -5337,7 +5338,7 @@ char *virStringListJoin(const virStringList *list, const char *pre,
|
||||
}
|
||||
|
||||
|
||||
void virStringListFree(virStringList *list)
|
||||
void __virStringListFree(virStringList *list)
|
||||
{
|
||||
while (list) {
|
||||
virStringList *p = list->next;
|
||||
@ -5345,3 +5346,269 @@ void virStringListFree(virStringList *list)
|
||||
list = p;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Domain Event Notification
|
||||
*/
|
||||
|
||||
/**
|
||||
* virConnectDomainEventRegister:
|
||||
* @conn: pointer to the connection
|
||||
* @cb: callback to the function handling domain events
|
||||
* @opaque: opaque data to pass on to the callback
|
||||
*
|
||||
* Adds a Domain Event Callback.
|
||||
* Registering for a domain callback will enable delivery of the events
|
||||
*
|
||||
* Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int
|
||||
virConnectDomainEventRegister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb,
|
||||
void *opaque)
|
||||
{
|
||||
|
||||
if (!VIR_IS_CONNECT(conn)) {
|
||||
virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
|
||||
return (-1);
|
||||
}
|
||||
if (cb == NULL) {
|
||||
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((conn->driver) && (conn->driver->domainEventRegister))
|
||||
return conn->driver->domainEventRegister (conn, cb, opaque);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* virConnectDomainEventDeregister:
|
||||
* @conn: pointer to the connection
|
||||
* @cb: callback to the function handling domain events
|
||||
*
|
||||
* Removes a Domain Event Callback.
|
||||
* De-registering for a domain callback will disable
|
||||
* delivery of this event type
|
||||
*
|
||||
* Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int
|
||||
virConnectDomainEventDeregister(virConnectPtr conn,
|
||||
virConnectDomainEventCallback cb)
|
||||
{
|
||||
|
||||
if (!VIR_IS_CONNECT(conn)) {
|
||||
virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
|
||||
return (-1);
|
||||
}
|
||||
if (cb == NULL) {
|
||||
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
return (-1);
|
||||
}
|
||||
if ((conn->driver) && (conn->driver->domainEventDeregister))
|
||||
return conn->driver->domainEventDeregister (conn, cb);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* __virDomainEventCallbackListFree:
|
||||
* @list: event callback list head
|
||||
*
|
||||
* Free the memory in the domain event callback list
|
||||
*/
|
||||
void
|
||||
__virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<list->count; i++) {
|
||||
VIR_FREE(list->callbacks[i]);
|
||||
}
|
||||
VIR_FREE(list);
|
||||
}
|
||||
/**
|
||||
* __virDomainEventCallbackListRemove:
|
||||
* @conn: pointer to the connection
|
||||
* @cbList: the list
|
||||
* @callback: the callback to remove
|
||||
*
|
||||
* Internal function to remove a callback from a virDomainEventCallbackListPtr
|
||||
*/
|
||||
int
|
||||
__virDomainEventCallbackListRemove(virConnectPtr conn,
|
||||
virDomainEventCallbackListPtr cbList,
|
||||
virConnectDomainEventCallback callback)
|
||||
{
|
||||
int i;
|
||||
for (i = 0 ; i < cbList->count ; i++) {
|
||||
if(cbList->callbacks[i]->cb == callback &&
|
||||
cbList->callbacks[i]->conn == conn) {
|
||||
virUnrefConnect(cbList->callbacks[i]->conn);
|
||||
VIR_FREE(cbList->callbacks[i]);
|
||||
|
||||
if (i < (cbList->count - 1))
|
||||
memmove(cbList->callbacks + i,
|
||||
cbList->callbacks + i + 1,
|
||||
sizeof(*(cbList->callbacks)) *
|
||||
(cbList->count - (i + 1)));
|
||||
|
||||
if (VIR_REALLOC_N(cbList->callbacks,
|
||||
cbList->count - 1) < 0) {
|
||||
; /* Failure to reduce memory allocation isn't fatal */
|
||||
}
|
||||
cbList->count--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* __virDomainEventCallbackListAdd:
|
||||
* @conn: pointer to the connection
|
||||
* @cbList: the list
|
||||
* @callback: the callback to add
|
||||
* @opaque: opaque data tio pass to callback
|
||||
*
|
||||
* Internal function to add a callback from a virDomainEventCallbackListPtr
|
||||
*/
|
||||
int
|
||||
__virDomainEventCallbackListAdd(virConnectPtr conn,
|
||||
virDomainEventCallbackListPtr cbList,
|
||||
virConnectDomainEventCallback callback,
|
||||
void *opaque)
|
||||
{
|
||||
virDomainEventCallbackPtr event;
|
||||
int n;
|
||||
|
||||
/* Check incoming */
|
||||
if ( !cbList ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check if we already have this callback on our list */
|
||||
for (n=0; n < cbList->count; n++) {
|
||||
if(cbList->callbacks[n]->cb == callback &&
|
||||
conn == cbList->callbacks[n]->conn) {
|
||||
DEBUG0("WARNING: Callback already tracked");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/* Allocate new event */
|
||||
if (VIR_ALLOC(event) < 0) {
|
||||
DEBUG0("Error allocating event");
|
||||
return -1;
|
||||
}
|
||||
event->conn = conn;
|
||||
event->cb = callback;
|
||||
event->opaque = opaque;
|
||||
|
||||
/* Make space on list */
|
||||
n = cbList->count;
|
||||
if (VIR_REALLOC_N(cbList->callbacks, n + 1) < 0) {
|
||||
DEBUG0("Error reallocating list");
|
||||
VIR_FREE(event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
event->conn->refs++;
|
||||
|
||||
cbList->callbacks[n] = event;
|
||||
cbList->count++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* __virDomainEventQueueFree:
|
||||
* @queue: pointer to the queue
|
||||
*
|
||||
* Free the memory in the queue. We process this like a list here
|
||||
*/
|
||||
void
|
||||
__virDomainEventQueueFree(virDomainEventQueuePtr queue)
|
||||
{
|
||||
int i;
|
||||
for ( i=0 ; i<queue->count ; i++ ) {
|
||||
VIR_FREE(queue->events[i]);
|
||||
}
|
||||
VIR_FREE(queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* __virDomainEventCallbackQueuePop:
|
||||
* @evtQueue: the queue of events
|
||||
*
|
||||
* Internal function to pop off, and return the front of the queue
|
||||
* NOTE: The caller is responsible for freeing the returned object
|
||||
*
|
||||
* Returns: virDomainEventPtr on success NULL on failure.
|
||||
*/
|
||||
virDomainEventPtr
|
||||
__virDomainEventCallbackQueuePop(virDomainEventQueuePtr evtQueue)
|
||||
{
|
||||
virDomainEventPtr ret;
|
||||
|
||||
if(!evtQueue || evtQueue->count == 0 )
|
||||
return NULL;
|
||||
|
||||
ret = evtQueue->events[0];
|
||||
|
||||
memmove(evtQueue->events,
|
||||
evtQueue->events + 1,
|
||||
sizeof(*(evtQueue->events)) *
|
||||
(evtQueue->count - 1));
|
||||
|
||||
if (VIR_REALLOC_N(evtQueue->events,
|
||||
evtQueue->count - 1) < 0) {
|
||||
; /* Failure to reduce memory allocation isn't fatal */
|
||||
}
|
||||
evtQueue->count--;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* __virDomainEventCallbackQueuePush:
|
||||
* @evtQueue: the dom event queue
|
||||
* @dom: the domain to add
|
||||
* @event: the event to add
|
||||
*
|
||||
* Internal function to push onto the back of an virDomainEventQueue
|
||||
*
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*/
|
||||
int
|
||||
__virDomainEventCallbackQueuePush(virDomainEventQueuePtr evtQueue,
|
||||
virDomainPtr dom,
|
||||
virDomainEventType event)
|
||||
{
|
||||
virDomainEventPtr domEvent;
|
||||
|
||||
/* Check incoming */
|
||||
if ( !evtQueue ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Allocate new event */
|
||||
if (VIR_ALLOC(domEvent) < 0) {
|
||||
DEBUG0("Error allocating event");
|
||||
return -1;
|
||||
}
|
||||
domEvent->dom = dom;
|
||||
domEvent->event = event;
|
||||
|
||||
/* Make space on queue */
|
||||
if (VIR_REALLOC_N(evtQueue->events,
|
||||
evtQueue->count + 1) < 0) {
|
||||
DEBUG0("Error reallocating queue");
|
||||
VIR_FREE(domEvent);
|
||||
return -1;
|
||||
}
|
||||
|
||||
evtQueue->events[evtQueue->count] = domEvent;
|
||||
evtQueue->count++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -147,6 +147,10 @@
|
||||
virStorageVolGetXMLDesc;
|
||||
virStorageVolGetPath;
|
||||
|
||||
virEventRegisterImpl;
|
||||
virConnectDomainEventRegister;
|
||||
virConnectDomainEventDeregister;
|
||||
|
||||
/* Symbols with __ are private only
|
||||
for use by the libvirtd daemon.
|
||||
They are not part of stable ABI
|
||||
@ -167,8 +171,6 @@
|
||||
__virGetStoragePool;
|
||||
__virGetStorageVol;
|
||||
|
||||
__virEventRegisterImpl;
|
||||
|
||||
__virStateInitialize;
|
||||
__virStateCleanup;
|
||||
__virStateReload;
|
||||
@ -197,6 +199,5 @@
|
||||
__virAllocN;
|
||||
__virReallocN;
|
||||
__virFree;
|
||||
|
||||
local: *;
|
||||
};
|
||||
|
@ -811,7 +811,7 @@ static int lxcVmStart(virConnectPtr conn,
|
||||
vm->state = VIR_DOMAIN_RUNNING;
|
||||
|
||||
if (virEventAddHandle(vm->monitor,
|
||||
POLLERR | POLLHUP,
|
||||
VIR_EVENT_HANDLE_ERROR | VIR_EVENT_HANDLE_HANGUP,
|
||||
lxcMonitorEvent,
|
||||
driver) < 0) {
|
||||
lxcVmTerminate(conn, driver, vm, 0);
|
||||
@ -1278,6 +1278,8 @@ static virDriver lxcDriver = {
|
||||
NULL, /* domainMemoryPeek */
|
||||
NULL, /* nodeGetCellsFreeMemory */
|
||||
NULL, /* getFreeMemory */
|
||||
NULL, /* domainEventRegister */
|
||||
NULL, /* domainEventDeregister */
|
||||
};
|
||||
|
||||
static virStateDriver lxcStateDriver = {
|
||||
|
@ -1012,6 +1012,8 @@ static virDriver openvzDriver = {
|
||||
NULL, /* domainMemoryPeek */
|
||||
NULL, /* nodeGetCellsFreeMemory */
|
||||
NULL, /* nodeGetFreeMemory */
|
||||
NULL, /* domainEventRegister */
|
||||
NULL, /* domainEventDeregister */
|
||||
};
|
||||
|
||||
int openvzRegister(void) {
|
||||
|
@ -63,6 +63,9 @@ struct qemud_driver {
|
||||
char *vncListen;
|
||||
|
||||
virCapsPtr caps;
|
||||
|
||||
/* An array of callbacks */
|
||||
virDomainEventCallbackListPtr domainEventCallbacks;
|
||||
};
|
||||
|
||||
|
||||
|
@ -106,7 +106,14 @@ static int qemudSetNonBlock(int fd) {
|
||||
}
|
||||
|
||||
|
||||
static void qemudDispatchVMEvent(int fd, int events, void *opaque);
|
||||
static void qemudDomainEventDispatch (struct qemud_driver *driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainEventType evt);
|
||||
|
||||
static void qemudDispatchVMEvent(int fd,
|
||||
int events,
|
||||
void *opaque);
|
||||
|
||||
static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
struct qemud_driver *driver,
|
||||
virDomainObjPtr vm,
|
||||
@ -116,8 +123,8 @@ static void qemudShutdownVMDaemon(virConnectPtr conn,
|
||||
struct qemud_driver *driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
|
||||
static int qemudDomainGetMaxVcpus(virDomainPtr dom);
|
||||
|
||||
static int qemudMonitorCommand (const struct qemud_driver *driver,
|
||||
const virDomainObjPtr vm,
|
||||
const char *cmd,
|
||||
@ -160,6 +167,10 @@ qemudStartup(void) {
|
||||
/* Don't have a dom0 so start from 1 */
|
||||
qemu_driver->nextvmid = 1;
|
||||
|
||||
/* Init callback list */
|
||||
if(VIR_ALLOC(qemu_driver->domainEventCallbacks) < 0)
|
||||
return -1;
|
||||
|
||||
if (!uid) {
|
||||
if (asprintf(&qemu_driver->logDir,
|
||||
"%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
@ -302,6 +313,9 @@ qemudShutdown(void) {
|
||||
VIR_FREE(qemu_driver->autostartDir);
|
||||
VIR_FREE(qemu_driver->vncTLSx509certdir);
|
||||
|
||||
/* Free domain callback list */
|
||||
virDomainEventCallbackListFree(qemu_driver->domainEventCallbacks);
|
||||
|
||||
if (qemu_driver->brctl)
|
||||
brShutdown(qemu_driver->brctl);
|
||||
|
||||
@ -743,6 +757,9 @@ static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
static virDomainPtr qemudDomainLookupByName(virConnectPtr conn,
|
||||
const char *name);
|
||||
|
||||
static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
struct qemud_driver *driver,
|
||||
virDomainObjPtr vm,
|
||||
@ -906,11 +923,15 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
|
||||
if (ret == 0) {
|
||||
if ((virEventAddHandle(vm->stdout_fd,
|
||||
POLLIN | POLLERR | POLLHUP,
|
||||
VIR_EVENT_HANDLE_READABLE |
|
||||
VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
qemudDispatchVMEvent,
|
||||
driver) < 0) ||
|
||||
(virEventAddHandle(vm->stderr_fd,
|
||||
POLLIN | POLLERR | POLLHUP,
|
||||
VIR_EVENT_HANDLE_READABLE |
|
||||
VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
qemudDispatchVMEvent,
|
||||
driver) < 0) ||
|
||||
(qemudWaitForMonitor(conn, driver, vm) < 0) ||
|
||||
@ -919,6 +940,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
qemudShutdownVMDaemon(conn, driver, vm);
|
||||
return -1;
|
||||
}
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_STARTED);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -1013,6 +1035,7 @@ static int qemudDispatchVMLog(struct qemud_driver *driver, virDomainObjPtr vm, i
|
||||
static int qemudDispatchVMFailure(struct qemud_driver *driver, virDomainObjPtr vm,
|
||||
int fd ATTRIBUTE_UNUSED) {
|
||||
qemudShutdownVMDaemon(NULL, driver, vm);
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_STOPPED);
|
||||
if (!vm->persistent)
|
||||
virDomainRemoveInactive(&driver->domains,
|
||||
vm);
|
||||
@ -1020,7 +1043,8 @@ static int qemudDispatchVMFailure(struct qemud_driver *driver, virDomainObjPtr v
|
||||
}
|
||||
|
||||
|
||||
static void qemudDispatchVMEvent(int fd, int events, void *opaque) {
|
||||
static void
|
||||
qemudDispatchVMEvent(int fd, int events, void *opaque) {
|
||||
struct qemud_driver *driver = (struct qemud_driver *)opaque;
|
||||
virDomainObjPtr vm = NULL;
|
||||
unsigned int i;
|
||||
@ -1037,7 +1061,7 @@ static void qemudDispatchVMEvent(int fd, int events, void *opaque) {
|
||||
if (!vm)
|
||||
return;
|
||||
|
||||
if (events == POLLIN)
|
||||
if (events == VIR_EVENT_HANDLE_READABLE)
|
||||
qemudDispatchVMLog(driver, vm, fd);
|
||||
else
|
||||
qemudDispatchVMFailure(driver, vm, fd);
|
||||
@ -1504,6 +1528,7 @@ static int qemudDomainSuspend(virDomainPtr dom) {
|
||||
}
|
||||
vm->state = VIR_DOMAIN_PAUSED;
|
||||
qemudDebug("Reply %s", info);
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_SUSPENDED);
|
||||
VIR_FREE(info);
|
||||
return 0;
|
||||
}
|
||||
@ -1532,6 +1557,7 @@ static int qemudDomainResume(virDomainPtr dom) {
|
||||
}
|
||||
vm->state = VIR_DOMAIN_RUNNING;
|
||||
qemudDebug("Reply %s", info);
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_RESUMED);
|
||||
VIR_FREE(info);
|
||||
return 0;
|
||||
}
|
||||
@ -1570,10 +1596,10 @@ static int qemudDomainDestroy(virDomainPtr dom) {
|
||||
}
|
||||
|
||||
qemudShutdownVMDaemon(dom->conn, driver, vm);
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_STOPPED);
|
||||
if (!vm->persistent)
|
||||
virDomainRemoveInactive(&driver->domains,
|
||||
vm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1904,7 +1930,7 @@ static int qemudDomainSave(virDomainPtr dom,
|
||||
if (!vm->persistent)
|
||||
virDomainRemoveInactive(&driver->domains,
|
||||
vm);
|
||||
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_SAVED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2211,6 +2237,7 @@ static int qemudDomainRestore(virConnectPtr conn,
|
||||
vm->state = VIR_DOMAIN_RUNNING;
|
||||
}
|
||||
|
||||
qemudDomainEventDispatch(driver, vm, VIR_DOMAIN_EVENT_RESTORED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3149,6 +3176,56 @@ done:
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemudDomainEventRegister (virConnectPtr conn,
|
||||
void *callback,
|
||||
void *opaque)
|
||||
{
|
||||
struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
|
||||
|
||||
return virDomainEventCallbackListAdd(conn, driver->domainEventCallbacks,
|
||||
callback, opaque);
|
||||
}
|
||||
|
||||
static int
|
||||
qemudDomainEventDeregister (virConnectPtr conn,
|
||||
void *callback)
|
||||
{
|
||||
struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
|
||||
|
||||
return virDomainEventCallbackListRemove(conn, driver->domainEventCallbacks,
|
||||
callback);
|
||||
}
|
||||
|
||||
static void qemudDomainEventDispatch (struct qemud_driver *driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainEventType evt)
|
||||
{
|
||||
int i;
|
||||
virDomainEventCallbackListPtr cbList;
|
||||
|
||||
cbList = driver->domainEventCallbacks;
|
||||
|
||||
for(i=0 ; i < cbList->count ; i++) {
|
||||
if(cbList->callbacks[i] && cbList->callbacks[i]->cb) {
|
||||
virConnectPtr conn = cbList->callbacks[i]->conn;
|
||||
virDomainPtr dom = virGetDomain(conn, vm->def->name,
|
||||
vm->def->uuid);
|
||||
if (dom) {
|
||||
dom->id = virDomainIsActive(vm) ? vm->def->id : -1;
|
||||
DEBUG("Dispatching callback %p %p event %d",
|
||||
cbList->callbacks[i],
|
||||
cbList->callbacks[i]->cb, evt);
|
||||
cbList->callbacks[i]->cb(cbList->callbacks[i]->conn,
|
||||
dom, evt,
|
||||
cbList->callbacks[i]->opaque);
|
||||
virDomainFree(dom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static virDriver qemuDriver = {
|
||||
VIR_DRV_QEMU,
|
||||
"QEMU",
|
||||
@ -3219,6 +3296,8 @@ static virDriver qemuDriver = {
|
||||
NULL, /* nodeGetCellsFreeMemory */
|
||||
NULL, /* getFreeMemory */
|
||||
#endif
|
||||
qemudDomainEventRegister, /* domainEventRegister */
|
||||
qemudDomainEventDeregister, /* domainEventDeregister */
|
||||
};
|
||||
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/poll.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
@ -73,6 +74,7 @@
|
||||
#include "remote_protocol.h"
|
||||
#include "memory.h"
|
||||
#include "util.h"
|
||||
#include "event.h"
|
||||
|
||||
/* Per-connection private data. */
|
||||
#define MAGIC 999 /* private_data->magic if OK */
|
||||
@ -97,6 +99,13 @@ struct private_data {
|
||||
unsigned int saslDecodedLength;
|
||||
unsigned int saslDecodedOffset;
|
||||
#endif
|
||||
/* The list of domain event callbacks */
|
||||
virDomainEventCallbackListPtr callbackList;
|
||||
/* The queue of domain events generated
|
||||
during a call / response rpc */
|
||||
virDomainEventQueuePtr domainEvents;
|
||||
/* Timer for flushing domainEvents queue */
|
||||
int eventFlushTimer;
|
||||
};
|
||||
|
||||
#define GET_PRIVATE(conn,retcode) \
|
||||
@ -156,7 +165,10 @@ static void make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr do
|
||||
static void make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr net_src);
|
||||
static void make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr vol_src);
|
||||
static void make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src);
|
||||
|
||||
void remoteDomainEventFired(int fd, int event, void *data);
|
||||
static void remoteDomainProcessEvent(virConnectPtr conn, XDR *xdr);
|
||||
static void remoteDomainQueueEvent(virConnectPtr conn, XDR *xdr);
|
||||
void remoteDomainEventQueueFlush(int timer, void *opaque);
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* Helper functions for remoteOpen. */
|
||||
@ -680,6 +692,36 @@ doRemoteOpen (virConnectPtr conn,
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
goto failed;
|
||||
|
||||
if(VIR_ALLOC(priv->callbackList)<0) {
|
||||
error(conn, VIR_ERR_INVALID_ARG, _("Error allocating callbacks list"));
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if(VIR_ALLOC(priv->domainEvents)<0) {
|
||||
error(conn, VIR_ERR_INVALID_ARG, _("Error allocating domainEvents"));
|
||||
goto failed;
|
||||
}
|
||||
|
||||
DEBUG0("Adding Handler for remote events");
|
||||
/* Set up a callback to listen on the socket data */
|
||||
if (virEventAddHandle(priv->sock,
|
||||
VIR_EVENT_HANDLE_READABLE |
|
||||
VIR_EVENT_HANDLE_ERROR |
|
||||
VIR_EVENT_HANDLE_HANGUP,
|
||||
remoteDomainEventFired,
|
||||
conn) < 0) {
|
||||
DEBUG0("virEventAddHandle failed: No addHandleImpl defined."
|
||||
" continuing without events.");
|
||||
} else {
|
||||
|
||||
DEBUG0("Adding Timeout for remote event queue flushing");
|
||||
if ( (priv->eventFlushTimer = virEventAddTimeout(-1,
|
||||
remoteDomainEventQueueFlush,
|
||||
conn)) < 0) {
|
||||
DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
|
||||
"continuing without events.");
|
||||
}
|
||||
}
|
||||
/* Successful. */
|
||||
retcode = VIR_DRV_OPEN_SUCCESS;
|
||||
|
||||
@ -1101,6 +1143,11 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
return -1;
|
||||
|
||||
/* Remove handle for remote events */
|
||||
virEventRemoveHandle(priv->sock);
|
||||
/* Remove timout */
|
||||
virEventRemoveTimeout(priv->eventFlushTimer);
|
||||
|
||||
/* Close socket. */
|
||||
if (priv->uses_tls && priv->session) {
|
||||
gnutls_bye (priv->session, GNUTLS_SHUT_RDWR);
|
||||
@ -1132,6 +1179,12 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
|
||||
/* Free private data. */
|
||||
priv->magic = DEAD;
|
||||
|
||||
/* Free callback list */
|
||||
virDomainEventCallbackListFree(priv->callbackList);
|
||||
|
||||
/* Free queued events */
|
||||
virDomainEventQueueFree(priv->domainEvents);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4288,6 +4341,52 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_POLKIT */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
static int remoteDomainEventRegister (virConnectPtr conn,
|
||||
void *callback ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
if (virDomainEventCallbackListAdd(conn, priv->callbackList,
|
||||
callback, opaque) < 0) {
|
||||
error (conn, VIR_ERR_RPC, _("adding cb to list"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( priv->callbackList->count == 1 ) {
|
||||
/* Tell the server when we are the first callback deregistering */
|
||||
if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_REGISTER,
|
||||
(xdrproc_t) xdr_void, (char *) NULL,
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int remoteDomainEventDeregister (virConnectPtr conn,
|
||||
void *callback ATTRIBUTE_UNUSED)
|
||||
{
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
if (virDomainEventCallbackListRemove(conn, priv->callbackList,
|
||||
callback) < 0) {
|
||||
error (conn, VIR_ERR_RPC, _("removing cb fron list"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( priv->callbackList->count == 0 ) {
|
||||
/* Tell the server when we are the last callback deregistering */
|
||||
if (call (conn, priv, 0, REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER,
|
||||
(xdrproc_t) xdr_void, (char *) NULL,
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@ -4367,6 +4466,7 @@ call (virConnectPtr conn, struct private_data *priv,
|
||||
really_write (conn, priv, flags & REMOTE_CALL_IN_OPEN, buffer, len-4) == -1)
|
||||
return -1;
|
||||
|
||||
retry_read:
|
||||
/* Read and deserialise length word. */
|
||||
if (really_read (conn, priv, flags & REMOTE_CALL_IN_OPEN, buffer2, sizeof buffer2) == -1)
|
||||
return -1;
|
||||
@ -4418,10 +4518,20 @@ call (virConnectPtr conn, struct private_data *priv,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If we extend the server to actually send asynchronous messages, then
|
||||
* we'll need to change this so that it can recognise an asynch
|
||||
* message being received at this point.
|
||||
*/
|
||||
if (hdr.proc == REMOTE_PROC_DOMAIN_EVENT &&
|
||||
hdr.direction == REMOTE_MESSAGE) {
|
||||
/* An async message has come in while we were waiting for the
|
||||
* response. Process it to pull it off the wire, and try again
|
||||
*/
|
||||
DEBUG0("Encountered an event while waiting for a response");
|
||||
|
||||
remoteDomainQueueEvent(conn, &xdr);
|
||||
virEventUpdateTimeout(priv->eventFlushTimer, 0);
|
||||
|
||||
DEBUG0("Retrying read");
|
||||
xdr_destroy (&xdr);
|
||||
goto retry_read;
|
||||
}
|
||||
if (hdr.proc != proc_nr) {
|
||||
__virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
|
||||
NULL, NULL, VIR_FROM_REMOTE,
|
||||
@ -4872,6 +4982,8 @@ static virDriver driver = {
|
||||
.domainMemoryPeek = remoteDomainMemoryPeek,
|
||||
.nodeGetCellsFreeMemory = remoteNodeGetCellsFreeMemory,
|
||||
.getFreeMemory = remoteNodeGetFreeMemory,
|
||||
.domainEventRegister = remoteDomainEventRegister,
|
||||
.domainEventDeregister = remoteDomainEventDeregister,
|
||||
};
|
||||
|
||||
static virNetworkDriver network_driver = {
|
||||
@ -4957,3 +5069,157 @@ remoteRegister (void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* remoteDomainReadEvent
|
||||
*
|
||||
* Read the event data off the wire
|
||||
*/
|
||||
static int
|
||||
remoteDomainReadEvent(virConnectPtr conn, XDR *xdr,
|
||||
virDomainPtr *dom, int *event)
|
||||
{
|
||||
remote_domain_event_ret ret;
|
||||
memset (&ret, 0, sizeof ret);
|
||||
|
||||
/* unmarshall parameters, and process it*/
|
||||
if (! xdr_remote_domain_event_ret(xdr, &ret) ) {
|
||||
error (conn, VIR_ERR_RPC,
|
||||
_("remoteDomainProcessEvent: unmarshalling ret"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
*dom = get_nonnull_domain(conn,ret.dom);
|
||||
*event = ret.event;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
remoteDomainProcessEvent(virConnectPtr conn, XDR *xdr)
|
||||
{
|
||||
virDomainPtr dom;
|
||||
int event,i;
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
if(!remoteDomainReadEvent(conn, xdr, &dom, &event)) {
|
||||
DEBUG0("Calling domain event callbacks (no queue)");
|
||||
for(i=0 ; i < priv->callbackList->count ; i++) {
|
||||
if( priv->callbackList->callbacks[i] )
|
||||
priv->callbackList->callbacks[i]->cb(conn, dom, event,
|
||||
priv->callbackList->callbacks[i]->opaque);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remoteDomainQueueEvent(virConnectPtr conn, XDR *xdr)
|
||||
{
|
||||
virDomainPtr dom;
|
||||
int event;
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
if(!remoteDomainReadEvent(conn, xdr, &dom, &event))
|
||||
{
|
||||
if( virDomainEventCallbackQueuePush(priv->domainEvents,
|
||||
dom, event) < 0 ) {
|
||||
DEBUG("%s", "Error adding event to queue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** remoteDomainEventFired:
|
||||
*
|
||||
* The callback for monitoring the remote socket
|
||||
* for event data
|
||||
*/
|
||||
void
|
||||
remoteDomainEventFired(int fd ATTRIBUTE_UNUSED,
|
||||
int event,
|
||||
void *opaque)
|
||||
{
|
||||
char buffer[REMOTE_MESSAGE_MAX];
|
||||
char buffer2[4];
|
||||
struct remote_message_header hdr;
|
||||
XDR xdr;
|
||||
int len;
|
||||
|
||||
virConnectPtr conn = opaque;
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
DEBUG("%s : Event fired %d %X", __FUNCTION__, event, event);
|
||||
|
||||
if (event & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) {
|
||||
DEBUG("%s : VIR_EVENT_HANDLE_HANGUP or "
|
||||
"VIR_EVENT_HANDLE_ERROR encountered", __FUNCTION__);
|
||||
virEventRemoveHandle(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Read and deserialise length word. */
|
||||
if (really_read (conn, priv, 0, buffer2, sizeof buffer2) == -1)
|
||||
return;
|
||||
|
||||
xdrmem_create (&xdr, buffer2, sizeof buffer2, XDR_DECODE);
|
||||
if (!xdr_int (&xdr, &len)) {
|
||||
error (conn, VIR_ERR_RPC, _("xdr_int (length word, reply)"));
|
||||
return;
|
||||
}
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
/* Length includes length word - adjust to real length to read. */
|
||||
len -= 4;
|
||||
|
||||
if (len < 0 || len > REMOTE_MESSAGE_MAX) {
|
||||
error (conn, VIR_ERR_RPC, _("packet received from server too large"));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Read reply header and what follows (either a ret or an error). */
|
||||
if (really_read (conn, priv, 0, buffer, len) == -1) {
|
||||
error (conn, VIR_ERR_RPC, _("error reading buffer from memory"));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Deserialise reply header. */
|
||||
xdrmem_create (&xdr, buffer, len, XDR_DECODE);
|
||||
if (!xdr_remote_message_header (&xdr, &hdr)) {
|
||||
error (conn, VIR_ERR_RPC, _("invalid header in event firing"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (hdr.proc == REMOTE_PROC_DOMAIN_EVENT &&
|
||||
hdr.direction == REMOTE_MESSAGE) {
|
||||
DEBUG0("Encountered an async event");
|
||||
remoteDomainProcessEvent(conn, &xdr);
|
||||
} else {
|
||||
DEBUG0("invalid proc in event firing");
|
||||
error (conn, VIR_ERR_RPC, _("invalid proc in event firing"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
remoteDomainEventQueueFlush(int timer ATTRIBUTE_UNUSED, void *opaque)
|
||||
{
|
||||
int i;
|
||||
virDomainEventPtr domEvent;
|
||||
void *user_data = NULL;
|
||||
virConnectPtr conn = opaque;
|
||||
struct private_data *priv = conn->privateData;
|
||||
|
||||
while( (domEvent = virDomainEventCallbackQueuePop(priv->domainEvents)) ) {
|
||||
DEBUG(" Flushing %p", domEvent);
|
||||
for (i=0 ; i < priv->callbackList->count ; i++) {
|
||||
if( priv->callbackList->callbacks[i] ) {
|
||||
user_data = priv->callbackList->callbacks[i]->opaque;
|
||||
priv->callbackList->callbacks[i]->cb(domEvent->dom->conn,
|
||||
domEvent->dom,
|
||||
domEvent->event,
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
VIR_FREE(domEvent);
|
||||
}
|
||||
|
||||
virEventUpdateTimeout(priv->eventFlushTimer, -1);
|
||||
}
|
||||
|
@ -400,7 +400,8 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn,
|
||||
&state, &exitstatus) < 0)
|
||||
goto cleanup;
|
||||
|
||||
retval = virStringListJoin(state.list, SOURCES_START_TAG, SOURCES_END_TAG, "\n");
|
||||
retval = __virStringListJoin(state.list, SOURCES_START_TAG,
|
||||
SOURCES_END_TAG, "\n");
|
||||
if (retval == NULL) {
|
||||
virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("retval"));
|
||||
goto cleanup;
|
||||
@ -410,7 +411,7 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn,
|
||||
xmlFreeDoc(doc);
|
||||
xmlXPathFreeContext(xpath_ctxt);
|
||||
VIR_FREE(state.host);
|
||||
virStringListFree(state.list);
|
||||
__virStringListFree(state.list);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -1552,6 +1552,8 @@ static virDriver testDriver = {
|
||||
NULL, /* domainMemoryPeek */
|
||||
testNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
|
||||
NULL, /* getFreeMemory */
|
||||
NULL, /* domainEventRegister */
|
||||
NULL, /* domainEventDeregister */
|
||||
};
|
||||
|
||||
static virNetworkDriver testNetworkDriver = {
|
||||
|
Loading…
Reference in New Issue
Block a user