| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes regression caused by the 1d39dbaf637db03f6e597ed56b96aa065710b4a1
fdlist[i] erroneously was replaced by fdlist[1] which caused
lxcOpenNamespace to return a list with identical elements.
Signed-off-by: Sergei Turchanov <turchanov@farpost.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
|
|
|
|
|
| |
When python3 builds C modules, it adds the -Wsign-compare flag to GCC.
This creates lots of warnings where we compare a 'size_t' value against
an 'int' value due to signed/unsigned difference. Change all the size_t
types to ssize_t to address this.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
| |
If the function fails, we need to cleanup memory and return NULL.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
| |
There is a rule, python API fails, it also in those cases sets an
exception. We should follow those rules and in those cases return NULL.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
| |
Follow the libvirt hacking guide and make the code consistent.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
| |
As in the previous patch, fix all places where 'flags' is converted as a
signed argument to unsigned including the python code generator.
|
|
|
|
|
|
|
|
|
| |
Replace use of the PyInt_FromLong and PyLong_FromLongLong
with libvirt_{int,uint,longlong,ulonglong}Wrap helpers.
This isolates the need for Python3 specific code in one
place.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
| |
The way native modules are registered has completely
changed, so the code must be #ifdef'd for Python2 & 3
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Import the libvirt memory allocation functions, stripping the OOM
testing and error reporting pieces.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
| |
We're no longer using automake, so <config.h> files are not
required. Also remove of all libvirt internal util header
files. Reference generated header files in build/ subdir.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1003828
|
|
|
|
|
|
|
|
| |
Fix PyList usage mistake in Function libvirt_lxc_virDomainLxcOpenNamespace.
https://bugzilla.redhat.com/show_bug.cgi?id=1002383
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
| |
|
|
|
|
|
|
| |
With this patch, include public headers in "" form is only allowed
for "internal.h". And only the external tools (examples|tools|python
|include/libvirt) can include the public headers in <> form.
|
|
This patch introduces support for LXC specific public APIs. In
common with what was done for QEMU, this creates a libvirt_lxc.so
library and libvirt/libvirt-lxc.h header file.
The actual APIs are
int virDomainLxcOpenNamespace(virDomainPtr domain,
int **fdlist,
unsigned int flags);
int virDomainLxcEnterNamespace(virDomainPtr domain,
unsigned int nfdlist,
int *fdlist,
unsigned int *noldfdlist,
int **oldfdlist,
unsigned int flags);
which provide a way to use the setns() system call to move the
calling process into the container's namespace. It is not
practical to write in a generically applicable manner. The
nearest that we could get to such an API would be an API which
allows to pass a command + argv to be executed inside a
container. Even if we had such a generic API, this LXC specific
API is still useful, because it allows the caller to maintain
the current process context, in particular any I/O streams they
have open.
NB the virDomainLxcEnterNamespace() API is special in that it
runs client side, so does not involve the internal driver API.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|