<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libvirt-python-v6.git, branch v0.9.11.2</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>Fix compilation error on 32bit</title>
<updated>2012-04-16T11:40:44+00:00</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.vnet.ibm.com</email>
</author>
<published>2012-04-10T10:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=aa898432f174e90b9039d93befe2fd3faa43f1a5'/>
<id>aa898432f174e90b9039d93befe2fd3faa43f1a5</id>
<content type='text'>
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.

(cherry picked from commit 4e9bb1dffdf456282b69ab077288c9bf875b8afa)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.

(cherry picked from commit 4e9bb1dffdf456282b69ab077288c9bf875b8afa)
</pre>
</div>
</content>
</entry>
<entry>
<title>python: improve conversion validation</title>
<updated>2012-03-31T15:16:00+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2012-03-30T18:03:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=8228a55140f0dac5ddb1e4d78dc899d428e1e07b'/>
<id>8228a55140f0dac5ddb1e4d78dc899d428e1e07b</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>python: make python APIs use these helper functions</title>
<updated>2012-03-28T14:54:06+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-27T06:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=e967d582f973a4f37db1526f5e455ea643294740'/>
<id>e967d582f973a4f37db1526f5e455ea643294740</id>
<content type='text'>
    *setPyVirTypedParameter
    *libvirt_virDomainGetCPUStats
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    *setPyVirTypedParameter
    *libvirt_virDomainGetCPUStats
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Add new helper functions for python to C integral conversion</title>
<updated>2012-03-28T14:42:40+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-27T06:06:10+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=db3debebf058b47328df47137b505e80b4adca08'/>
<id>db3debebf058b47328df47137b505e80b4adca08</id>
<content type='text'>
    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);
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    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);
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup for a return statement in source files</title>
<updated>2012-03-26T20:45:22+00:00</updated>
<author>
<name>Martin Kletzander</name>
<email>mkletzan@redhat.com</email>
</author>
<published>2012-03-22T11:33:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=a8e031a749d4e67a27cb2004b7c50f0456ecc401'/>
<id>a8e031a749d4e67a27cb2004b7c50f0456ecc401</id>
<content type='text'>
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 '\&lt;return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
grep -e '\.[ch]$' -e '\.py$'

Found files were modified with this command:
sed -i -e                                                                 \
's_^\(.*\&lt;return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\&lt;return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'

Then checked for nonsense.

The whole command looks like this:
git grep -l -e '\&lt;return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
's_^\(.*\&lt;return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\&lt;return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 '\&lt;return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
grep -e '\.[ch]$' -e '\.py$'

Found files were modified with this command:
sed -i -e                                                                 \
's_^\(.*\&lt;return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\&lt;return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'

Then checked for nonsense.

The whole command looks like this:
git grep -l -e '\&lt;return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
's_^\(.*\&lt;return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\&lt;return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for the suspend event</title>
<updated>2012-03-23T15:12:18+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-03-23T14:50:36+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=dc2f75d35a6461c896a738d092dc973067d0dbd4'/>
<id>dc2f75d35a6461c896a738d092dc973067d0dbd4</id>
<content type='text'>
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".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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".
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for the wakeup event</title>
<updated>2012-03-23T15:12:14+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-03-23T14:43:14+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=29b16a45d77586672631537bfe877455fa5527ac'/>
<id>29b16a45d77586672631537bfe877455fa5527ac</id>
<content type='text'>
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".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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".
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for event tray moved of removable disks</title>
<updated>2012-03-23T15:10:26+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-03-23T13:44:50+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=4b6a7b3fce2e30e600db5bee484badfe25f8e3f2'/>
<id>4b6a7b3fce2e30e600db5bee484badfe25f8e3f2</id>
<content type='text'>
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);
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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);
</pre>
</div>
</content>
</entry>
<entry>
<title>python: add virDomainGetCPUStats python binding API</title>
<updated>2012-03-22T14:55:48+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2012-03-20T04:34:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=65ef8171496537b49fcdd0a5b833d61a8ad23351'/>
<id>65ef8171496537b49fcdd0a5b833d61a8ad23351</id>
<content type='text'>
    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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    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.
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Avoid memory leaks on libvirt_virNodeGetCPUStats</title>
<updated>2012-03-22T02:19:13+00:00</updated>
<author>
<name>Alex Jia</name>
<email>ajia@redhat.com</email>
</author>
<published>2012-03-21T16:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/berrange/public_git/libvirt-python-v6.git/commit/?id=debe58f6f7609abcb330b5ab4f69f7ffab830b08'/>
<id>debe58f6f7609abcb330b5ab4f69f7ffab830b08</id>
<content type='text'>
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;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
