1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-11 20:24:04 +03:00
Commit Graph

307 Commits

Author SHA1 Message Date
Daniel P. Berrange
298233168c VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED appeared in 1.1.1 2013-11-22 15:58:07 +00:00
Doug Goldstein
33b2b09b7f virDomainCreateXMLWithFiles and virDomainCreateWithFiles APIs appeared in 1.1.1
virDomainCreateXMLWithFiles() and virDomainCreateWithFiles() were not
added to libvirt until 1.1.1
2013-11-22 15:58:07 +00:00
Doug Goldstein
f721af9e54 virDomainMigrate3 and virDomainMigrateToURI3 appeared in 1.1.0
The functions virDomainMigrate3 and virDomainMigrateToURI3 were not
added to libvirt until v1.1.0.
2013-11-22 15:58:07 +00:00
Doug Goldstein
24c5e9b994 virTypedParams* API appeared in 1.0.2 and used in 1.1.0
When building against versions of libvirt prior to 1.0.2, we can not
provide wrappers for virTypedParams* APIs. In addition we don't need
to have the helper APIs until 1.1.0 when the first API we wrap starts
to use them.
2013-11-22 15:58:07 +00:00
Doug Goldstein
121d123af4 virDomainMigrateGetCompressionCache API appeared in 1.0.3 2013-11-22 15:58:07 +00:00
Doug Goldstein
e5da225dd0 virDomainGetJobStats API appeared in 1.0.3 2013-11-22 15:58:07 +00:00
Doug Goldstein
810126620a virNodeGetCPUMap API appeared in 1.0.0 2013-11-22 15:58:07 +00:00
Daniel P. Berrange
7cc872b35b VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK appeared in 1.0.0 2013-11-22 15:58:07 +00:00
Doug Goldstein
38b2d9304f virStoragePoolListAllVolumes API appeared in 0.10.2 2013-11-22 15:58:07 +00:00
Doug Goldstein
f55e27f210 virNode{Get,Set}MemoryParameters API appeared in 0.10.2 2013-11-22 15:58:07 +00:00
Doug Goldstein
f13a882e00 virConnectListAll* APIs appeared in 0.10.2 2013-11-22 15:58:07 +00:00
Doug Goldstein
6a050c8f43 virDomainPinEmulator and virDomainGetEmulatorPinInfo APIs appeared in 0.10.0 2013-11-22 15:58:06 +00:00
Daniel P. Berrange
bebe13660f VIR_DOMAIN_EVENT_ID_BALLOON_CHANGED appeared in 0.10.0 2013-11-22 15:58:06 +00:00
Doug Goldstein
cfe670927e virConnect{Unr,R}egisterCloseCallback API appeared in 0.10.0 2013-11-22 15:58:06 +00:00
Doug Goldstein
23e65b47e1 virDomainSnapshotListAllChildren API appeared in 0.9.13 2013-11-22 15:58:06 +00:00
Doug Goldstein
0ee14795fd virConnectListAllDomains API appeared in 0.9.13 2013-11-22 15:58:06 +00:00
Doug Goldstein
31d815b24b virDomainListAllSnapshots API appeared in 0.9.13 2013-11-22 15:58:06 +00:00
Daniel P. Berrange
218dbee6c6 Remove use of virStrcpyStatic
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:06 +00:00
Daniel P. Berrange
4f1ea70fd1 Import VIR_ALLOC / VIR_ALLOC_N / VIR_REALLOC_N functions
Import the libvirt memory allocation functions, stripping the OOM
testing and error reporting pieces.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:06 +00:00
Daniel P. Berrange
c856b7c623 Import gnulib's xalloc_oversized macro
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:05 +00:00
Daniel P. Berrange
e169d3d8cf Import STREQ macro from libvirt
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:05 +00:00
Daniel P. Berrange
3bfb20266b Update header file includes
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>
2013-11-22 15:58:05 +00:00
Daniel P. Berrange
70b8c9a2a3 Mostly revert "python: remove virConnectGetCPUModelNames from globals"
This reverts commit 6b90d7428d72e92db292a9228c44701bfd5003c9.

