Re: [libvirt] virsh bash completion file

2011-10-06 Thread Daniel P. Berrange
On Wed, Oct 05, 2011 at 03:17:47PM -0500, Serge E. Hallyn wrote: Hi, I've been trying out a bash autocompletion file by Geoff Low (slight hack by me, don't blame him for my hack), and it's working pretty nicely. I'm not sure where to put it in the git tree, but it seems like it'd be nice to

Re: [libvirt] virsh bash completion file

2011-10-06 Thread Daniel P. Berrange
On Wed, Oct 05, 2011 at 02:33:44PM -0600, Eric Blake wrote: On 10/05/2011 02:17 PM, Serge E. Hallyn wrote: Hi, I've been trying out a bash autocompletion file by Geoff Low (slight hack by me, don't blame him for my hack), and it's working pretty nicely. I'm not sure where to put it in the

[libvirt] [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty

2011-10-06 Thread Guido Günther
O.k. to apply? -- Guido --- src/xenxs/xen_xm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index d057043..30188e2 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -697,8 +697,8 @@ xenParseXM(virConfPtr conf,

[libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Guido Günther
otherwise a missing UUID in a domain config just shows: libxlDomainXMLFromNative:2600 : Internal Error parsing xm config failed Now we have: xenXMConfigGetUUID:186 : Internal Error config value uuid was missing O.k. to apply? -- Guido --- src/xenxs/xen_xm.c | 37

[libvirt] [PATCH] Fix deadlock when the RPC program is unknown

2011-10-06 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Commit 597fe3cee68f561a181967b59a87b4e5c5880c4c accidentally introduced a deadlock when reporting an unknown RPC program. The virNetServerDispatchNewMessage method is called with the client locked, and must therefore not attempt to send any RPC

Re: [libvirt] [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty

2011-10-06 Thread Michal Privoznik
On 06.10.2011 11:16, Guido Günther wrote: O.k. to apply? -- Guido --- src/xenxs/xen_xm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index d057043..30188e2 100644 --- a/src/xenxs/xen_xm.c +++

[libvirt] [PATCH] Don't send back unknown program errors for async messages

2011-10-06 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If we send back an unknown program error for async messages, we will confuse the client because they only expect replies for method calls. Just log drop any invalid async messages * src/rpc/virnetserver.c: Don't send error for async messages ---

[libvirt] [PATCH] Make saving domain XML more robust

2011-10-06 Thread Jiri Denemark
When saving domain XML (either config or status) we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the process more robust by writing the new content into a separate file and only if that

Re: [libvirt] [PATCH] Make saving domain XML more robust

2011-10-06 Thread Daniel P. Berrange
On Thu, Oct 06, 2011 at 12:22:01PM +0200, Jiri Denemark wrote: When saving domain XML (either config or status) we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the process more

Re: [libvirt] [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 11:56:29AM +0200, Michal Privoznik wrote: On 06.10.2011 11:16, Guido Günther wrote: O.k. to apply? -- Guido --- src/xenxs/xen_xm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c

[libvirt] [PATCH] Document STR(N)EQ_NULLABLE (was Re: [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty)

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 11:56:29AM +0200, Michal Privoznik wrote: On 06.10.2011 11:16, Guido Günther wrote: O.k. to apply? -- Guido --- src/xenxs/xen_xm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c

[libvirt] [PATCH] Fail gracefully when hashtables are NULL

2011-10-06 Thread Marc-André Lureau
Instead of the message: GLib-CRITICAL **: g_hash_table_get_values: assertion `hash_table != NULL' failed --- libvirt-gobject/libvirt-gobject-connection.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-connection.c

Re: [libvirt] [PATCH v2 03/12] Introduce two public APIs for keepalive protocol

2011-10-06 Thread Jiri Denemark
On Mon, Oct 03, 2011 at 10:42:30 +0100, Daniel P. Berrange wrote: On Mon, Oct 03, 2011 at 10:26:30AM +0100, Daniel P. Berrange wrote: On Fri, Sep 23, 2011 at 10:24:48AM +0200, Jiri Denemark wrote: This introduces virConnectAllowKeepAlive and virConnectStartKeepAlive public APIs which can

Re: [libvirt] virsh bash completion file

2011-10-06 Thread Serge E. Hallyn
Quoting Daniel P. Berrange (berra...@redhat.com): On Wed, Oct 05, 2011 at 03:17:47PM -0500, Serge E. Hallyn wrote: Hi, I've been trying out a bash autocompletion file by Geoff Low (slight hack by me, don't blame him for my hack), and it's working pretty nicely. I'm not sure where to

[libvirt] [PATCH] remote_driver: Avoid double free in EventControl building

2011-10-06 Thread Michal Privoznik
Don't xdr_free event data as they are freed by our caller virNetClientProgramDispatch. --- src/remote/remote_driver.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 83f4f3c..2b2f41e 100644 ---

Re: [libvirt] [PATCH] Fix deadlock when the RPC program is unknown

2011-10-06 Thread Michal Privoznik
On 06.10.2011 11:43, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Commit 597fe3cee68f561a181967b59a87b4e5c5880c4c accidentally introduced a deadlock when reporting an unknown RPC program. The virNetServerDispatchNewMessage method is called with the client locked,

Re: [libvirt] [PATCH] Don't send back unknown program errors for async messages

2011-10-06 Thread Eric Blake
On 10/06/2011 04:10 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com If we send back an unknown program error for async messages, we will confuse the client because they only expect replies for method calls. Just log drop any invalid async messages *

Re: [libvirt] [PATCH] Document STR(N)EQ_NULLABLE (was Re: [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty)

2011-10-06 Thread Eric Blake
On 10/06/2011 05:38 AM, Guido Günther wrote: ...and here's the doc update. -- Guido 0001-Document-STREQ_NULLABLE-and-STRNEQ_NULLABLE.patch From 07b8940e3bb64e2208b191d890e95f059a7ac7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?=a...@sigxcpu.org Date: Thu, 6 Oct 2011

Re: [libvirt] [PATCH] Document STR(N)EQ_NULLABLE (was Re: [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty)

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 08:27:42AM -0600, Eric Blake wrote: On 10/06/2011 05:38 AM, Guido Günther wrote: ...and here's the doc update. -- Guido 0001-Document-STREQ_NULLABLE-and-STRNEQ_NULLABLE.patch From 07b8940e3bb64e2208b191d890e95f059a7ac7a9 Mon Sep 17 00:00:00 2001 From:

Re: [libvirt] [PATCH] Document STR(N)EQ_NULLABLE (was Re: [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty)

2011-10-06 Thread Eric Blake
On 10/06/2011 08:52 AM, Guido Günther wrote: ACK. But be sure you also run 'make check', then squash in the regeneration of HACKING prior to pushing your commit. I had to do a explicit make HACKING to get this regenerated. Pushed now - thanks. Ah, maybe it was only 'make syntax-check' that

Re: [libvirt] [libvirt-glib] API to deal with storage pool(s)

2011-10-06 Thread Christophe Fergeau
On Tue, Sep 27, 2011 at 01:19:56AM +0300, Zeeshan Ali (Khattak) wrote: +gboolean gvir_connection_fetch_storage_pools(GVirConnection *conn, + GCancellable *cancellable, + GError **err) +{ +

Re: [libvirt] [PATCH] qemu: enable multifunction for older qemu

2011-10-06 Thread Eric Blake
On 10/05/2011 09:10 PM, Wen Congyang wrote: At 10/06/2011 05:52 AM, Eric Blake Write: Now that RHEL 6.2 Beta is out, it would be nice to test multifunction devices on that platform. This changes things so that the multifunction cap bit can be set in two different ways: by version comparison

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Eric Blake
On 10/06/2011 03:15 AM, Guido Günther wrote: otherwise a missing UUID in a domain config just shows: libxlDomainXMLFromNative:2600 : Internal Error parsing xm config failed Now we have: xenXMConfigGetUUID:186 : Internal Error config value uuid was missing Still doesn't sound quite right -

Re: [libvirt] [PATCH 1.5/2] qemu: leave rerror policy at default when enospace is requested

2011-10-06 Thread Eric Blake
On 10/05/2011 09:06 PM, Laine Stump wrote: commit 12062ab set rerror=ignore when error_policy=enospace was selected (since the rerror option in qemu doesn't accept enospc, as the werror option does). After that patch was already pushed, Paolo Bonzini noticed it and commented that leaving rerror

Re: [libvirt] [PATCHv2 2/2] qemu: add separate rerror_policy for disk errors

2011-10-06 Thread Eric Blake
On 10/05/2011 09:06 PM, Laine Stump wrote: Previously libvirt's disk device XML only had a single attribute, error_policy, to control both read and write error policy, but qemu has separate options for controlling read and write. In one case (enospc) a policy is allowed for write errors but not

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Guido Günther
Hi Eric, On Thu, Oct 06, 2011 at 10:50:46AM -0600, Eric Blake wrote: On 10/06/2011 03:15 AM, Guido Günther wrote: otherwise a missing UUID in a domain config just shows: libxlDomainXMLFromNative:2600 : Internal Error parsing xm config failed Now we have: xenXMConfigGetUUID:186 :

Re: [libvirt] [libvirt-glib] API to deal with storage pool(s)

2011-10-06 Thread Daniel P. Berrange
On Thu, Oct 06, 2011 at 06:46:05PM +0200, Christophe Fergeau wrote: On Tue, Sep 27, 2011 at 01:19:56AM +0300, Zeeshan Ali (Khattak) wrote: +gboolean gvir_connection_fetch_storage_pools(GVirConnection *conn, + GCancellable *cancellable, +

[libvirt] [libvirt-glib 1/3] Don't use empty message when building a GError

2011-10-06 Thread Christophe Fergeau
After testing that 'message' is NULL, gvir_error_new_literal is using it to build a GError. What was meant was to use verr-message. --- libvirt-glib/libvirt-glib-error.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libvirt-glib/libvirt-glib-error.c

[libvirt] [libvirt-glib 2/3] Don't use empty message when building a GError

2011-10-06 Thread Christophe Fergeau
After testing that 'message' is NULL, gvir_xml_error_new_literal is using it to build a GError. What was meant was to use xerr-message. --- libvirt-gconfig/libvirt-gconfig-object.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-object.c

[libvirt] [libvirt-glib 3/3] Only call gvir_error_new after failed libvirt calls

2011-10-06 Thread Christophe Fergeau
gvir_error_new is only meant to be used right after a failed libvirt function call, in other cases we should be calling g_error_new directly. --- libvirt-gobject/libvirt-gobject-connection.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git

Re: [libvirt] [libvirt-glib] Turn GVirStream into a GIOStream

2011-10-06 Thread Christophe Fergeau
On Sat, Oct 01, 2011 at 07:57:46PM +0200, Marc-André Lureau wrote: Allows to read async from a stream with GVirInputStream. This is modelled after GSocket. enum { @@ -60,6 +64,71 @@ gvir_stream_error_quark(void) return g_quark_from_static_string(vir-g-stream); } I'd rename it

Re: [libvirt] [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty

2011-10-06 Thread Eric Blake
On 10/06/2011 05:36 AM, Guido Günther wrote: In fact I was looking for that kind of function in hacking.html. New patch attached. Cheers, -- Guido 0001-xenParseXM-don-t-dereference-NULL-pointer-when-scrip.patch From 1819f18fbbf0c133a66c93debc117456e940b2bc Mon Sep 17 00:00:00 2001 From:

Re: [libvirt] [PATCH] remote_driver: Avoid double free in EventControl building

2011-10-06 Thread Eric Blake
On 10/06/2011 07:41 AM, Michal Privoznik wrote: Don't xdr_free event data as they are freed by our caller virNetClientProgramDispatch. --- src/remote/remote_driver.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/remote/remote_driver.c

Re: [libvirt] [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 12:44:05PM -0600, Eric Blake wrote: On 10/06/2011 05:36 AM, Guido Günther wrote: In fact I was looking for that kind of function in hacking.html. New patch attached. Cheers, -- Guido 0001-xenParseXM-don-t-dereference-NULL-pointer-when-scrip.patch From

Re: [libvirt] [PATCH] build: fix 'make distcheck' with pdwtags installed

2011-10-06 Thread Laine Stump
On 10/04/2011 12:33 PM, Eric Blake wrote: I am getting this failure with 'make distcheck': GEN../../src/remote_protocol-structs /bin/sh: ../../src/remote_protocol-structs-t: Permission denied make[4]: *** [../../src/remote_protocol-structs] Error 1 since it attempts a sub-run of a VPATH

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Laine Stump
On 10/06/2011 01:36 PM, Guido Günther wrote: Hi Eric, On Thu, Oct 06, 2011 at 10:50:46AM -0600, Eric Blake wrote: These three errors should probably all be changed away from VIR_ERR_INTERNAL_ERROR into something more useful, but I'm not sure whether that would be VIR_ERR_CONF_SYNTAX,

Re: [libvirt] [PATCH] Document STR(N)EQ_NULLABLE (was Re: [PATCH 2/2] xenParseXM: don't dereference NULL pointer when script is empty)

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 08:54:22AM -0600, Eric Blake wrote: On 10/06/2011 08:52 AM, Guido Günther wrote: ACK. But be sure you also run 'make check', then squash in the regeneration of HACKING prior to pushing your commit. I had to do a explicit make HACKING to get this regenerated. Pushed

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Guido Günther
On Thu, Oct 06, 2011 at 03:55:48PM -0400, Laine Stump wrote: On 10/06/2011 01:36 PM, Guido Günther wrote: Hi Eric, On Thu, Oct 06, 2011 at 10:50:46AM -0600, Eric Blake wrote: These three errors should probably all be changed away from VIR_ERR_INTERNAL_ERROR into something more useful, but

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-06 Thread Eric Blake
On 10/06/2011 11:36 AM, Guido Günther wrote: These three errors should probably all be changed away from VIR_ERR_INTERNAL_ERROR into something more useful, but I'm not sure whether that would be VIR_ERR_CONF_SYNTAX, VIR_ERR_CONFIG_UNSUPPORTED, or something else. I was uncertain about the error

[libvirt] [PATCH 0/2] snapshot: allow editing disk-only snapshots

2011-10-06 Thread Eric Blake
I tested that both of these patches in isolation were sufficient to fix 'virsh snapshot-current dom name' when running the same version of virsh as libvirtd (what will become 0.9.7). However, both patches are required, so that both virsh 0.9.5 and libvirtd 0.9.7, as well as virsh 0.9.7 and

[libvirt] [PATCH 1/2] snapshot: let virsh edit disk snapshots

2011-10-06 Thread Eric Blake
It was impossible for 'virsh snapshot-current dom name' to set name as the current snapshot, if name is a disk-only snapshot. Using strstr rather than full-blown xml parsing is safe, since the xml is assumed to be well-formed coming from libvirtd rather than arbitrary text coming from the user.

[libvirt] [PATCH 2/2] snapshot: simplify redefinition of disk snapshot

2011-10-06 Thread Eric Blake
Redefining disk-only snapshot xml should work even if the user did not explicitly pass VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY; the flag is only required for conditions where the state subelement is not already present in parsing (that is, defining a new snapshot). Also, fix the error code of some

[libvirt] [PATCH 14/7] snapshot: virsh shorthand for operating on current snap

2011-10-06 Thread Eric Blake
Rather than having to do: $ virsh snapshot-revert dom $(virsh snapshot-current dom --name) I thought it would be nice to do: $ virsh snaphot-revert dom --current I intentionally made it so that omitting both --current and a name is an error (having the absence of a name imply --current seems

Re: [libvirt] [PATCH] build: fix 'make distcheck' with pdwtags installed

2011-10-06 Thread Eric Blake
On 10/06/2011 01:38 PM, Laine Stump wrote: On 10/04/2011 12:33 PM, Eric Blake wrote: I am getting this failure with 'make distcheck': GEN ../../src/remote_protocol-structs /bin/sh: ../../src/remote_protocol-structs-t: Permission denied make[4]: *** [../../src/remote_protocol-structs] Error 1