summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* virDomainSnapshotListAllChildren API appeared in 0.9.13Doug Goldstein2013-11-221-0/+4
|
* virConnectListAllDomains API appeared in 0.9.13Doug Goldstein2013-11-221-0/+4
|
* virDomainListAllSnapshots API appeared in 0.9.13Doug Goldstein2013-11-221-0/+4
|
* Don't build LXC module when building less than 1.0.2Doug Goldstein2013-11-221-11/+23
| | | | | The functions that the LXC module wraps did not appear until 1.0.2 so we can't build the module unless we're building against 1.0.2 or newer.
* Create array of modules to be builtDoug Goldstein2013-11-221-2/+14
| | | | | | Create an array of modules to be built to allow for flexibility to enable or disable some modules in the future and allow for additional modules to be added easily
* Break generator.py to be called per moduleDoug Goldstein2013-11-222-13/+15
| | | | | | | Since we don't always want to build all the modules, and there might be more modules added in the future but we want to retain backwards compatibility with older libvirts, change generator.py to be called once per module instead of with all modules at once.
* Setup distutils build systemDaniel P. Berrange2013-11-229-0/+1229
| | | | | | | Create a setup.py for building libvirt python code and add supporting files Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add execute permission for sanitytest.pyDaniel P. Berrange2013-11-221-0/+0
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add build/ to python module path for sanitytest.pyDaniel P. Berrange2013-11-221-0/+4
| | | | | | | The generated libvirt.py modules will be in the build/ directory, so santitytest.py must use that directory. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import some virTypedParams* APIs from libvirtDoug Goldstein2013-11-222-0/+52
| | | | | | | virTypedParamsClear() and virTypedParamsFree() were introduced in libvirt 1.0.2. In an effort to keep the code clean bring these two functions to libvirt-python if we're building against a version of libvirt that's older than 1.0.2
* Import LIBVIR_CHECK_VERSION macro from libvirtDoug Goldstein2013-11-221-0/+10
| | | | | | | Add LIBVIR_CHECK_VERSION from libvirt upstream so that we can check the version of the library we are compiling against and support a range of libvirt versions. The macro was added to libvirt in 1.2.0 so we must provide it if its not defined.
* Import VIR_FORCE_CLOSE macro from libvirtDaniel P. Berrange2013-11-222-0/+27
| | | | | | Import the macro for safely closing file descriptors Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove use of virStrcpyStaticDaniel P. Berrange2013-11-221-1/+2
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import VIR_ALLOC / VIR_ALLOC_N / VIR_REALLOC_N functionsDaniel P. Berrange2013-11-226-53/+253
| | | | | | | Import the libvirt memory allocation functions, stripping the OOM testing and error reporting pieces. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import code annotation macros from libvirtDaniel P. Berrange2013-11-221-0/+52
| | | | | | | Import ATTRIBUTE_RETURN_CHECK, ATTRIBUTE_UNUSED & ATTRIBUTE_NONNULL macros Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import gnulib's ignore_value macroDaniel P. Berrange2013-11-221-0/+11
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import gnulib's xalloc_oversized macroDaniel P. Berrange2013-11-222-0/+16
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add decl of MIN macroDaniel P. Berrange2013-11-221-0/+4
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import STREQ macro from libvirtDaniel P. Berrange2013-11-222-0/+28
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Update header file includesDaniel P. Berrange2013-11-224-24/+6
| | | | | | | | 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>
* Update generator for new code layoutDaniel P. Berrange2013-11-221-44/+25
| | | | | | | Change the generator.py to - Take XML API file names on command line - Generate data in build/ directory instead of cwd
* Remove obsolete Makefile.amDaniel P. Berrange2013-11-222-194/+0
| | | | | | We are no longer using automake, so Makefile.am is obsolete Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Move python example programs into python/examples/ subdirectoryDaniel P. Berrange2013-11-2210-0/+1139
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Mostly revert "python: remove virConnectGetCPUModelNames from globals"Daniel P. Berrange2013-11-221-0/+53
| | | | | | | | | | 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.
* python: remove virConnectGetCPUModelNames from globalsDoug Goldstein2013-11-212-53/+1
| | | | | | | | | | 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.
* python: remove virConnectGetCPUModelNames from globalsDoug Goldstein2013-11-212-12/+0
| | | | | | | 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.
* maint: fix comma style issues: pythonEric Blake2013-11-201-6/+6
| | | | | | | | | 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>
* Add missing break to switch-case blockDoug Goldstein2013-11-191-0/+1
| | | | | | 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.
* python: Fix Create*WithFiles filefd passingMarian Neagul2013-10-221-0/+4
| | | | | | | 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.
* Don't link virt-login-shell against libvirt.so (CVE-2013-4400)Daniel P. Berrange2013-10-211-0/+1
| | | | | | | | | | | | | | | | | The libvirt.so library has far too many library deps to allow linking against it from setuid programs. Those libraries can do stuff in __attribute__((constructor) functions which is not setuid safe. The virt-login-shell needs to link directly against individual files that it uses, with all library deps turned off except for libxml2 and libselinux. Create a libvirt-setuid-rpc-client.la library which is linked to by virt-login-shell. A config-post.h file allows this library to disable all external deps except libselinux and libxml2. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* maint: avoid 'const fooPtr' in python bindingsEric Blake2013-10-142-13/+2
| | | | | | | | | | | | | | | '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>
* python: Document virNodeGetInfo bugMichal Privoznik2013-09-301-1/+1
| | | | | | | The memory size in virNodeGetInfo python API binding is reported in MiB instead of KiB (like we have in C struct). However, there already might be applications out there relying on this inconsistence so we can't simply fix it. Document this sad fact as known bug.
* python: add bindings for virConnectGetCPUModelNamesGiuseppe Scrivano2013-09-234-1/+72
| | | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* libvirt: add new public API virConnectGetCPUModelNamesGiuseppe Scrivano2013-09-231-0/+1
| | | | | | | | The new function virConnectGetCPUModelNames allows to retrieve the list of CPU models known by the hypervisor for a specific architecture. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* Fix potential use of uninitialized value in virDomainGetVcpuPinInfoDaniel P. Berrange2013-09-201-1/+1
| | | | | | | The virDomainGetVcpuPinInfo python wrapper had a potential use of uninitialized values Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* docs, comments: minor typo fixesOskari Saarenmaa2013-09-101-4/+4
| | | | | Signed-off-by: Oskari Saarenmaa <os@ohmu.fi> Signed-off-by: Eric Blake <eblake@redhat.com>
* build: enforce makefile conditional styleEric Blake2013-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automake has builtin support to prevent botched conditional nesting, but only if you use: if FOO else !FOO endif !FOO An example error message when using the wrong name: daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE As our makefiles tend to have quite a bit of nested conditionals, it's better to take advantage of the benefits of the build system double-checking that our conditionals are well-nested, but that requires a syntax check to enforce our usage style. Alas, unlike C preprocessor and spec files, we can't use indentation to make it easier to see how deeply nesting goes. * cfg.mk (sc_makefile_conditionals): New rule. * daemon/Makefile.am: Enforce the style. * gnulib/tests/Makefile.am: Likewise. * python/Makefile.am: Likewise. * src/Makefile.am: Likewise. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* Fix leaks in python bindingsJán Tomko2013-09-032-0/+4
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1003828
* python: Fix a PyList usage mistakeGuan Qiang2013-08-291-1/+1
| | | | | | | | 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>
* python: simplify complicated conditional assignmentClaudio Bley2013-08-231-2/+1
|
* Test for object identity when checking for None in PythonClaudio Bley2013-08-233-18/+18
| | | | | | | | | Consistently use "is" or "is not" to compare variables to None, because doing so is preferrable, as per PEP 8 (http://www.python.org/dev/peps/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or > is not, never the equality operators.
* python: Use RELRO_LDFLAGS and NO_INDIRECT_LDFLAGSGuido Günther2013-08-221-0/+7
| | | | A readonly GOT and detecting indirect linkage is useful here too.
* Delete obsolete / unused python test filesDaniel P. Berrange2013-07-307-348/+0
| | | | | | | | | | | | | | | | | The python/tests directory contains a number of so called "tests" for the python API. These are all hardcoded to look for Xen and cannot be run in any automated fashion, and no one is ever manually running them. Given that they don't meaningully contribute to the test coverage, delete them. For some reason these tests were also copied into the filesystem as part of 'make install'. The change to the RPM in commit 3347a4203278ec93d7b0ceb88b5ed10e4f14765c caused a build failure, since it removed the code which deleted these installed tests. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* python: Drop TODOCole Robinson2013-07-292-13/+0
| | | | | | | | File hasn't been really touched for 7 years. And with recent rawhide changes it contributed to an RPM build failure. Let's drop it. This also removes installation of a libvirt-python doc dir, so drop handling of it from the RPM spec.
* maint: split long lines in MakefilesEric Blake2013-07-191-6/+12
| | | | | | | | | | | | | | | | | | Makefiles are another easy file to enforce line limits. Mostly straightforward; interesting tricks worth noting: src/Makefile.am: $(confdir) was already defined, use it in more places tests/Makefile.am: path_add and VG required some interesting compression * cfg.mk (sc_prohibit_long_lines): Add another test. * Makefile.am: Fix offenders. * daemon/Makefile.am: Likewise. * docs/Makefile.am: Likewise. * python/Makefile.am: Likewise. * src/Makefile.am: Likewise. * tests/Makefile.am: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED eventJiri Denemark2013-07-182-1/+60
|
* Introduce new domain create APIs to pass pre-opened FDs to LXCDaniel P. Berrange2013-07-184-0/+160
| | | | | | | | | | | | | | | | | | | | 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>
* python: return dictionary without value in case of no blockjobGuannan Ren2013-07-151-15/+39
| | | | | | | | | | | | | | 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.
* Convert 'int i' to 'size_t i' in python/ filesDaniel P. Berrange2013-07-102-45/+71
| | | | | | | | | 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>
* viralloc: Report OOM error on failureMichal Privoznik2013-07-101-51/+51
| | | | | Similarly to VIR_STRDUP, we want the OOM error to be reported in VIR_ALLOC and friends.