| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
The bindings generator can't generate proper bindings for FD passing so
the bindings need to be implemented manually both the python wrapper and
the C backend.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
|
| |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
| |
Currently we always generate both the C code and Python code at the same
time. To cope with following changes to the build process, we want to be
able to generate C and Python separately.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
| |
The names make it clearer exactly what is being generated by each.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The python generator needs to know whether certain functions were
skipped in the C generator. This is achieved by the C generator
deleting skipped functions as it runs. This is an unhelpful side
effect as it makes it impossible to run the python generator
without first running the C generator.
This refactors buildStubs to get rid of the global side effects
it has, by providing some helper functions for buildWrappers
to use.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
As a side effect of generating the C code, the buildStubs methods
checks for various unsupported types and reports errors. This is
an undesirable side effect, if we want to skip C code generation.
Splitting function type validation out into a separate method
allows better reuse.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The buildStubs method has a side effect of loading and parsing the API
XML files, which the buildWrappers method then relies on.
Splitting API loading into a separate method will facilitate running
only the buildWrappers method in future.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Instead of having three separate methods for generating python
wrappers, merge them all together.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Prepare for using buildWrappers to generate code for the QEMU / LXC
APIs too.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
Now that we're using common data structures for all the main libvirt,
QEMU and LXC APIs, several of the functions have code duplication
that can be eliminated.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Now that we only use a single dict for tracking all enums, we
only need a single function for registering them.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking enums.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Now that we only use a single dict for tracking all functions, we
only need a single function for registering them.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking skipped functions.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking functions.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
With libvirt-8.2.0 there's a new API:
virDomainQemuMonitorCommandWithFiles(). Since the API has both
input and output arguments we need to provide an alternative
implementation. Moreover, since FD passing works only on
UNIX-like systems we can query the returned FDs for their flags
and construct mode for python File object.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Provide a manual override for the virNodeDeviceGetAutostart() API
modeled on what's done for the network and storage APIs.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The way that virNodeDevice method name fixup is written makes it
hard to find via grep (matching the virNodeDevice prefix and then
matching only the operation like "Get", "Lookup", ...). Expand
the string matching to match the pattern of other cases.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the 7.3.0 release we are going to have three new public APIs:
virNodeDeviceDefineXML()
virNodeDeviceUndefine()
virNodeDeviceCreate()
The first one is slightly problematic, because it takes
virConnectPtr argument and thus our generator wants to put its
wrapper under virConnect python class, which is correct, but
what's incorrect is the name it chooses for the method:
defineXML(). Such method already exists and wraps
virDomainDefineXML() around. Also, the name is rather confusing
anyway - it's missing the 'nodeDevice' prefix.
Fortunately, the fix is easy - add another case into nameFixup().
The story with virNodeDeviceCreate() is similar. Except, this time
the class in which the method was put is correct. But the name is
still wrong, because our generator matched 'virNodeDeviceCreate'
thinking it's the good old virNodeDeviceCreateXML() API and
"fixed" the name of the method to nodeDeviceCreate().
Luckily, virNodeDeviceUndefine() is just fine.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
Both APIs work with string lists (the getter returns it, the
setter gets keys to set from it) -> represent that as a python
list. The rest is kept as is in C.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
| |
Fixes 7f021c21d6a091ca33615852d6061e75b2500f3f
Resolves https://gitlab.com/libvirt/libvirt-python/-/issues/4
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
a variable should not change its type.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
Assign tuple to multiple loop variables for better readability
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
| |
to be closes to pep8 which makes reading the generated code easier and
reduces the number of issues found by flake8.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
for better type checking: both are bool()==False, but None is not str.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
|
| |
for nested dictionaries allows to remove the case distinction for
"first" from "all other" cases.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
|
|
| |
The variables are local to that funcion
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
| |
tuple() and list() are sequences, while dict() and set() are hash-based,
which is more efficient for contains().
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
Python has a native type for set()s.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
no need to compare with None or empty string.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
Use sorted(..., key=...) instead of using explicit list.sort()
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
instead of list.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
Assign tuple to multiple loop variables for better readability
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
instead of using None as this has a different type.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use attr.get(key, default) instead.
Also use the empty sting "" as the default value instead of "None": Both
are "False" when used as a bool()ean, but "None" would require an
explicit check for "not None" in many places as str() and None have
different types.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
instead of sting concatenating.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
| |
directly instead of using legacy method names from xmllib.
Depends: 3740a5e4c701281ac76a55e3f02b1d4221f1f9f0
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
|
| |
getmethodname()
close()
cdata()
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
to use closing context manager.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
| |
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
instead of hand-coded implementation.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
| |
instead of generating a list first.
Signed-off-by: Philipp Hahn <hahn@univention.de>
|