This patch adds a structure virMemoryParameter, it contains the name of
the
parameter and the type of the parameter along with a union.
dv:
+ rename enums to VIR_DOMAIN_MEMORY_PARAM_*
+ remove some extraneous tabs
v4:
+ Add unsigned int flags to the public api for future extensions
v3:
+ Protoype for virDomainGetMemoryParameters and dummy python binding.
v2:
+ Includes dummy python bindings for the library to build cleanly.
+ Define string constants like "hard_limit", etc.
+ re-order this patch.
Probably a copy-paste-bug in python/libvirt-override-api.xml:
virStorageVolGetInfo() extracts information about a "storage volume",
not the "storage pool" as virStoragePoolGetInfo() does.
Signed-off-by: Philipp Hahn <hahn@univention.de>
This involved a few fixes. To start with,
an virDomainSnapshot object is really tied to a
domain, not a connection, so we have to generate
a slightly different object so that we can get
at self._dom for the object.
Next, we had to "dummy" up an override piece of
XML with a bogus argument that the function doesn't
actually take. That's so that the generator places
virDomainRevertToSnapshot underneath the correct
class (namely, the virDomain class).
Finally, we had to hand-implement the
virDomainRevertToSnapshot implementation, ignoring the
bogus pointer we are being passed.
With all of this in place, I was able to successfully
take a snapshot and revert to it using only the
Python bindings.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
This binds the virDomainGetBlockInfo API to python's blockInfo
method on the domain object
>>> c = libvirt.openReadOnly('qemu:///session')
>>> d = c.lookupByName('demo')
>>> f = d.blockInfo("/dev/loop0", 0)
>>> print f
[1048576000L, 104857600L, 104857600L]
* python/libvirt-override-api.xml: Define override signature
* python/generator.py: Skip C impl generator for virDomainGetBlockInfo
* python/libvirt-override.c: Manual impl of virDomainGetBlockInfo
The generator code was totally wrong for the virDomainSnapshot
APIs, not generating the wrapper class, and giving methods the
wrong names
* generator.py: Set metadata for virDomainSnapshot type & APIs
* libvirt-override-api.xml, libvirt-override.c: Hand-code the
virDomainSnapshotListNames glue layer
According to:
http://libvirt.org/html/libvirt-libvirt.html#virNetworkLookupByUUID
virNetworkLookupByUUID() expects a virConnectPtr as its first argument,
thus making it a method of the virConnect Python class.
Currently it's a method of libvirt.virNetwork.
@@ -805,13 +805,6 @@ class virNetwork:
if ret == -1: raise libvirtError ('virNetworkGetAutostart() failed', net=self)
return ret
- def networkLookupByUUID(self, uuid):
- """Try to lookup a network on the given hypervisor based on its UUID. """
- ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
- if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', net=self)
- __tmp = virNetwork(self, _obj=ret)
- return __tmp
-
class virInterface:
def __init__(self, conn, _obj=None):
self._conn = conn
@@ -1689,6 +1682,13 @@ class virConnect:
__tmp = virDomain(self,_obj=ret)
return __tmp
+ def networkLookupByUUID(self, uuid):
+ """Try to lookup a network on the given hypervisor based on its UUID. """
+ ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
+ if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', conn=self)
+ __tmp = virNetwork(self, _obj=ret)
+ return __tmp
+
Introduce a new public API that provides a way to get progress
info on currently running jobs on a virDomainpPtr. APIs that
are initially within scope of this idea are
virDomainMigrate
virDomainMigrateToURI
virDomainSave
virDomainRestore
virDomainCoreDump
These all take a potentially long time and benefit from monitoring.
The virDomainJobInfo struct allows for various pieces of information
to be reported
- Percentage completion
- Time
- Overall data
- Guest memory data
- Guest disk/file data
* include/libvirt/libvirt.h.in: Add virDomainGetJobInfo
* python/generator.py, python/libvirt-override-api.xml,
python/libvirt-override.c: Override for virDomainGetJobInfo API
* python/typewrappers.c, python/typewrappers.h: Introduce wrapper
for unsigned long long type
adds a new python API call for retrieving the running
hypervisor version used by a connection: virConnectGetVersion
* python/generator.py: skip virConnectGetVersion from autogenerated
* python/libvirt-override-api.xml python/libvirt-override.c: define
direct native bindings
Enable virDomainMemoryStats in the python API. dom.memoryStats() will return a
dictionary containing the supported statistics. A dictionary is required
because the meaining of each quantity cannot be inferred from its index in a
list.
* python/generator.py: reenable bindings for this entry point
* python/libvirt-override-api.xml python/libvirt-override.c: the
generator can't handle this new function, add the new binding,
and the XML description
* python/generator.py python/libvirt-override-api.xml
python/libvirt-override.c: implement the bindings for
virConnectListInterfaces() and virConnectListDefinedInterfaces()
There is currently no way to determine the libvirt version of a remote
libvirtd we are connected to. This is a useful piece of data to enable
feature detection.
* README: New file describing what each file is used for
* livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
libvirt-override-virConnect.py: Manually written code overriding
the generator
* typewrappers.c, typewrappers.h: Data type wrappers
* generator.py: Automatically pre-prend contents of libvirt-override.py
to generated libvirt.py. Output into libvirt.py directly instead of
libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
files into libvirt.c/.h directly
* Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
and libvirtclass.py, since generator.py does it directly