[libvirt] [PATCH v3] python: add virDomainGetCPUStats python binding API

2012-03-19 Thread Guannan Ren
dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 1087000L, 'user_time': 95000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L}, {'cpu_time': 5813545649L}] *generator.py Add a new

Re: [libvirt] [PATCH v2] python: add virDomainGetCPUStats python binding API

2012-03-19 Thread Guannan Ren
On 03/17/2012 01:42 AM, Eric Blake wrote: On 03/16/2012 11:26 AM, Eric Blake wrote: + +if (!nparams) { +if ((cpu = PyDict_New()) == NULL) { +error = NULL; Initialize error to NULL at the front, and you won't have to set it here. +goto

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Wen Congyang
At 03/18/2012 08:29 AM, Martin Kletzander Wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/util/conf.c b/src/util/conf.c index

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Martin Kletzander
On 03/19/2012 08:43 AM, Wen Congyang wrote: At 03/18/2012 08:29 AM, Martin Kletzander Wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

[libvirt] [PATCH v2] Fixed NULL pointer check

2012-03-19 Thread Martin Kletzander
This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/util/conf.c b/src/util/conf.c index 8ad60e0..3370337 100644 --- a/src/util/conf.c +++

Re: [libvirt] [PATCH v2] Fixed NULL pointer check

2012-03-19 Thread Michal Privoznik
On 19.03.2012 08:55, Martin Kletzander wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/util/conf.c b/src/util/conf.c index

Re: [libvirt] [PATCH v2] Fixed NULL pointer check

2012-03-19 Thread Peter Krempa
On 03/19/2012 10:38 AM, Michal Privoznik wrote: On 19.03.2012 08:55, Martin Kletzander wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

Re: [libvirt] [PATCH v2] Fixed NULL pointer check

2012-03-19 Thread Wen Congyang
At 03/19/2012 05:38 PM, Michal Privoznik Wrote: On 19.03.2012 08:55, Martin Kletzander wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

Re: [libvirt] [PATCH] snapshot: make quiesce a bit safer

2012-03-19 Thread Michal Privoznik
On 16.03.2012 21:49, Eric Blake wrote: If a guest is paused, we were silently ignoring the quiesce flag, which results in unclean snapshots, contrary to the intent of the flag. Since we can't quiesce without guest agent support, we should instead fail if the guest is not running.

[libvirt] [PATCH v3] Fixed NULL pointer check

2012-03-19 Thread Martin Kletzander
This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. It also reverts commit 59d0c9801c1ab that was checking for this value in one place. --- v3: - added revert of 59d0c9801c1ab that's not needed anymore - (comment) ATTRIBUTE_RETURN_CHECK not added as

Re: [libvirt] [PATCH] Add migration APIs for libxl driver

2012-03-19 Thread Daniel P. Berrange
On Fri, Mar 09, 2012 at 06:55:55PM +0800, Chunyan Liu wrote: diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index d5fa64a..5dc29a0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c +static int doParseURI(const char *uri, char **p_hostname, int *p_port) +{

Re: [libvirt] heisenbug in command.c

2012-03-19 Thread Daniel P. Berrange
On Fri, Mar 16, 2012 at 04:42:42PM -0500, Serge Hallyn wrote: On 03/16/2012 03:52 PM, Jim Paris wrote: Serge Hallyn wrote: On 03/16/2012 11:50 AM, Eric Blake wrote: On 03/16/2012 10:36 AM, Serge Hallyn wrote: Hi, It seems I've run into quite the heisenbug, reported at

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Daniel P. Berrange
On Mon, Mar 19, 2012 at 08:51:24AM +0100, Martin Kletzander wrote: On 03/19/2012 08:43 AM, Wen Congyang wrote: At 03/18/2012 08:29 AM, Martin Kletzander Wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. --- src/util/conf.c |5

Re: [libvirt] [PATCH v3] Fixed NULL pointer check

2012-03-19 Thread Daniel P. Berrange
On Mon, Mar 19, 2012 at 11:05:30AM +0100, Martin Kletzander wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. It also reverts commit 59d0c9801c1ab that was checking for this value in one place. --- v3: - added revert of 59d0c9801c1ab

Re: [libvirt] [PATCH v3] Fixed NULL pointer check

2012-03-19 Thread Michal Privoznik
On 19.03.2012 11:05, Martin Kletzander wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific configurations. It also reverts commit 59d0c9801c1ab that was checking for this value in one place. --- v3: - added revert of 59d0c9801c1ab that's not needed

Re: [libvirt] [PATCH 1/3] snapshot: add qemu capability for 'transaction' command

2012-03-19 Thread Peter Krempa
On 03/16/2012 11:05 PM, Eric Blake wrote: We need a capability bit to gracefully error out if some of the additions in future patches can't be implemented by the running qemu. * src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap. * src/qemu/qemu_capabilities.c (qemuCaps): Name it. *

Re: [libvirt] [PATCH 2/3] snapshot: add atomic create flag

2012-03-19 Thread Peter Krempa
On 03/16/2012 11:05 PM, Eric Blake wrote: Right now, it is appallingly easy to cause qemu disk snapshots to alter a domain then fail; for example, by requesting a two-disk snapshot where the second disk name resides on read-only storage. In this failure scenario, libvirt reports failure, but

Re: [libvirt] [PATCHv2 3/3] snapshot: rudimentary qemu support for atomic disk snapshot

2012-03-19 Thread Peter Krempa
On 03/17/2012 05:33 PM, Eric Blake wrote: Taking an external snapshot of just one disk is atomic, without having to pause and resume the VM. This also paves the way for later patches to interact with the new qemu 'transaction' monitor command. The various scenarios when requesting atomic are:

[libvirt] [PATCH] Cpu mapping cleanup

2012-03-19 Thread Martin Kletzander
Using inheritance, this patch cleans up the cpu_map.xml file and also sorts all CPU features according to the feature and registry values. Model features are sorted the same way as foeatures in the specification. Also few models that are related were organized together and parts of the XML are

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Martin Kletzander
On 03/19/2012 11:32 AM, Daniel P. Berrange wrote: On Mon, Mar 19, 2012 at 08:51:24AM +0100, Martin Kletzander wrote: On 03/19/2012 08:43 AM, Wen Congyang wrote: At 03/18/2012 08:29 AM, Martin Kletzander Wrote: This patch fixes a NULL pointer check that was causing SegFault on some specific

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Daniel P. Berrange
On Mon, Mar 19, 2012 at 01:38:47PM +0100, Martin Kletzander wrote: On 03/19/2012 11:32 AM, Daniel P. Berrange wrote: On Mon, Mar 19, 2012 at 08:51:24AM +0100, Martin Kletzander wrote: On 03/19/2012 08:43 AM, Wen Congyang wrote: At 03/18/2012 08:29 AM, Martin Kletzander Wrote: This patch

Re: [libvirt] [PATCHv2 4/3] snapshot: make offline qemu snapshots atomic

2012-03-19 Thread Peter Krempa
On 03/17/2012 05:33 PM, Eric Blake wrote: Offline internal snapshots can be rolled back with just a little bit of refactoring, meaning that we are now automatically atomic. * src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Move guts... (qemuDomainSnapshotForEachQcow2Raw): ...to new

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Eric Blake
On 03/19/2012 06:43 AM, Daniel P. Berrange wrote: That is a historical remant. Do feel free to send another followup patch to cleanup all the cases of 'return(NULL)' as well. Daniel Did you mean in that file or globally? Because I just tried the first thing that came to my mind and look at

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Martin Kletzander
On 03/19/2012 04:43 PM, Eric Blake wrote: On 03/19/2012 06:43 AM, Daniel P. Berrange wrote: [...] since the open '(' lets the rest of the code indent nicely when using default emacs indentation. But it's still pretty easy to recognize the difference between complex returns and the real

Re: [libvirt] [PATCH] Fixed NULL pointer check

2012-03-19 Thread Daniel P. Berrange
On Mon, Mar 19, 2012 at 09:43:26AM -0600, Eric Blake wrote: On 03/19/2012 06:43 AM, Daniel P. Berrange wrote: That is a historical remant. Do feel free to send another followup patch to cleanup all the cases of 'return(NULL)' as well. Daniel Did you mean in that file or globally?

Re: [libvirt] [PATCHv3] python: Avoid memory leaks on libvirt_virNodeGetMemoryStats

2012-03-19 Thread Michal Privoznik
On 17.02.2012 09:15, a...@redhat.com wrote: From: Alex Jia a...@redhat.com 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

[libvirt] [PATCH 2/5] qemu: Avoid dangling migration-in job on shutoff domains

2012-03-19 Thread Jiri Denemark
Destination daemon should not rely on the client or source daemon (depending on the type of migration) to call Finish when migration fails, because the client may crash before it can do so. The domain prepared for incoming migration is set to be destroyed (and migration job cleaned up) when

[libvirt] [PATCH 4/5] qemu: Make autodestroy utilize connection close callbacks

2012-03-19 Thread Jiri Denemark
--- src/qemu/qemu_conf.h|5 -- src/qemu/qemu_driver.c |5 -- src/qemu/qemu_process.c | 107 ++ 3 files changed, 24 insertions(+), 93 deletions(-) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index a22ce0c..3306014 100644 ---

[libvirt] [PATCH 1/5] qemu: Add support for domain cleanup callbacks

2012-03-19 Thread Jiri Denemark
Add support for registering cleanup callbacks to be run when a domain transitions to shutoff state. --- src/qemu/qemu_domain.c | 73 +++ src/qemu/qemu_domain.h | 15 + src/qemu/qemu_process.c |2 + 3 files changed, 90 insertions(+), 0

[libvirt] [PATCH 0/5] Make migration more robust when client dies

2012-03-19 Thread Jiri Denemark
Libvirt daemon was not completely ready to lose a connection to the client (may even be source libvirtd) which is controling the migration. We might end up with dangling migration jobs on both source and destination daemons. More details about the scenarios this might happen can be found in

[libvirt] [PATCH 5/5] qemu: Avoid dangling migration-out job when client dies

2012-03-19 Thread Jiri Denemark
When a client which started non-p2p migration dies in a bad time, the source libvirtd never clears the migration job and almost nothing can be done with the domain without restarting the daemon. This patch makes use of connection close callbacks and ensures that migration job is properly discarded

[libvirt] [PATCH 3/5] qemu: Add connection close callbacks

2012-03-19 Thread Jiri Denemark
Add support for registering arbitrary callback to be called for a domain when a connection gets closed. --- src/qemu/qemu_conf.c | 172 src/qemu/qemu_conf.h | 27 src/qemu/qemu_driver.c |5 ++ 3 files changed, 204 insertions(+),

Re: [libvirt] [PATCHv3] python: Avoid memory leaks on libvirt_virNodeGetMemoryStats

2012-03-19 Thread Eric Blake
On 02/17/2012 01:15 AM, a...@redhat.com wrote: From: Alex Jia a...@redhat.com 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

Re: [libvirt] [PATCH] Cpu mapping cleanup

2012-03-19 Thread Eric Blake
On 03/19/2012 06:29 AM, Martin Kletzander wrote: Using inheritance, this patch cleans up the cpu_map.xml file and also sorts all CPU features according to the feature and registry values. Model features are sorted the same way as foeatures in the s/foeatures/features/ specification. Also

Re: [libvirt] [PATCH] snapshot: make quiesce a bit safer

2012-03-19 Thread Eric Blake
On 03/19/2012 04:04 AM, Michal Privoznik wrote: On 16.03.2012 21:49, Eric Blake wrote: If a guest is paused, we were silently ignoring the quiesce flag, which results in unclean snapshots, contrary to the intent of the flag. Since we can't quiesce without guest agent support, we should

[libvirt] [PATCH] conf: return immediately on error in dhcp host element

2012-03-19 Thread Laine Stump
If and error was encountered parsing a dhcp host entry mac address or name, parsing would continue and log a less descriptive error that might make it more difficult to notice the true nature of the problem. This patch returns immediately on logging the first error. --- src/conf/network_conf.c |

[libvirt] [PATCH] conf: forbid use of multicast mac addresses

2012-03-19 Thread Laine Stump
A few times libvirt users manually setting mac addresses have complained of networking failure that ends up being due to a multicast mac address being used for a guest interface. This patch prevents that by loggin an error and failing if a multicast mac address is encountered in each of the three

Re: [libvirt] [PATCH v2] python: add virDomainGetCPUStats python binding API

2012-03-19 Thread Eric Blake
On 03/18/2012 04:41 AM, Guannan Ren wrote: +if (totalbool == Py_False) { Per other code in libvirt-override.c, you can't compare totalbool (type PyObject) with Py_False, at least not on all compilers. You need something like this instead: /* Hack - Python's definition of

Re: [libvirt] [PATCH] conf: return immediately on error in dhcp host element

2012-03-19 Thread Eric Blake
On 03/19/2012 11:32 AM, Laine Stump wrote: If and error was encountered parsing a dhcp host entry mac address or name, parsing would continue and log a less descriptive error that might make it more difficult to notice the true nature of the problem. This patch returns immediately on logging

[libvirt] [PATCH] python: make virDomainSetSchedulerParameters accpet integer argument

2012-03-19 Thread Guannan Ren
When sending a Python integer as an argument to PyLong_AsUnsignedLong or PyLong_AsUnsignedLongLong, the following error occurs SystemError: Objects/longobject.c:980: bad argument to internal function This error comes from the fact that PyLong_AsUnsignedLong and

Re: [libvirt] [PATCH] python: make virDomainSetSchedulerParameters accpet integer argument

2012-03-19 Thread Eric Blake
On 03/19/2012 11:45 AM, Guannan Ren wrote: When sending a Python integer as an argument to PyLong_AsUnsignedLong or PyLong_AsUnsignedLongLong, the following error occurs SystemError: Objects/longobject.c:980: bad argument to internal function +++

Re: [libvirt] [PATCH] python: make virDomainSetSchedulerParameters accpet integer argument

2012-03-19 Thread Eric Blake
On 03/19/2012 12:03 PM, Eric Blake wrote: Why are you doing this for just VIR_TYPED_PARAM_ULLONG? I argue that we should be doing it for all of the integral conversions. In fact, I'd argue that we want new helper functions in typewrappers.c, as counterparts to our libvirt_intWrap() and

Re: [libvirt] [PATCH] Cpu mapping cleanup

2012-03-19 Thread Martin Kletzander
On 03/19/2012 06:10 PM, Eric Blake wrote: On 03/19/2012 06:29 AM, Martin Kletzander wrote: Using inheritance, this patch cleans up the cpu_map.xml file and also sorts all CPU features according to the feature and registry values. Model features are sorted the same way as foeatures in the

[libvirt] [PATCHv2] conf: return immediately on error in dhcp host element

2012-03-19 Thread Laine Stump
If an error was encountered parsing a dhcp host entry mac address or name, parsing would continue and log a less descriptive error that might make it more difficult to notice the true nature of the problem. This patch returns immediately on logging the first error. --- src/conf/network_conf.c |

Re: [libvirt] [PATCHv2] conf: return immediately on error in dhcp host element

2012-03-19 Thread Eric Blake
On 03/19/2012 12:46 PM, Laine Stump wrote: If an error was encountered parsing a dhcp host entry mac address or name, parsing would continue and log a less descriptive error that might make it more difficult to notice the true nature of the problem. This patch returns immediately on logging

Re: [libvirt] [PATCH v3] python: add virDomainGetCPUStats python binding API

2012-03-19 Thread Eric Blake
On 03/19/2012 12:27 AM, Guannan Ren wrote: dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 1087000L, 'user_time': 95000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L},

Re: [libvirt] [PATCHv2 3/3] snapshot: rudimentary qemu support for atomic disk snapshot

2012-03-19 Thread Eric Blake
On 03/19/2012 06:20 AM, Peter Krempa wrote: On 03/17/2012 05:33 PM, Eric Blake wrote: Taking an external snapshot of just one disk is atomic, without having to pause and resume the VM. This also paves the way for later patches to interact with the new qemu 'transaction' monitor command.

Re: [libvirt] [PATCHv2 4/3] snapshot: make offline qemu snapshots atomic

2012-03-19 Thread Eric Blake
On 03/19/2012 07:40 AM, Peter Krempa wrote: On 03/17/2012 05:33 PM, Eric Blake wrote: Offline internal snapshots can be rolled back with just a little bit of refactoring, meaning that we are now automatically atomic. * src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Move guts...

[libvirt] [PATCH] Minor docs fix

2012-03-19 Thread Martin Kletzander
End tag for host element was missing in example configuration --- docs/formatnetwork.html.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in index 907c046..7e8e991 100644 --- a/docs/formatnetwork.html.in +++

Re: [libvirt] [PATCHv2] conf: return immediately on error in dhcp host element

2012-03-19 Thread Laine Stump
On 03/19/2012 03:49 PM, Eric Blake wrote: On 03/19/2012 12:46 PM, Laine Stump wrote: If an error was encountered parsing a dhcp host entry mac address or name, parsing would continue and log a less descriptive error that might make it more difficult to notice the true nature of the problem.

Re: [libvirt] [PATCH] Minor docs fix

2012-03-19 Thread Laine Stump
On 03/19/2012 05:52 PM, Martin Kletzander wrote: End tag for host element was missing in example configuration --- docs/formatnetwork.html.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in index

Re: [libvirt] [PATCH] conf: forbid use of multicast mac addresses

2012-03-19 Thread Laine Stump
On 03/19/2012 01:46 PM, Eric Blake wrote: On 03/19/2012 11:32 AM, Laine Stump wrote: A few times libvirt users manually setting mac addresses have complained of networking failure that ends up being due to a multicast mac address being used for a guest interface. This patch prevents that by

Re: [libvirt] [PATCH 0/11 v2] Add supports for three new QMP events

2012-03-19 Thread Osier Yang
ping. On 03/14/2012 11:26 PM, Osier Yang wrote: v1 ~ v2: * Two more patches, [5/11] to prohibit tray='open' for block type disk. And [9/11] to introduce a new domain state 'pmsuspended' * Definition (including name) for DEVICE_TRAY_MOVED event is changed into:

[libvirt] [PATCH v4] python: add virDomainGetCPUStats python binding API

2012-03-19 Thread Guannan Ren
dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 1087000L, 'user_time': 95000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L}, {'cpu_time': 5813545649L}] *generator.py Add a new

[libvirt] sysctl variables, FreeBSD

2012-03-19 Thread Jason Helfman
Is there a method that can be used to remove the sysctl tuning for FreeBSD in the pipeline? Here are the current patches I have, but would like to remove: http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/libvirt/files/ Thanks! Jason -- libvir-list mailing list libvir-list@redhat.com