The original problem was that libvirt_virConnectGetCPUModelNames
was listed twice in the exports table, once automatically from
the generator and once from the manual override. We merely needed
to list it in the skip_impl list, and not delete the manually
written code entirely.
2013-11-22 15:54:43 +00:00
Doug Goldstein
45ac117cf6 python: remove virConnectGetCPUModelNames from globals
Commit de51dc9c9aed0e615c8b301cccb89f4859324eb0 primarily added
virConnectGetCPUModelNames as libvirt.getCPUModelNames(conn, arch)
instead of libvirt.virConnect.getCPUModelNames(arch) so revert the code
that does the former while leaving the code that does the later.

This is the rest of the patch that was ACK'd by Dan but I committed only
the partial patch in 6a8b8ae.
2013-11-21 14:20:45 -06:00
Eric Blake
9e8b8a824d maint: fix comma style issues: python
Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.

* python/libvirt-override.c: Consistently use commas.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-20 09:14:55 -07:00
Doug Goldstein
34b7679331 Add missing break to switch-case block
The case label for VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED did not have its
own break statement but relied on falling through which we probably
don't want.
2013-11-19 10:29:28 -06:00
Marian Neagul
1da4ac52f5 python: Fix Create*WithFiles filefd passing
Commit d76227be added functions virDomainCreateWithFiles and
virDomainCreateXMLWithFiles, but there was a little piece missing in
python bindings.  This patch fixes proper passing of file descriptors
in the overwrites of these functions.
2013-10-22 23:01:18 +01:00
Eric Blake
90461df0ca maint: avoid 'const fooPtr' in python bindings
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can).  But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).

Fix up offenders in the python bindings.

* python/generator.py (py_types): Drop useless conversions.
* python/libvirt-override.c (getPyVirTypedParameter)
(setPyVirTypedParameter): Use intended type.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-14 14:34:37 -06:00
Giuseppe Scrivano
357df252fb python: add bindings for virConnectGetCPUModelNames
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-23 16:59:39 -06:00
Daniel P. Berrange
793ca0c3b1 Fix potential use of uninitialized value in virDomainGetVcpuPinInfo
The virDomainGetVcpuPinInfo python wrapper had a potential use of
uninitialized values

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-09-20 17:22:39 +01:00
Jiri Denemark
8566ca3ad1 Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event 2013-07-18 15:28:45 +02:00
Daniel P. Berrange
03e7cacfa2 Introduce new domain create APIs to pass pre-opened FDs to LXC
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.

To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.

This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-18 11:01:14 +01:00
Guannan Ren
f8bc3a9ccc python: return dictionary without value in case of no blockjob
Currently, when there is no blockjob, dom.blockJobInfo('vda')
still reports error because it doesn't distinguish return value 0 from -1.
libvirt.libvirtError: virDomainGetBlockJobInfo() failed

virDomainGetBlockJobInfo() API return value:
 -1 in case of failure, 0 when nothing found, 1 found.

And use PyDict_SetItemString instead of PyDict_SetItem when key is
of string type. PyDict_SetItemString increments key/value reference
count, so call Py_DECREF() for value. For key, we don't need to
do this, because PyDict_SetItemString will handle it internally.
2013-07-15 18:20:42 +08:00
Daniel P. Berrange
82395204f3 Convert 'int i' to 'size_t i' in python/ files
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>
2013-07-10 17:55:17 +01:00
Michal Privoznik
8eceaa39e2 viralloc: Report OOM error on failure
Similarly to VIR_STRDUP, we want the OOM error to be reported in
VIR_ALLOC and friends.
2013-07-10 11:07:31 +02:00
Jiri Denemark
9b3d789449 python: Add bindings for extensible migration APIs
The patch implements wrappers for virDomainMigrate3 and
virDomainMigrateToURI3.
2013-06-25 01:28:39 +02:00
Eric Blake
84d3e36109 syntax: prefer space after semicolon in for loop
I noticed several unusual spacings in for loops, and decided to
fix them up.  See the next commit for the syntax check that found
all of these.

