IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the
VIR_DOMAIN_QEMU_AGENT_COMMAND_* enum values to use different enum values
instead of direct numbers. We need to translate it back.
Traceback (most recent call last):
File "generator.py", line 2143, in <module>
qemuBuildWrappers(sys.argv[1])
File "generator.py", line 2008, in qemuBuildWrappers
items.sort(key=lambda i: (int(i[1]), i[0]))
File "generator.py", line 2008, in <lambda>
items.sort(key=lambda i: (int(i[1]), i[0]))
ValueError: invalid literal for int() with base 10: 'VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK'
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
The virNetworkPort class is passed both the virNetwork parent
python class and the virNetworkPort C object. This needs special
handling in the generator, similar to how virDomainSnapshots are
dealt with.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Copies heavily from existing virDomainSnapshot handling, regarding
what special cases the generator has to be taught and what overrides
need to be written.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Define the various rules in the generator to wire up methods into the
virNetwork class and create the new virNetworkPort class.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Similar to libvirt_virDomainBlockCopy (and migration API's). Create
the code for the new API.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
We did not correctly mangle the API names in two cases, and we also
forgot to specialize the lookup method name in the sanity test.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This binding allows to query the AMD's SEV firmware for various platform
specific things, like a PDH certificate and a certificate chain to
establish a trusted connection with the firmware. Because the API uses
typed params, it's exempted from generation.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Libvirt recently introduced support for getting launch security
parameters, most notably AMD SEV VM memory measurement. This API can't
be generated as it's using typed parameters which we need to allocate.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
The python bindings for this API cannot be generated because are
generator is not capable of handling string arrays (char **) parameters.
https://bugzilla.redhat.com/show_bug.cgi?id=1584676
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
This is particularly useful on operating systems that don't ship
Python as part of the base system (eg. FreeBSD) while still working
just as well as it did before on Linux.
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Yet again, our parser is not capable of generating proper
wrapper. To be fair, this one wold be really tough anyway.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Yet again, we need a custom wrapper over virStreamRecvFlags
because our generator is not capable of generating it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
The return value for virStreamRecvHole is slightly different to
its C counterpart. In python, either it returns the hole size or
None if C API fails.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
The 'functions_list_exception_test' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'converter_type' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'classes_ancestor' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'py_return_types' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'foreign_encoding_args' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'function_post' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
The 'reference_keepers' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
When using libvirt python you must never call the object
constructors directly, as these are expecting to be passed
a wrapped C object. For example
import libvirt
c = libvirt.virConnect("qemu:///system")
c.listAllDomains()
will mysteriously segfault. With this change the user now
gets an slightly more helpful error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/berrange/src/virt/libvirt-python/build/libvirt.py", line 3409, in __init__
raise Exception("Expected a wrapped C Object but got %s" % type(_obj))
Exception: Expected a wrapped C Object but got <type 'str'>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
One of the regexes has a bogus \o instead of plain 'o'. Somehow
this magically worked on all versions of python, until 3.6 came
along and complained
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This function has virTypedParameterPtr as one of the args and our
generator is unable to deal with that. Therefore we must provide
implementation.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This patch adds the python binding for virDomainSetPerfEvents and
virDomainSetPerfEvents API.
Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1222795#c6
if build libvirt-python with some old xml lib (python-pyxml),
build will fail and error like this:
File "generator.py", line 139, in start
if "string" in attrs:
File "/usr/local/lib/python2.7/site-packages/_xmlplus/sax/xmlreader.py" \
, line 316, in __getitem__
return self._attrs[name]
KeyError: 0
This is an old issue and have been mentioned in commit 3ae0a76d.
There is no __contains__ in class AttributesImpl, python will use
__getitem__ in this place, so we will get error.
Let's use 'YYY in XXX.keys()' to avoid this issue.
Signed-off-by: Luyao Huang <lhuang@redhat.com>
In order to achieve reproducible builds[0] we want the items within
enums always generated in the same order so sort on both items in the
tuple.
[0] https://wiki.debian.org/ReproducibleBuilds/About
examples/Makefile.am:
* Add new file domipaddrs.py
examples/README:
* Add documentation for the python example
libvirt-override-api.xml:
* Add new symbol for virDomainInterfacesAddresses
libvirt-override.c:
* Hand written python api
Example:
$ python examples/domipaddrs.py qemu:///system f18
Interface MAC address Protocol Address
vnet0 52:54:00:20:70:3d ipv4 192.168.105.240/16
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Add support for the libvirt_virDomainGetIOThreadsInfo method. This
code mostly follows the libvirt_virDomainGetVcpuPinInfo method, but
also takes some from the libvirt_virNodeGetCPUMap method with respect
to building the cpumap into the returned tuple rather than two separate
tuples which vcpu pinning generates
Assuming two domains, one with IOThreads defined (eg, 'iothr-gst') and
one without ('noiothr-gst'), execute the following in an 'iothr.py' file:
import libvirt
con=libvirt.open("qemu:///system")
dom=con.lookupByName('iothr-gst')
print dom.ioThreadsInfo()
dom2=con.lookupByName('noiothr-gst')
print dom2.ioThreadsInfo()
$ python iothr.py
[(1, [False, False, True, False]), (2, [False, False, False, True]), (3, [True, True, True, True])]
[]
$
In some cases, it is very easy for downstream distros to backport
enum values without requiring a .so bump. Keying the conditional
code off of the upstream version where the enum value was added
is not ideal, because downstream then has to patch that the feature
is available in their build that still reports an earlier version
number. For example, if RHEL 7 backports events from 1.2.11 into
a build based on 1.2.8, building the python bindings would warn:
libvirt-override.c: In function ‘libvirt_virConnectDomainEventRegisterAny’:
libvirt-override.c:6653:5: warning: enumeration value ‘VIR_DOMAIN_EVENT_ID_TUNABLE’ not handled in switch [-Wswitch]
switch ((virDomainEventID) eventID) {
^
libvirt-override.c:6653:5: warning: enumeration value ‘VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE’ not handled in switch [-Wswitch]
The solution is simple - use feature-based probes instead of
version probes. Since we already scrape the XML API document of
whatever libvirt build we are binding, and that XML already
documents any downstream enum additions, we can use those as the
features for gating conditional compilation.
* generator.py (enum): Track event id names.
(buildStubs): Output define wrappers for events.
* libvirt-override.c
(libvirt_virConnectDomainEventBalloonChangeCallback)
(libvirt_virConnectDomainEventPMSuspendDiskCallback)
(libvirt_virConnectDomainEventDeviceRemovedCallback)
(libvirt_virConnectDomainEventTunableCallback)
(libvirt_virConnectDomainEventAgentLifecycleCallback)
(libvirt_virConnectDomainEventRegisterAny): Use them.
Signed-off-by: Eric Blake <eblake@redhat.com>
This returns the raw C pointer to the underlying object, eg:
conn = libvirt.open(None)
print "0x%x" % conn.c_pointer() # returns virConnectPtr of the connection
dom = conn.lookupByName("test")
print "0x%x" % dom.c_pointer() # returns virDomainPtr of the domain
The reason behind this is to allow us to transparently pass Python dom
objects through the libguestfs Python API.
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
Implement the function which returns a list of tuples, that contains members
of virDomainFSInfo struct.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>