<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libvirt-python-v6.git, branch libvirt-0.9.10-19.el6</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/'/>
<entry>
<title>python: Fix the forward_null error in Python binding codes</title>
<updated>2012-05-09T02:04:14+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-05-07T11:02:12+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=b2c9179933763453a0f7848b136c12e5bd7ec0a9'/>
<id>b2c9179933763453a0f7848b136c12e5bd7ec0a9</id>
<content type='text'>
This patch resolves: https://bugzilla.redhat.com/show_bug.cgi?id=771021
(cherry picked from commit b80f4db9931ceea4bec1d178322058df77ece7a4)

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.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch resolves: https://bugzilla.redhat.com/show_bug.cgi?id=771021
(cherry picked from commit b80f4db9931ceea4bec1d178322058df77ece7a4)

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.)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: improve conversion validation</title>
<updated>2012-04-05T03:37:51+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2012-03-31T15:45:48+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=410cb3c0e8a7e6d6db41a83b186ba2b2483822cf'/>
<id>410cb3c0e8a7e6d6db41a83b186ba2b2483822cf</id>
<content type='text'>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

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.
(cherry picked from commit 4a86c2bb4b2d8183b76ba44659bb6d2eab1f1573)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

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.
(cherry picked from commit 4a86c2bb4b2d8183b76ba44659bb6d2eab1f1573)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: make python APIs use these helper functions</title>
<updated>2012-04-05T03:37:47+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-28T15:41:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=0354f6de747e8e2968cb28374f2488cd1a1b3aeb'/>
<id>0354f6de747e8e2968cb28374f2488cd1a1b3aeb</id>
<content type='text'>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

    *setPyVirTypedParameter
    *libvirt_virDomainGetCPUStats
(cherry picked from commit 1aeb3d9e7f3a967f7d5e59f852e804aef0786f6c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

    *setPyVirTypedParameter
    *libvirt_virDomainGetCPUStats
(cherry picked from commit 1aeb3d9e7f3a967f7d5e59f852e804aef0786f6c)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Add new helper functions for python to C integral conversion</title>
<updated>2012-04-05T03:37:43+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-28T15:41:04+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=804d6c4cf70f1884902f5cf3f9273e3e68c5ed7d'/>
<id>804d6c4cf70f1884902f5cf3f9273e3e68c5ed7d</id>
<content type='text'>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

    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);
(cherry picked from commit 384ebd3fc5deec035d6894352a25fd2b7f637cf0)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.redhat.com/show_bug.cgi?id=807751

    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);
(cherry picked from commit 384ebd3fc5deec035d6894352a25fd2b7f637cf0)
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for event tray moved of removable disks</title>
<updated>2012-03-26T06:07:06+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-03-26T04:12:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=058d05bb617cb48b21967e4c57e8a3d09ddc75e0'/>
<id>058d05bb617cb48b21967e4c57e8a3d09ddc75e0</id>
<content type='text'>
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 &amp;&amp; no __com.redhat_SPICE_* events
          in upstream.
	src/remote/remote_protocol.x
	src/remote_protocol-structs:
          No PM_WAKEUP PROC in RHEL tree
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &amp;&amp; no __com.redhat_SPICE_* events
          in upstream.
	src/remote/remote_protocol.x
	src/remote_protocol-structs:
          No PM_WAKEUP PROC in RHEL tree
</pre>
</div>
</content>
</entry>
<entry>
<title>python: add virDomainGetCPUStats python binding API</title>
<updated>2012-03-26T05:52:51+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-22T17:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=a333d94eb3b2135c1cf9129b2e5a9aa5307b9882'/>
<id>a333d94eb3b2135c1cf9129b2e5a9aa5307b9882</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Avoid memory leaks on libvirt_virNodeGetCPUStats</title>
<updated>2012-03-22T12:15:00+00:00</updated>
<author>
<name>Alex Jia</name>
<email>ajia@redhat.com</email>
</author>
<published>2012-03-22T08:54:03+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=f14ce3e4bdae296653d3ebc03ba65f35d3120676'/>
<id>f14ce3e4bdae296653d3ebc03ba65f35d3120676</id>
<content type='text'>
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 &lt;ajia@redhat.com&gt;
(cherry picked from commit 558ebc256dc8179413b1f35d91cd5167e41633cb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;ajia@redhat.com&gt;
(cherry picked from commit 558ebc256dc8179413b1f35d91cd5167e41633cb)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Avoid memory leaks on libvirt_virNodeGetMemoryStats</title>
<updated>2012-03-22T12:07:34+00:00</updated>
<author>
<name>Alex Jia</name>
<email>ajia@redhat.com</email>
</author>
<published>2012-03-21T16:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=7f39fff4c0ae96e8afa02ad50fa30d325a417c7a'/>
<id>7f39fff4c0ae96e8afa02ad50fa30d325a417c7a</id>
<content type='text'>
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 &lt;ajia@redhat.com&gt;
(cherry picked from commit 53b45aa494a94854862603f5694d137f928edfdd)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;ajia@redhat.com&gt;
(cherry picked from commit 53b45aa494a94854862603f5694d137f928edfdd)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Expose virDomain{G,S}etInterfaceParameters APIs in python binding</title>
<updated>2012-02-21T08:32:33+00:00</updated>
<author>
<name>Alex Jia</name>
<email>ajia@redhat.com</email>
</author>
<published>2012-02-14T02:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=988a7213942b521a8db7aed6233190f401242d8a'/>
<id>988a7213942b521a8db7aed6233190f401242d8a</id>
<content type='text'>
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 &lt;ajia@redhat.com&gt;

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770971
cherry-pick from 8b29c4598609d9b22a39e6f6bf3bf7afe8303faa
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;ajia@redhat.com&gt;

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770971
cherry-pick from 8b29c4598609d9b22a39e6f6bf3bf7afe8303faa
</pre>
</div>
</content>
</entry>
<entry>
<title>python: make other APIs share common {get, set}PyVirTypedParameter</title>
<updated>2012-02-11T00:17:18+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-02-10T10:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=e8fe5e59e246fb1ed396cc737657ee4e9d752ef3'/>
<id>e8fe5e59e246fb1ed396cc737657ee4e9d752ef3</id>
<content type='text'>
        *libvirt_virDomainBlockStatsFlags
        *libvirt_virDomainGetSchedulerParameters
        *libvirt_virDomainGetSchedulerParametersFlags
        *libvirt_virDomainSetSchedulerParameters
        *libvirt_virDomainSetSchedulerParametersFlags
        *libvirt_virDomainSetBlkioParameters
        *libvirt_virDomainGetBlkioParameters
        *libvirt_virDomainSetMemoryParameters
        *libvirt_virDomainGetMemoryParameters
        *libvirt_virDomainSetBlockIoTune
        *libvirt_virDomainGetBlockIoTune
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
        *libvirt_virDomainBlockStatsFlags
        *libvirt_virDomainGetSchedulerParameters
        *libvirt_virDomainGetSchedulerParametersFlags
        *libvirt_virDomainSetSchedulerParameters
        *libvirt_virDomainSetSchedulerParametersFlags
        *libvirt_virDomainSetBlkioParameters
        *libvirt_virDomainGetBlkioParameters
        *libvirt_virDomainSetMemoryParameters
        *libvirt_virDomainGetMemoryParameters
        *libvirt_virDomainSetBlockIoTune
        *libvirt_virDomainGetBlockIoTune
</pre>
</div>
</content>
</entry>
</feed>
