summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update the remote APIv0.10.0-rc1Marcelo Cerri2012-08-201-0/+1
| | | | | | | This patch updates libvirt's API to allow applications to inspect the full list of security labels of a domain. Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
* python: Don't generate bodies for close callback functionsv0.10.0-rc0CVE-2012-3445Peter Krempa2012-07-301-0/+2
| | | | | | | Commit 6ed5a1b9bd6240b8f2736790e48dd1c284c2e0e1 adds close callback functions to the public API but doesn't add python implementation. This patch sets the function to be written manually (to fix the build), but doesn't implement them yet.
* Define public API for receiving guest memory balloon eventsDaniel P. Berrange2012-07-142-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | When the guest changes its memory balloon applications may want to know what the new value is, without having to periodically poll on XML / domain info. Introduce a "balloon change" event to let apps see this * include/libvirt/libvirt.h.in: Define the virConnectDomainEventBalloonChangeCallback callback and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant * python/libvirt-override-virConnect.py, python/libvirt-override.c: Wire up helpers for new event * daemon/remote.c: Helper for serializing balloon event * examples/domain-events/events-c/event-test.c, examples/domain-events/events-python/event-test.py: Add example of balloon event usage * src/conf/domain_event.c, src/conf/domain_event.h: Handling of balloon events * src/remote/remote_driver.c: Add handler of balloon events * src/remote/remote_protocol.x: Define wire protocol for balloon events * src/remote_protocol-structs: Likewise. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* list: provide python bindings for snapshotsv0.9.13-rc2v0.9.13-rc1v0.9.13Eric Blake2012-06-195-2/+130
| | | | | | | | | | | | | | | | | This adds support for the new virDomainListAllSnapshots (a domain function) and virDomainSnapshotListAllChildren (a snapshot function) to the libvirt-python bindings. The implementation is done manually as the generator does not support wrapping lists of C pointers into python objects. * python/libvirt-override.c (libvirt_virDomainListAllSnapshots) (libvirt_virDomainSnapshotListAllChildren): New functions. * python/libvirt-override-api.xml: Document them. * python/libvirt-override-virDomain.py (listAllSnapshots): New file. * python/libvirt-override-virDomainSnapshot.py (listAllChildren): Likewise. * python/Makefile.am (CLASSES_EXTRA): Ship them.
* list: add virDomainListAllSnapshots APIEric Blake2012-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There was an inherent race between virDomainSnapshotNum() and virDomainSnapshotListNames(), where an additional snapshot could be created in the meantime, or where a snapshot could be deleted before converting the name back to a virDomainSnapshotPtr. It was also an awkward name: the function operates on domains, not domain snapshots. virDomainSnapshotListChildrenNames() suffered from the same inherent race, although its naming was nicer. This patch makes things nicer by grabbing a snapshot list atomically, in the format most useful to the user. * include/libvirt/libvirt.h.in (virDomainListAllSnapshots) (virDomainSnapshotListAllChildren): New declarations. * src/libvirt.c (virDomainSnapshotListNames) (virDomainSnapshotListChildrenNames): Add cross-references. (virDomainListAllSnapshots, virDomainSnapshotListAllChildren): New functions. * src/libvirt_public.syms (LIBVIRT_0.9.13): Export them. * src/driver.h (virDrvDomainListAllSnapshots) (virDrvDomainSnapshotListAllChildren): New callbacks. * python/generator.py (skip_function): Prepare for later hand-written versions.
* python: add API exports for virConnectListAllDomains()Peter Krempa2012-06-183-4/+70
| | | | | | | | | | | This patch adds export of the new API function virConnectListAllDomains() to the libvirt-python bindings. The virConnect object now has method "listAllDomains" that takes only the flags parameter and returns a python list of virDomain object corresponding to virDomainPtrs returned by the underlying api. The implementation is done manually as the generator does not support wrapping list of virDomainPtrs into virDomain objects.
* lib: Add public api to enable atomic listing of guestPeter Krempa2012-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new public api that lists domains. The new approach is different from those used before. There are key points to this: 1) The list is acquired atomically and contains both active and inactive domains (guests). This eliminates the need to call two different list APIs, where the state might change in between the calls. 2) The returned list consists of virDomainPtrs instead of names or ID's that have to be converted to virDomainPtrs anyways using separate calls for each one of them. This is more convenient and saves hypervisor calls. 3) The returned list is auto-allocated. This saves a lot of hassle for the users. 4) Built in support for filtering. The API call supports various filtering flags that modify the output list according to user needs. Available filter groups: Domain status: VIR_CONNECT_LIST_DOMAINS_ACTIVE, VIR_CONNECT_LIST_DOMAINS_INACTIVE Domain persistence: VIR_CONNECT_LIST_DOMAINS_PERSISTENT, VIR_CONNECT_LIST_DOMAINS_TRANSIENT Domain state: VIR_CONNECT_LIST_DOMAINS_RUNNING, VIR_CONNECT_LIST_DOMAINS_PAUSED, VIR_CONNECT_LIST_DOMAINS_SHUTOFF, VIR_CONNECT_LIST_DOMAINS_OTHER Existence of managed save image: VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE, VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE Auto-start option: VIR_CONNECT_LIST_DOMAINS_AUTOSTART, VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART Existence of snapshot: VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT, VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT 5) The python binding returns a list of domain objects that is very neat to work with. The only problem with this approach is no support from code generators so both RPC code and python bindings had to be written manually. *include/libvirt/libvirt.h.in: - add API prototype - clean up whitespace mistakes nearby *python/generator.py: - inhibit generation of the bindings for the new api *src/driver.h: - add driver prototype - clean up some whitespace mistakes nearby *src/libvirt.c: - add public implementation *src/libvirt_public.syms: - export the new symbol
* python: fix snapshot listing bugsEric Blake2012-06-121-17/+39
| | | | | | | | | Python exceptions are different than libvirt errors, and we had some corner case bugs on OOM situations. * python/libvirt-override.c (libvirt_virDomainSnapshotListNames) (libvirt_virDomainSnapshotListChildrenNames): Use correct error returns, avoid segv on OOM, and avoid memory leaks on error.
* python: use simpler methodsEric Blake2012-06-121-10/+4
| | | | | | * python/libvirt-override.c (libvirt_virDomainGetVcpus) (libvirt_virDomainGetVcpuPinInfo): Use Py_XDECREF instead of open-coding it.
* Coverity: Fix the forward_null error in Python binding codesv0.9.12-rc2v0.9.12Osier Yang2012-05-041-1/+1
| | | | | | | | | | | | Related coverity log: Error: FORWARD_NULL: /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:355: assign_zero: Assigning: "params" = 0. /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:458: var_deref_model: Passing null variable "params" to function "getPyVirTypedParameter", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
* python: Fix doc directory name for stable releasesv0.9.12-rc1Cole Robinson2012-04-272-2/+2
| | | | | | | | | | We were using the libvirt release version (like 0.9.11) and not the configure version (which for stable releases is 0.9.11.X) Most other places got this right so hopefully that's all the fallout from the version format change :) Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Fix compilation error on 32bitStefan Berger2012-04-101-0/+4
| | | | | | | | | | | Below code failed to compile on a 32 bit machine with error typewrappers.c: In function 'libvirt_intUnwrap': typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op] cc1: all warnings being treated as errors The patch fixes this error.
* python: improve conversion validationv0.9.11Eric Blake2012-03-311-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Laszlo Ersek pointed out that in trying to convert a long to an unsigned int, we used: long long_val = ...; if ((unsigned int)long_val == long_val) According to C99 integer promotion rules, the if statement is equivalent to: (unsigned long)(unsigned int)long_val == (unsigned long)long_val since you get an unsigned comparison if at least one side is unsigned, using the largest rank of the two sides; but on 32-bit platforms, where unsigned long and unsigned int are the same size, this comparison is always true and ends up converting negative long_val into posigive unsigned int values, rather than rejecting the negative value as we had originally intended (python longs are unbounded size, and we don't want to do silent modulo arithmetic when converting to C code). Fix this by using direct comparisons, rather than casting. * python/typewrappers.c (libvirt_intUnwrap, libvirt_uintUnwrap) (libvirt_ulongUnwrap, libvirt_ulonglongUnwrap): Fix conversion checks.
* python: make python APIs use these helper functionsv0.9.11-rc2Guannan Ren2012-03-282-71/+24
| | | | | *setPyVirTypedParameter *libvirt_virDomainGetCPUStats
* python: Add new helper functions for python to C integral conversionGuannan Ren2012-03-282-0/+141
| | | | | | | | | | | int libvirt_intUnwrap(PyObject *obj, int *val); int libvirt_uintUnwrap(PyObject *obj, unsigned int *val); int libvirt_longUnwrap(PyObject *obj, long *val); int libvirt_ulongUnwrap(PyObject *obj, unsigned long *val); int libvirt_longlongUnwrap(PyObject *obj, long long *val); int libvirt_ulonglongUnwrap(PyObject *obj, unsigned long long *val); int libvirt_doubleUnwrap(PyObject *obj, double *val); int libvirt_boolUnwrap(PyObject *obj, bool *val);
* Cleanup for a return statement in source filesMartin Kletzander2012-03-264-152/+152
| | | | | | | | | | | | | | | | | | | | | | Return statements with parameter enclosed in parentheses were modified and parentheses were removed. The whole change was scripted, here is how: List of files was obtained using this command: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' Found files were modified with this command: sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_' Then checked for nonsense. The whole command looks like this: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
* Add support for the suspend eventv0.9.11-rc1Osier Yang2012-03-232-0/+59
| | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event SUSPEND: VIR_DOMAIN_EVENT_ID_PMSUSPEND The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventSuspendCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0".
* Add support for the wakeup eventOsier Yang2012-03-232-0/+58
| | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event WAKEUP: VIR_DOMAIN_EVENT_ID_PMWAKEUP The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventWakeupCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0".
* Add support for event tray moved of removable disksOsier Yang2012-03-232-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new event type for the QMP event DEVICE_TRAY_MOVED, which occurs when the tray of a removable disk is moved (i.e opened or closed): VIR_DOMAIN_EVENT_ID_TRAY_CHANGE The event's data includes the device alias and the reason for tray status' changing, which indicates why the tray status was changed. Thus the callback definition for the event is: enum { VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0, VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE, \#ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST \#endif } virDomainEventTrayChangeReason; typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn, virDomainPtr dom, const char *devAlias, int reason, void *opaque);
* python: add virDomainGetCPUStats python binding APIGuannan Ren2012-03-223-1/+164
| | | | | | | | | | | dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 10870000000L, 'user_time': 950000000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L}, {'cpu_time': 5813545649L}] *generator.py Add a new naming rule *libvirt-override-api.xml The API function description *libvirt-override.c Implement it.
* python: Avoid memory leaks on libvirt_virNodeGetCPUStatsAlex Jia2012-03-221-10/+26
| | | | | | | | | | | | Detected by valgrind. Leaks are introduced in commit 4955602. * python/libvirt-override.c (libvirt_virNodeGetCPUStats): fix memory leaks and improve codes return value. For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770943 Signed-off-by: Alex Jia <ajia@redhat.com>
* python: Avoid memory leaks on libvirt_virNodeGetMemoryStatsAlex Jia2012-03-211-10/+26
| | | | | | | | | | | | Detected by valgrind. Leaks are introduced in commit 17c7795. * python/libvirt-override.c (libvirt_virNodeGetMemoryStats): fix memory leaks and improve codes return value. For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770944 Signed-off-by: Alex Jia <ajia@redhat.com>
* python: always include config.h firstEric Blake2012-03-201-1/+2
| | | | | | | | | | | | | | | | | On RHEL 5.7, I got this compilation failure: In file included from /usr/include/python2.4/pyport.h:98, from /usr/include/python2.4/Python.h:55, from libvirt.c:3: ../gnulib/lib/time.h:468: error: expected ';', ',' or ')' before '__timer' Turns out that our '#define restrict __restrict' from config.h wasn't being picked up. Gnulib _requires_ that all .c files include <config.h> first, otherwise the gnulib header overrides tend to misbehave. Problem introduced by patch c700613b8. * python/generator.py (buildStubs): Include <config.h> first.
* python: Expose virDomain{G,S}etInterfaceParameters APIs in python bindingAlex Jia2012-02-162-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v4 patch corrects indentation issues. The v3 patch follows latest python binding codes and change 'size' type from int to Py_ssize_t. An simple example to show how to use it: #!/usr/bin/env python import libvirt conn = libvirt.open(None) dom = conn.lookupByName('foo') print dom.interfaceParameters('vnet0', 0) params = {'outbound.peak': 10, 'inbound.peak': 10, 'inbound.burst': 20, 'inbound.average': 20, 'outbound.average': 30, 'outbound.burst': 30} print dom.setInterfaceParameters('vnet0', params, 0) print dom.interfaceParameters('vnet0', 0) Signed-off-by: Alex Jia <ajia@redhat.com>
* python: make other APIs share common {get, set}PyVirTypedParameterv0.9.10Guannan Ren2012-02-102-604/+304
| | | | | | | | | | | | | | *libvirt_virDomainBlockStatsFlags *libvirt_virDomainGetSchedulerParameters *libvirt_virDomainGetSchedulerParametersFlags *libvirt_virDomainSetSchedulerParameters *libvirt_virDomainSetSchedulerParametersFlags *libvirt_virDomainSetBlkioParameters *libvirt_virDomainGetBlkioParameters *libvirt_virDomainSetMemoryParameters *libvirt_virDomainGetMemoryParameters *libvirt_virDomainSetBlockIoTune *libvirt_virDomainGetBlockIoTune
* python: refactoring virTypedParameter conversion for NUMA tuning APIsGuannan Ren2012-02-092-0/+364
| | | | | | | | | *getPyVirTypedParameter *setPyVirTypedParameter *virDomainSetNumaParameters *virDomainGetNumaParameters Signed-off-by: Eric Blake <eblake@redhat.com>
* python: Correct arguments number for migrateSetMaxSpeedOsier Yang2012-02-091-2/+4
| | | | | | | | The API definition accepts "flags" argument, however, the implementation ignores it, though "flags" is unused currently, we should expose it instead of hard coding, the API implementation inside hypervisor driver is responsible to check if the passed "flags" is valid.
* python: drop unused functionv0.9.10-rc2Eric Blake2012-02-071-15/+1
| | | | | | Gcc warned about an unused static function. * python/libvirt-qemu-override.c (py_str): Delete.
* pyhton: Don't link against libvirt_util.laMichal Privoznik2012-02-071-2/+0
| | | | | | As we already link with libvirt.la which contains libvirt_utils.la. Double linking causes global symbols to be presented twice and thus confusion. This partially reverts c700613b8d463212d142c97108b7a2352e23e559
* maint: consolidate several .gitignore filesv0.9.10-rc1Eric Blake2012-02-031-13/+0
| | | | | | | | | | | | | | | | | | | | | | | Unlike .cvsignore under CVS, git allows for ignoring nested names. We weren't very consistent where new tests were being ignored (some in .gitignore, some in tests/.gitignore), and I found it easier to just consolidate everything. * .gitignore: Subsume entries from subdirectories. * daemon/.gitignore: Delete. * docs/.gitignore: Likewise. * docs/devhelp/.gitignore: Likewise. * docs/html/.gitignore: Likewise. * examples/dominfo/.gitignore: Likewise. * examples/domsuspend/.gitignore: Likewise. * examples/hellolibvirt/.gitignore: Likewise. * examples/openauth/.gitignore: Likewise. * examples/domain-events/events-c/.gitignore: Likewise. * include/libvirt/.gitignore: Likewise. * src/.gitignore: Likewise. * src/esx/.gitignore: Likewise. * tests/.gitignore: Likewise. * tools/.gitignore: Likewise.
* Added missing memory reporting into python bindingsMartin Kletzander2012-02-031-0/+6
| | | | | Two types of memory stats were not reported by python bindings. This patch fixes both of them.
* python: use libvirt_util to avoid raw freeEric Blake2012-02-034-199/+193
| | | | | | | | | | | | | | | | | | | | | | | This patch starts the process of elevating the python binding code to be on the same level as the rest of libvirt when it comes to requiring good coding styles. Statically linking against the libvirt_util library makes it much easier to write good code, rather than having to open-code and reinvent things locally. Done by global search and replace of s/free(/VIR_FREE(/, followed by hand-inspection of remaining malloc and redundant memset. * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation): Remove python from exemption. * python/Makefile.am (INCLUDES): Add gnulib and src/util. Drop $(top_builddir)/$(subdir), as automake already guarantees that. (mylibs, myqemulibs): Pull in libvirt_util and gnulib. (libvirtmod_la_CFLAGS): Catch compiler warnings if configured to use -Werror. * python/typewrappers.c (libvirt_charPtrSizeWrap) (libvirt_charPtrWrap): Convert free to VIR_FREE. * python/generator.py (print_function_wrapper): Likewise. * python/libvirt-override.c: Likewise.
* python: drop redundant functionEric Blake2012-02-033-16/+2
| | | | | | | | | I noticed some redundant code while preparing my next patch. * python/generator.py (py_types): Fix 'const char *' mapping. * python/typewrappers.h (libvirt_charPtrConstWrap): Drop. * python/typewrappers.c (libvirt_charPtrConstWrap): Delete, since it is identical to libvirt_constcharPtrWrap.
* build: clean up CPPFLAGS/INCLUDES usageEric Blake2012-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | Our syntax checker missed all-lower-case variables (this will be fixed by the next .gnulib update). Additionally, anywhere that we mix in-tree files with generated files, automake recommends listing builddir prior to srcdir for VPATH builds. * src/Makefile.am (*_la_CFLAGS): Favor $(top_srcdir). (INCLUDES): Likewise, and follow automake recommendations on builddir before srcdir. * python/Makefile.am (INCLUDES): Swap directory order. * tests/Makefile.am (INCLUDES): Likewise. * tools/Makefile.am (INCLUDES): Likewise. * daemon/Makefile.am (INCLUDES): Likewise. (libvirtd.init, libvirtd.service): Favor $(). * examples/hellolibvirt/Makefile.am (hellolibvirt_LDADD): Likewise. * examples/openauth/Makefile.am (openauth_LDADD): Likewise. * examples/dominfo/Makefile.am (INCLUDES): Drop dead include. * examples/domsuspend/Makefile.am (INCLUDES): Likewise.
* python: Add binding for virDomainGetDiskErrorsJiri Denemark2012-02-012-0/+60
|
* virDomainGetDiskErrors public APIJiri Denemark2012-02-011-1/+2
| | | | | | We already provide ways to detect when a domain has been paused as a result of I/O error, but there was no way of getting the exact error or even the device that experienced it. This new API may be used for both.
* python: correct a copy-paste errorAlex Jia2012-02-011-1/+1
| | | | | | * python/libvirt-override-virStream.py: fix a copy-paste error in sendAll(). Signed-off-by: Alex Jia <ajia@redhat.com>
* Add new public API virDomainGetCPUStats()KAMEZAWA Hiroyuki2012-01-281-0/+1
| | | | | | | | | | | | | | | | add new API virDomainGetCPUStats() for getting cpu accounting information per real cpus which is used by a domain. The API is designed to allow future extensions for additional statistics. based on ideas by Lai Jiangshan and Eric Blake. * src/libvirt_public.syms: add API for LIBVIRT_0.9.10 * src/libvirt.c: define virDomainGetCPUStats() * include/libvirt/libvirt.h.in: add virDomainGetCPUStats() header * src/driver.h: add driver API * python/generator.py: add python API (as not implemented) Signed-off-by: Eric Blake <eblake@redhat.com>
* resize: add virStorageVolResize() APIZeeshan Ali (Khattak)2012-01-271-0/+1
| | | | | | | | | | Add a new function to allow changing of capacity of storage volumes. Plan out several flags, even if not all of them will be implemented up front. Expose the new command via 'virsh vol-resize'. Signed-off-by: Eric Blake <eblake@redhat.com>
* API: make declaration of _LAST enum values conditionalEric Blake2012-01-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Although this is a public API break, it only affects users that were compiling against *_LAST values, and can be trivially worked around without impacting compilation against older headers, by the user defining VIR_ENUM_SENTINELS before using libvirt.h. It is not an ABI break, since enum values do not appear as .so entry points. Meanwhile, it prevents users from using non-stable enum values without explicitly acknowledging the risk of doing so. See this list discussion: https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html * include/libvirt/libvirt.h.in: Hide all sentinels behind LIBVIRT_ENUM_SENTINELS, and add missing sentinels. * src/internal.h (VIR_DEPRECATED): Allow inclusion after libvirt.h. (LIBVIRT_ENUM_SENTINELS): Expose sentinels internally. * daemon/libvirtd.h: Use the sentinels. * src/remote/remote_protocol.x (includes): Don't expose sentinels. * python/generator.py (enum): Likewise. * tests/cputest.c (cpuTestCompResStr): Silence compiler warning. * tools/virsh.c (vshDomainStateReasonToString) (vshDomainControlStateToString): Likewise.
* domiftune: Add API virDomain{S,G}etInterfaceParametersv0.9.9-rc2v0.9.9-rc1v0.9.9Hu Tao2011-12-291-0/+2
| | | | | | | | | | The APIs are used to set/get domain's network interface's parameters. Currently supported parameters are bandwidth settings. * include/libvirt/libvirt.h.in: new API and parameters definition * python/generator.py: skip the Python API generation * src/driver.h: add new entry to the driver structure * src/libvirt_public.syms: export symbols
* remove a static limit on max domains in python bindingsDaniel Veillard2011-12-291-4/+23
| | | | | | * python/libvirt-override.c: remove the predefined array in the virConnectListDomainsID binding and call virConnectNumOfDomains to do a proper allocation
* python: Fix problems of virDomain{Set, Get}BlockIoTune bindingsAlex Jia2011-12-292-4/+3
| | | | | | | | | | | | | | | | | | The parameter 'params' is useless for virDomainGetBlockIoTune API, and the return value type should be a virTypedParameterPtr but not integer. And "PyArg_ParseTuple" in functions libvirt_virDomain{Set,Get}BlockIoTune misses format unit for "format" argument. * libvirt-override-api.xml: Remove useless the parameter 'params' from virDomainGetBlockIoTune API, and change return value type from integer to virTypedParameterPtr. * python/libvirt-override.c: Add the missed format units. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770683 Signed-off-by: Alex Jia <ajia@redhat.com>
* add new API virDomain{G, S}etNumaParametersHu Tao2011-12-201-0/+2
| | | | | Set up the types for the numa functions and insert them into the virDriver structure definition.
* python: plug memory leak on libvirt_virConnectOpenAuthAlex Jia2011-12-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Detected by valgrind. Leak introduced in commit 5ab109f. * python/libvirt-override.c: avoid memory leak on libvirt_virConnectOpenAuth. * How to reproduce? % valgrind -v --leak-check=full virt-clone --print-xml Note: it can hit the issue although options are incomplete. * Actual valgrind result: ==1801== 12 bytes in 1 blocks are definitely lost in loss record 25 of 3,270 ==1801== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==1801== by 0xCF1F60E: libvirt_virConnectOpenAuth (libvirt-override.c:1507) ==1801== by 0x3AFEEDE7F3: PyEval_EvalFrameEx (ceval.c:3794) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880) ==1801== by 0x3AFEEE0466: PyEval_EvalCodeEx (ceval.c:3044) ==1801== by 0x3AFEEE0541: PyEval_EvalCode (ceval.c:545) ==1801== by 0x3AFEEFB88B: run_mod (pythonrun.c:1351) ==1801== by 0x3AFEEFB95F: PyRun_FileExFlags (pythonrun.c:1337) ==1801== by 0x3AFEEFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941) Signed-off-by: Alex Jia <ajia@redhat.com>
* python: Expose blockPeek and memoryPeek in Python bindingOsier Yang2011-12-153-0/+91
| | | | | | | | | | | | | | | | | | | | | | | A simple example to show how to use it: \#! /usr/bin/python import os import sys import libvirt disk = "/var/lib/libvirt/images/test.img" conn = libvirt.open(None) dom = conn.lookupByName('test') mem_contents = dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL); sys.stdout.write(mem_contents) % python test.py | hexdump 0000000 1660 0209 0000 0000 0000 0000 0000 0000 0000010 0000 0000 0000 0000 d3a0 01d0 0000 0000 0000020
* python: Fix export of virDomainSnapshotListChildrenNamesPeter Krempa2011-12-131-0/+1
| | | | | | | | Commit f2013c9dd1ce468b8620ee35c232a93ef7026fb0 added implementation of virDomainSnapshotListChildrenNames override export, but registration of the newly exported function was not added. *python/libvirt-override.c: - register export of function
* python: Expose binding for virNodeGetMemoryStats()v0.9.8Peter Krempa2011-12-052-0/+55
| | | | | | This patch adds binding for virNodeGetMemoryStats method of libvirtd. Return value is represented as a python dictionary mapping field names to values.
* python: Expose binding for virNodeGetCPUStats()Peter Krempa2011-12-052-0/+54
| | | | | | This patch adds binding for virNodeGetCPUStats method of libvirtd. Return value is represented as a python dictionary mapping field names to values.
* Support virDomain{Set, Get}BlockIoTune in the python APIv0.9.8-rc2v0.9.8-rc1Lei Li2011-11-303-3/+196
| | | | | | | | Python support for both setting and getting block I/O throttle. Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>