| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a few places we compare signed and unsigned integers. In
majority of cases it's because the iteration variable is declared
as ssize_t but then in the for() loop it's compared against an
unsigned int. But there is one case where the opposite happens
(libvirt_virDomainSendKey()), or where an UINT_MAX (which is
inherently unsigned) is compared against signed long.
Also, use this opportunity to decrease scope of 'j' variable
inside of libvirt_virDomainInterfaceAddresses().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
| |
There's no need to explicitly typecast arguments passed to
libvirt_intWrap() as they are int or long already.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
After some data was read from an incoming stream, we debug print
their length using strlen() (assuming its text stream, not binary
stream). Anyway, the debug format uses %d which then requires
strlen() to be typecasted. Well, we can use %zu and drop the
typecast.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When constructing the list of credentials to pass to
virConnectOpenAuth(), the virConnectAuth.credtype member is set
via plain PyLong_AsLong() without any error checking. Well, the
code relies on virConnectOpenAuth() to do sanity check of passed
arguments.
Switch to libvirt_intUnwrap() which does check for errors and
avoid needless trip to libvirt's public API upon error.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
| |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The libvirt_virStreamRecv function uses a temporary allocated buffer to
receive data before copying the data into a Python byte array. But
there are some error paths where this buffer is not freed. This change
fixes that memory leak.
Signed-off-by: Chris Gunn <chrisgun@microsoft.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The python version of virDomainSetIOThreadParams
(setIOThreadParams()), expects two arguments on input: the thread
ID and a dictionary which is then translated into our typed
parameters. During this translation we use a helper array which
holds type for each typed parameter supported
(virPyDomainSetIOThreadParams[]). Otherwise we guess what the
correct type is. Now, when introducing
VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} typed params into
libvirt I forgot to update the array. Do that now.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
| |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@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 conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
arguments are unsigned long long, where the proper coversion character
is 'K'.
Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
Fixes: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
|
|
|
|
|
|
| |
When the 'pcpu' is larger then the last 'iothr->cpumap' bits,
set the list element to False to avoid out of bounds access
'iothr->cpumap'.
Signed-off-by: suruifeng <suruifeng@huawei.com>
Reviewed-by: Hogan Wang <hogan.wang@huawei.com>
|
|
|
|
|
|
|
|
|
|
| |
type of threshold and excess are unsigned long long,
but PyObject_CallMethod incorrectly set it to int.
if threshold or excess greater than 0x7FFFFFFF(max int),
those variables will overflow.
Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
| |
libvirt-override.c: In function ‘libvirt_virDomainAuthorizedSSHKeysGet’:
libvirt-override.c:10455:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
10455 | for (i = 0; i < nkeys; i++)
| ^
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>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
The former is deprecated since Python 3.9, and the latter has existed
for all 3.x and probably before.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let the compiler optimize out the printf() call instead of doing it with the
pre-processor as the later does not catch format string errors or the following
case, where NULLSTR() is used but not defined:
> libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
> libvirt-qemu-override.c:271:34: warning: implicit declaration of function ‘NULLSTR’; did you mean ‘NULL’? [-Wimplicit-function-declaration]
> 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData, flags);
> | ^~~~~~~
> libvirt-qemu-override.c:39:28: note: in definition of macro ‘DEBUG’
> 39 | while (0) {printf(fmt, __VA_ARGS__);}
> | ^~~~~~~~~~~
> libvirt-qemu-override.c:270:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
> 270 | DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x) called\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData, flags);
> | ~~~~~~~~~~~~~~
> | |
> | int
> libvirt-qemu-override.c:39:23: note: in definition of macro ‘DEBUG’
> 39 | while (0) {printf(fmt, __VA_ARGS__);}
> | ^~~
> libvirt-qemu-override.c:270:73: note: format string is defined here
> 270 | DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x) called\n",
> | ~^
> | |
> | char *
> | %d
Copy the definition of NULLSTR from libvirt/src/internal.h to typewrappers.h
Signed-off-by: Philipp Hahn <hahn@univention.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seen running on fedora 32:
DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
ret = libvirtmod.virDomainLookupByUUID(self._o, uuid)
This comes from here: https://bugs.python.org/issue36381
See the section about PY_SSIZE_T_CLEAN here:
https://docs.python.org/3/c-api/arg.html#strings-and-buffers
Solution is to use Py_ssize_t instead of int for unpacked '#' values,
combined with defined PY_SSIZE_T_CLEAN before importing Python.h. The
latter turns these deprecation warnings into runtime segfaults though
if we missed an instance.
I verified the virt-manager's test suite works fine after this change
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
|
|
|
|
|
| |
The generator creates broken code for all these methods.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
| |
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
Introduced in libvirt 5.2.0 by commit <d3ea986af24>.
Reported-by: Liping Cheng <lcheng@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Introduced in libvirt 5.1.0 by commit <c830187a015>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
| |
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Introduced in libvirt 5.4.0 by commit <a699b19f6c3>.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1683516
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Introduced in libvirt 4.6.0 by commit <aee04655089>.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1683516
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
libvirt-override.c: In function ‘libvirt_virConnectBaselineHypervisorCPU’:
libvirt-override.c:9946:23: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
libvirt-override.c:9961:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
Use ssize_t as was similarly done in 75ec2acb6163b
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-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>
|
|
|
|
|
|
| |
This API needs manual impl as the generator cannot cope
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
| |
Signed-off-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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 2b4bd07e0a22 (Add check for params, nparams being a dictionary)
changed the way the optional params argument is treated. If
libvirt.virDomain.blockCopy() is called without specifying params,
params is None, and the call will fail with:
TypeError: block params must be a dictionary
This is wrong as params is defined as kwarg, breaking existing libvirt
users like oVirt. Add a check for Py_None, so we accept either a dict or
None and fail with TypeError with anything else.
Resolves: https://bugzilla.redhat.com/1687114
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
|
|
|
|
|
|
|
|
| |
The VIR_DOMAIN_IOTHREAD_POLL_SHRINK is unsigned int.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1680546
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: John Ferlan <jferlan@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>
|
|
|
|
|
|
|
|
| |
If PyDict_Check fails, we should force an error rather than
blindly continuing on.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
| |
Need to free params like similar API's such as libvirt_virDomainMigrate3
and libvirt_virDomainMigrateToURI3.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
| |
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Function libvirt_charPtrUnwrap() either fails or always sets the
unwrapped string so there is no need to check it explicitly.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
| |
In virConnectCredCallbackWrapper() we ignore the error case of
libvirt_charPtrUnwrap() function so we should also reset the exception.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libvirt python module is supposed to build with historical versions
of the API back to 0.9.1, which means all constants / methods must be
wrapped in conditionals. This was accidentally forgotten in:
commit 314b2346df2d8e2d7d705b003c693b4fa0189bdf
Author: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Date: Wed Feb 7 17:49:30 2018 +0300
Set hints for virPyDictToTypedParams
Predefine hints for all parameters possible to avoid wrong type
convert.
This broke the build against any libvirt < 2.0.0
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
| |
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|