* examples/domsuspend/suspend.c (main): Fix spacing.
* python/libvirt-override.c: Likewise.
* src/conf/interface_conf.c: Likewise.
* src/security/virt-aa-helper.c: Likewise.
* src/util/virconf.c: Likewise.
* src/util/virhook.c: Likewise.
* src/util/virlog.c: Likewise.
* src/util/virsocketaddr.c: Likewise.
* src/util/virsysinfo.c: Likewise.
* src/util/viruuid.c: Likewise.
* src/vbox/vbox_tmpl.c: Likewise.
* src/xen/xen_hypervisor.c: Likewise.
* tools/virsh-domain-monitor.c (vshDomainStateToString): Drop
default case, to let compiler check us.
* tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-28 07:56:07 -06:00
Osier Yang
1da3b68925 python: Remove the whitespace before ";" 2013-05-21 23:41:45 +08:00
Daniel P. Berrange
c1075880ba Fix build of python bindings on Python 2.4
The PyDict_Next method on Python <= 2.4 used 'int' instead
of "Py_ssize_t" for the 'pos' parameter

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-09 17:02:11 +01:00
Michal Privoznik
50b32e0e36 virutil: Move string related functions to virstring.c
The source code base needs to be adapted as well. Some files
include virutil.h just for the string related functions (here,
the include is substituted to match the new file), some include
virutil.h without any need (here, the include is removed), and
some require both.
2013-05-02 16:56:55 +02:00
Eric Blake
f2b1504a79 docs: fix usage of 'onto'
http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
(and several other sites) give hints that 'onto' is best used if
you can also add 'up' just before it and still make sense. In many
cases in the code base, we really want the two-word form, or even
a simplification to just 'on' or 'to'.

* docs/hacking.html.in: Use correct 'on to'.
* python/libvirt-override.c: Likewise.
* src/lxc/lxc_controller.c: Likewise.
* src/util/virpci.c: Likewise.
* daemon/THREADS.txt: Use simpler 'on'.
* docs/formatdomain.html.in: Better usage.
* docs/internals/rpc.html.in: Likewise.
* src/conf/domain_event.c: Likewise.
* src/rpc/virnetclient.c: Likewise.
* tests/qemumonitortestutils.c: Likewise.
* HACKING: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-04-19 14:31:16 -06:00
Osier Yang
919889aa59 syntax-check: Only allows to include public headers in external tools
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.
2013-04-18 11:31:19 +08:00
Peter Krempa
a5036ccfd6 python: Fix emulatorpin API bindings
The addition of emulator pinning APIs didn't think of doing the right
job with python APIs for them. The default generator produced unusable
code for this.

This patch switches to proper code as in the case of domain Vcpu pining.
This change can be classified as a python API-breaker but in the state
the code was before I doubt anyone was able to use it successfully.
2013-03-21 12:32:03 +01:00
Jiri Denemark
7465d31bbd python: Implement virDomainMigrateGetCompressionCache wrapper 2013-02-22 17:35:59 +01:00
Jiri Denemark
b1f3f2d37d python: Implement virDomainGetJobStats wrapper 2013-02-22 17:35:58 +01:00
Jiri Denemark
6d36e1dd94 Introduce virTypedParamsClear public API
The function is just a renamed public version of former
virTypedParameterArrayClear.
2013-01-18 15:04:00 +01:00
Jiri Denemark
98768a7bf1 python: Avoid freeing uninitialized new_params pointer 2013-01-17 12:05:12 +01:00
Daniel P. Berrange
6eeeb3da16 Rename util.{c,h} to virutil.{c,h} 2012-12-21 11:19:49 +00:00
Daniel P. Berrange
e747413cd5 Rename memory.{c,h} to viralloc.{c,h} 2012-12-21 11:17:14 +00:00
Osier Yang
94ea7e5b48 Fix the indention
Introduced by commit 1465876a, pushed under build-breaker &&
trivial rule.
2012-12-04 23:41:35 +08:00