| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=807751
*setPyVirTypedParameter
*libvirt_virDomainGetCPUStats
(cherry picked from commit 1aeb3d9e7f3a967f7d5e59f852e804aef0786f6c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=575160
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);
(cherry picked from commit a26a1969c37c865b18294c5717544c1dc90beb3c)
Conflicts:
src/qemu/qemu_monitor_json.c:
No SPICE_* events in RHEL && no __com.redhat_SPICE_* events
in upstream.
src/remote/remote_protocol.x
src/remote_protocol-structs:
No PM_WAKEUP PROC in RHEL tree
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=800366
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.
(cherry picked from commit a772f4eebc9e62870ac03dfaaac1102d0fa967b4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=770943
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>
(cherry picked from commit 558ebc256dc8179413b1f35d91cd5167e41633cb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=770944
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>
(cherry picked from commit 53b45aa494a94854862603f5694d137f928edfdd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
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>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770971
cherry-pick from 8b29c4598609d9b22a39e6f6bf3bf7afe8303faa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*libvirt_virDomainBlockStatsFlags
*libvirt_virDomainGetSchedulerParameters
*libvirt_virDomainGetSchedulerParametersFlags
*libvirt_virDomainSetSchedulerParameters
*libvirt_virDomainSetSchedulerParametersFlags
*libvirt_virDomainSetBlkioParameters
*libvirt_virDomainGetBlkioParameters
*libvirt_virDomainSetMemoryParameters
*libvirt_virDomainGetMemoryParameters
*libvirt_virDomainSetBlockIoTune
*libvirt_virDomainGetBlockIoTune
|
|
|
|
|
|
|
|
|
| |
*getPyVirTypedParameter
*setPyVirTypedParameter
*virDomainSetNumaParameters
*virDomainGetNumaParameters
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Two types of memory stats were not reported by python bindings. This
patch fixes both of them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/libvirt-override.c: remove the predefined array in the
virConnectListDomainsID binding and call virConnectNumOfDomains
to do a proper allocation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This patch adds binding for virNodeGetMemoryStats method of libvirtd.
Return value is represented as a python dictionary mapping field
names to values.
|
|
|
|
|
|
| |
This patch adds binding for virNodeGetCPUStats method of libvirtd.
Return value is represented as a python dictionary mapping field names
to values.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
If a disk source gets dropped because it is not accessible,
mgmt application might want to be informed about this. Therefore
we need to emit an event. The event presented in this patch
is however a bit superset of what written above. The reason is simple:
an intention to be easily expanded, e.g. on 'user ejected disk
in guest' events. Therefore, callback gets source string and disk alias
(which should be unique among a domain) and reason (an integer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous API addition allowed traversal up the hierarchy;
this one makes it easier to traverse down the hierarchy.
In the python bindings, virDomainSnapshotNumChildren can be
generated, but virDomainSnapshotListChildrenNames had to copy
from the hand-written example of virDomainSnapshotListNames.
* include/libvirt/libvirt.h.in (virDomainSnapshotNumChildren)
(virDomainSnapshotListChildrenNames): New prototypes.
(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS): New flag alias.
* src/libvirt.c (virDomainSnapshotNumChildren)
(virDomainSnapshotListChildrenNames): New functions.
* src/libvirt_public.syms: Export them.
* src/driver.h (virDrvDomainSnapshotNumChildren)
(virDrvDomainSnapshotListChildrenNames): New callbacks.
* python/generator.py (skip_impl, nameFixup): Update lists.
* python/libvirt-override-api.xml: Likewise.
* python/libvirt-override.c
(libvirt_virDomainSnapshotListChildrenNames): New wrapper function.
|
| |
|
|
|
|
|
|
|
|
|
| |
Includes impl of python binding since the generator was not
able to cope.
Note: Requires gendispatch.pl patch from Matthias Bolte
https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html
|
|
|
|
|
|
|
| |
Detected by Coverity; same analysis as for commit f73198df.
* python/libvirt-override.c (libvirt_virDomainGetVcpuPinInfo): Use
correct type.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
|
|
|
|
|
| |
We only want to raise the special value -2. -1 should return None
which tells the bindings to throw an exception.
|
|
|
|
| |
Otherwise things like volume upload are only useful with text data.
|
|
|
|
|
|
|
| |
This patch adds the Python bindings for virDomainGetVcpuPinInfo API.
* python/generator.py: add it to generator skip list
* python/libvirt-override-api.xml: provide an override description
* python/libvirt-override.c: provide an override binding implementation
|
|
|
|
|
|
|
| |
This patch adds the Python bindings for virDomainPinVcpuFlags API.
* python/generator.py: add it to the generator skip list
* python/libvirt-override-api.xml: provide override description
* python/libvirt-override.c: provide override bindings implementation
|
|
|
|
|
| |
This patch adds the Python bindings for
virDomainGetSchedulerParametersFlags API.
|
|
|
|
|
|
|
| |
This patch adds the Python bindings for
virDomainGetSchedulerParametersFlags API.
* python/libvirt-override-api.xml: provide and override description
* python/libvirt-override.c: implement the bindings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an operation started by virDomainBlockPull completes (either with
success or with failure), raise an event to indicate the final status.
This API allow users to avoid polling on virDomainGetBlockJobInfo if
they would prefer to use an event mechanism.
* daemon/remote.c: Dispatch events to client
* include/libvirt/libvirt.h.in: Define event ID and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle the new event
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block_stream completion and emit a libvirt block pull event
* src/remote/remote_driver.c: Receive and dispatch events to application
* src/remote/remote_protocol.x: Wire protocol definition for the event
* src/remote_protocol-structs: structure definitions for protocol verification
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
from QEMU monitor
|
|
|
|
|
|
|
|
|
| |
virDomainGetBlockJobInfo requires manual override since it returns a
custom type.
* python/generator.py: reenable bindings for this entry point
* python/libvirt-override-api.xml python/libvirt-override.c:
manual overrides
|
|
|
|
|
|
| |
* python/libvirt-override.c (libvirt_virConnectOpenAuth)
(libvirt_virDomainSnapshotListNames)
(libvirt_virDomainRevertToSnapshot): Change flags type.
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit d74b86f5d6ecae3d18a391f90a918fcac75914db.
Conflicts:
python/generator.py
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 12cd77a0c58a80179182f7d09e8e73f9f66b4677.
Conflicts:
python/libvirt-override-virConnect.py
python/libvirt-override.c
src/remote/remote_protocol.x
|
|
|
|
|
|
|
|
| |
These functions aren't intended to be called directly by users, so mark
them as private.
While we're at it, remove unneeded exception handling, and break some
long lines.
|
| |
|
|
|
|
|
|
|
| |
The return values for the python version are different that the C version
of virStreamSend: on success we return a string, an error raises an exception,
and if the stream would block we return int(-2). We need to do this
since strings aren't passed by reference in python.
|
|
|
|
|
| |
v2:
Don't generate virStreamFree
|
|
|
|
|
|
|
|
| |
In a couple instances we have to mark a debug variable as ATTRIBUTE_UNUSED
to avoid warnings.
v2:
Use #if 0 to comment out debug define
|
|
|
|
|
|
| |
The API can be used to query current state of an interface to VMM used
to control a domain. In QEMU world this translates into monitor
connection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an operation started by virDomainBlockPullAll completes (either with
success or with failure), raise an event to indicate the final status. This
allows an API user to avoid polling on virDomainBlockPullInfo if they would
prefer to use the event mechanism.
* daemon/remote.c: Dispatch events to client
* include/libvirt/libvirt.h.in: Define event ID and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle the new event
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block_stream completion and emit a libvirt block pull event
* src/remote/remote_driver.c: Receive and dispatch events to application
* src/remote/remote_protocol.x: Wire protocol definition for the event
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
from QEMU monitor
Signed-off-by: Adam Litke <agl@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
virDomainBlockPullAll and virDomainBlockPullAbort are handled automatically.
virDomainBlockPull and virDomainBlockPullInfo require manual overrides since
they return a custom type.
* python/generator.py: reenable bindings for this entry point
* python/libvirt-override-api.xml python/libvirt-override.c:
manual overrides
Signed-off-by: Adam Litke <agl@us.ibm.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
|