[libvirt] [libvirt-glib 1/2] Add gvir_gconfig_object_remove_attribute helper

2012-01-03 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-object-private.h |2 ++ libvirt-gconfig/libvirt-gconfig-object.c | 11 +++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h

[libvirt] [libvirt-glib 2/2] Overwrite attributes in GVirObject::set_attribute

2012-01-03 Thread Christophe Fergeau
Zeeshan reported an issue where calling gvir_config_domain_disk_set_target_dev several times would result in duplicated 'dev' attributes in the resulting XML instead of overwriting the existing 'dev' attribute. Since there are no cases interesting to libvirt-gconfig where having several attributes

Re: [libvirt] PATCH: Inform QEMU prepare hook of migration in progress

2012-01-03 Thread Rommer
Hello, I need this feature too, so I made myself the more general solution. Attached patch sets the fourth argument of the hook to 3 differnent values: migration-target-direct, migration-target-tunnel and restore. On 12/16/2011 02:48 AM, Adam Tilghman wrote: On Thu, Dec 15, 2011 at 11:32:23PM

[libvirt] [libvirt-glib] Remove FIXME from gvir_config_domain_filesys_set_driver_type

2012-01-03 Thread Christophe Fergeau
All that was missing to fix it was gvir_config_object_remove_attribute which now exists. --- libvirt-gconfig/libvirt-gconfig-domain-filesys.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-filesys.c

[libvirt] [libvirt-glib] Add {replace,add}_with_attribute

2012-01-03 Thread Christophe Fergeau
These functions may seem very specialized, and the same can easily be achieved with 2 separate API calls, but since this is something that is commonly done, these helpers save quite a few lines of code. --- libvirt-gconfig/libvirt-gconfig-domain-disk.c | 49 ++--

Re: [libvirt] [PATCH] qemu: one more client to live/config helper

2012-01-03 Thread Michal Privoznik
On 03.01.2012 00:37, Eric Blake wrote: Commit ae523427 missed one pair of functions that could use the helper routine. * src/qemu/qemu_driver.c (qemuSetSchedulerParametersFlags) (qemuGetSchedulerParametersFlags): Simplify. --- src/qemu/qemu_driver.c | 73

[libvirt] [libvirt-glib 2/4] Add helpers to parse xml trees

2012-01-03 Thread Christophe Fergeau
This will be helpful to implement GVirConfig getters. --- libvirt-gconfig/libvirt-gconfig-helpers-private.h |5 ++ libvirt-gconfig/libvirt-gconfig-helpers.c | 52 ++-- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git

[libvirt] [libvirt-glib 1/4] Introduce libvirt-gconfig-private.h

2012-01-03 Thread Christophe Fergeau
This header groups all libvirt-gconfig private headers. --- libvirt-gconfig/Makefile.am|1 + .../libvirt-gconfig-domain-chardev-source-pty.c|2 +- libvirt-gconfig/libvirt-gconfig-domain-chardev.c |2 +- libvirt-gconfig/libvirt-gconfig-domain-clock.c |

[libvirt] [libvirt-glib 3/4] Add gvir_config_object_new_from_tree

2012-01-03 Thread Christophe Fergeau
This helper function will be useful to create instances of GVirConfigXXX objects when we already have a top-level instance (eg to create a GVirConfigDomainDisk using the tree stored in a GVirConfigDomain instance). --- libvirt-gconfig/libvirt-gconfig-object-private.h |6 ++

[libvirt] [libvirt-glib 4/4] Implement gvir_config_domain_get_devices

2012-01-03 Thread Christophe Fergeau
There are some devices which we are not able to parse yet, in these cases a runtime warning is printed to tell what's going on. --- libvirt-gconfig/Makefile.am|1 + .../libvirt-gconfig-domain-device-private.h| 45 ++

[libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Michal Privoznik
Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation based on array of integers. --- src/util/command.c | 108 1

Re: [libvirt] [PATCH 2/2] Do not generate security_model when fs driver is anything but 'path'

2012-01-03 Thread Daniel P. Berrange
On Mon, Dec 26, 2011 at 02:49:55PM +0530, Deepak C Shetty wrote: On 12/22/2011 11:00 PM, Daniel P. Berrange wrote: On Thu, Dec 22, 2011 at 10:24:57AM +0530, Deepak C Shetty wrote: On 12/21/2011 08:11 PM, Daniel P. Berrange wrote: On Wed, Dec 21, 2011 at 11:17:17AM +0530, Deepak C Shetty wrote:

Re: [libvirt] Access to the secretDriver in a storage backend?

2012-01-03 Thread Daniel P. Berrange
On Sat, Dec 31, 2011 at 01:26:54PM +0100, Wido den Hollander wrote: Hi, I'm working on a storage backend for libvirt which needs credentials to access the storage pool. I want to use the build in secret manager from libvirt, but it seems I do not have access to the secretDriver in a storage

Re: [libvirt] [libvirt-glib 1/4] Introduce libvirt-gconfig-private.h

2012-01-03 Thread Christophe Fergeau
Hi, I was a bit too hasty in sending this, while the series is fine as is, I have made a few improvements to it, so I'll send a v2. Changes that will be in it: - handle 'sound' nodes - ignore blank xml nodes in get_devices to avoid not so useful warnings Christophe On Tue, Jan 03, 2012 at

[libvirt] [libvirt-glib] Call gvir_init_config() in GVirConfig test programs

2012-01-03 Thread Christophe Fergeau
While not strictly necessary, this sets up glib logging properly on older glib so that debug logs are not shown by default. --- libvirt-gconfig/tests/test-domain-create.c |4 ++-- libvirt-gconfig/tests/test-domain-parse.c |1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

Re: [libvirt] [libvirt-glib] Call gvir_init_config() in GVirConfig test programs

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 05:04:36PM +0400, Christophe Fergeau wrote: While not strictly necessary, this sets up glib logging properly on older glib so that debug logs are not shown by default. --- libvirt-gconfig/tests/test-domain-create.c |4 ++--

Re: [libvirt] Access to the secretDriver in a storage backend?

2012-01-03 Thread Wido den Hollander
On 01/03/2012 12:58 PM, Daniel P. Berrange wrote: On Sat, Dec 31, 2011 at 01:26:54PM +0100, Wido den Hollander wrote: Hi, I'm working on a storage backend for libvirt which needs credentials to access the storage pool. I want to use the build in secret manager from libvirt, but it seems I do

Re: [libvirt] [libvirt-glib 2/2] API to save and suspend

2012-01-03 Thread Marc-André Lureau
Hi On Fri, Dec 23, 2011 at 8:58 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: +data = g_new0(DomainSavedSuspendData, 1); +g_slice_free (DomainSavedSuspendData, data); You are mixing g_new and g_slice, I don't think that's a problem, but that's not consistant and worries me.

Re: [libvirt] [libvirt-glib 2/2] API to save and suspend

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 03:06:09PM +0100, Marc-André Lureau wrote: Hi On Fri, Dec 23, 2011 at 8:58 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: +data = g_new0(DomainSavedSuspendData, 1); +g_slice_free (DomainSavedSuspendData, data); You are mixing g_new and g_slice, I

Re: [libvirt] Access to the secretDriver in a storage backend?

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 03:00:49PM +0100, Wido den Hollander wrote: On 01/03/2012 12:58 PM, Daniel P. Berrange wrote: On Sat, Dec 31, 2011 at 01:26:54PM +0100, Wido den Hollander wrote: Hi, I'm working on a storage backend for libvirt which needs credentials to access the storage pool. I

Re: [libvirt] [PATCH 0/5 v3] Interface pools and passthrough mode

2012-01-03 Thread Shradha Shah
Hello All, I had posted this latest version of my patch series a couple of weeks ago. Since I did not receive any feedback I think this post got missed amidst the volume of mail on libvir-list. Since I am new to libvirt I would be happy to receive review comments and advice on my patches.

[libvirt] [PATCH] virCPUDefCopy forgot to copy NUMA topology

2012-01-03 Thread Jiri Denemark
As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 2882389..348299b 100644 --- a/src/conf/cpu_conf.c +++

Re: [libvirt] [libvirt-glib 2/2] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 4:11 PM, Daniel P. Berrange berra...@redhat.com wrote: On Tue, Jan 03, 2012 at 03:06:09PM +0100, Marc-André Lureau wrote: Hi On Fri, Dec 23, 2011 at 8:58 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: +    data = g_new0(DomainSavedSuspendData, 1); +    

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Daniel P. Berrange
On Thu, Dec 22, 2011 at 04:17:32PM +0100, Christophe Fergeau wrote: On Thu, Dec 22, 2011 at 02:26:48AM +0200, Zeeshan Ali (Khattak) wrote: On Thu, Dec 22, 2011 at 1:46 AM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: On Thu, Dec 22, 2011 at 1:43 AM, Zeeshan Ali (Khattak)

[libvirt] [libvirt-glib PATCHv2 1/5] Introduce libvirt-gconfig-private.h

2012-01-03 Thread Christophe Fergeau
This header groups all libvirt-gconfig private headers. --- libvirt-gconfig/Makefile.am|1 + .../libvirt-gconfig-domain-chardev-source-pty.c|2 +- libvirt-gconfig/libvirt-gconfig-domain-chardev.c |2 +- libvirt-gconfig/libvirt-gconfig-domain-clock.c |

[libvirt] Implement gvir_config_domain_get_devices

2012-01-03 Thread Christophe Fergeau
Hi, This is the second version of the patch series introducing gvir_config_domain_get_devices. The difference from the first version is the added 4/5 patch which adds a helper function to help with ignoring blank nodes while parsing the XML document. Christophe -- libvir-list mailing list

[libvirt] [libvirt-glib 2/2] Add GVirConfigDomainDisk getters

2012-01-03 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain-disk.c | 101 + libvirt-gconfig/libvirt-gconfig-domain-disk.h | 10 +++ libvirt-gconfig/libvirt-gconfig.sym |8 ++ 3 files changed, 119 insertions(+), 0 deletions(-) diff --git

[libvirt] [libvirt-glib PATCHv2 4/5] Add gvir_config_object_foreach_child helper

2012-01-03 Thread Christophe Fergeau
When iterating over xmlNodePtr children to parse an XML document describing a libvirt configuration item, we want to ignore blank nodes that may have been added to make the initial XML document more human readable. Since this will be useful in several places, move this code to a helper function.

[libvirt] [libvirt-glib PATCHv2 5/5] Implement gvir_config_domain_get_devices

2012-01-03 Thread Christophe Fergeau
There are some devices which we are not able to parse yet, in these cases a runtime warning is printed to tell what's going on. --- libvirt-gconfig/Makefile.am|1 + .../libvirt-gconfig-domain-device-private.h| 45 ++

[libvirt] [libvirt-glib PATCHv2 2/5] Add helpers to parse xml trees

2012-01-03 Thread Christophe Fergeau
This will be helpful to implement GVirConfig getters. --- libvirt-gconfig/libvirt-gconfig-helpers-private.h |5 ++ libvirt-gconfig/libvirt-gconfig-helpers.c | 53 ++-- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git

[libvirt] [libvirt-glib PATCHv2 3/5] Add gvir_config_object_new_from_tree

2012-01-03 Thread Christophe Fergeau
This helper function will be useful to create instances of GVirConfigXXX objects when we already have a top-level instance (eg to create a GVirConfigDomainDisk using the tree stored in a GVirConfigDomain instance). --- libvirt-gconfig/libvirt-gconfig-object-private.h |6 ++

[libvirt] [libvirt-glib 1/2] Add more parsing helpers to GVirConfigObject

2012-01-03 Thread Christophe Fergeau
Add gvir_config_object_get_node_content_genum, gvir_config_object_get_attribute and gvir_config_object_get_attribute_genum to complement the existing methods. They all act on a child node of the current node. The _get_attribute functions can also act on the root node of the GVirConfigObject

[libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
From: Zeeshan Ali (Khattak) zeesha...@gnome.org Its just a set of synchronous and asynchronous wrappers around virDomainManagedSave. --- libvirt-gobject/libvirt-gobject-domain.c | 119 ++ libvirt-gobject/libvirt-gobject-domain.h | 11 +++

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 4:31 PM, Daniel P. Berrange berra...@redhat.com wrote: On Thu, Dec 22, 2011 at 04:17:32PM +0100, Christophe Fergeau wrote: On Thu, Dec 22, 2011 at 02:26:48AM +0200, Zeeshan Ali (Khattak) wrote: On Thu, Dec 22, 2011 at 1:46 AM, Zeeshan Ali (Khattak) zeesha...@gnome.org

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 5:08 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: From: Zeeshan Ali (Khattak) zeesha...@gnome.org +    res = g_simple_async_result_new(G_OBJECT(dom), +                                    callback, +                                    user_data, +                

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Marc-André Lureau
On Tue, Jan 3, 2012 at 4:08 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: +g_simple_async_result_set_op_res_gpointer (res, data, NULL); Why not adding g_slice_free argument here, instead of calling it explicitely in the callback, and risking a leak? -- Marc-André Lureau --

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Christophe Fergeau
On Tue, Jan 03, 2012 at 05:18:41PM +0200, Zeeshan Ali (Khattak) wrote: I haven't really checked with other languages but vala tools get confused because we claim that GVirConfig is the namespace but then the macros aren't named accordingly. I can get you the exact errors I got from valac if

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 5:31 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Jan 03, 2012 at 05:18:41PM +0200, Zeeshan Ali (Khattak) wrote:   I haven't really checked with other languages but vala tools get confused because we claim that GVirConfig is the namespace but then the macros

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Marc-André Lureau
On Tue, Jan 3, 2012 at 4:22 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: On Tue, Jan 3, 2012 at 5:08 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: From: Zeeshan Ali (Khattak) zeesha...@gnome.org +res = g_simple_async_result_new(G_OBJECT(dom), +

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 5:35 PM, Marc-André Lureau marcandre.lur...@gmail.com wrote: On Tue, Jan 3, 2012 at 4:22 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: On Tue, Jan 3, 2012 at 5:08 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: From: Zeeshan Ali (Khattak)

Re: [libvirt] [PATCH 1/3] python: Fix memory leaks on libvirt_virDomainGetSchedulerParameters

2012-01-03 Thread Alex Jia
Hi Eric, Thanks for your comment, the PyDict_SetItem still works well for me, I can get a expected result by calling related python binding API, Doesn't it work for you? In addition, you mean we need a cleanup patch to fix all of memory leaks issues, right? or need to define a global cleanup

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Christophe Fergeau
On Tue, Jan 03, 2012 at 05:35:39PM +0200, Zeeshan Ali (Khattak) wrote: On Tue, Jan 3, 2012 at 5:31 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Jan 03, 2012 at 05:18:41PM +0200, Zeeshan Ali (Khattak) wrote:   I haven't really checked with other languages but vala tools get

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Marc-André Lureau
On Tue, Jan 3, 2012 at 4:40 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: Why? gslice is *the* glib way to allocate/free fixed-sized structures. ... but useful for performance reasons. Here it makes the code more tricky than necessary. -- Marc-André Lureau -- libvir-list mailing list

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Marc-André Lureau
On Tue, Jan 3, 2012 at 4:40 PM, Zeeshan Ali (Khattak) zeesha...@gnome.orgwrote: Tbh, I think it's better having the small wrapper if we keep gslice. Why? I don't see any possible leaks here. I am thinking of calling cancel before the thread func runs. I suppose it is cancellable this way

[libvirt] [PATCH] storage: Support different wiping algorithms

2012-01-03 Thread Michal Privoznik
Currently, we support only filling a volume with zeroes on wiping. However, it is not enough as data might still be readable by experienced and equipped attacker. Many technical papers have been written, therefore we should support other wiping algorithms. --- Okay, this is not as complete as I'd

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 6:06 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Jan 03, 2012 at 05:35:39PM +0200, Zeeshan Ali (Khattak) wrote: On Tue, Jan 3, 2012 at 5:31 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Jan 03, 2012 at 05:18:41PM +0200, Zeeshan Ali (Khattak)

Re: [libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 6:07 PM, Marc-André Lureau marcandre.lur...@gmail.com wrote: On Tue, Jan 3, 2012 at 4:40 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: Tbh, I think it's better having the small wrapper if we keep gslice.  Why? I don't see any possible leaks here. I am

Re: [libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Eric Blake
On 01/03/2012 04:14 AM, Michal Privoznik wrote: Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation based on array of integers. --- src/util/command.c | 108

Re: [libvirt] [PATCH] storage: Support different wiping algorithms

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 05:12:47PM +0100, Michal Privoznik wrote: Currently, we support only filling a volume with zeroes on wiping. However, it is not enough as data might still be readable by experienced and equipped attacker. Many technical papers have been written, therefore we should

Re: [libvirt] [PATCH] virCPUDefCopy forgot to copy NUMA topology

2012-01-03 Thread Eric Blake
On 01/03/2012 07:22 AM, Jiri Denemark wrote: As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) ACK. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt

Re: [libvirt] virtio-scsi support proposal, v2

2012-01-03 Thread Daniel P. Berrange
On Fri, Dec 23, 2011 at 09:36:23AM +0100, Paolo Bonzini wrote: Here is a revised version of the virtio-scsi proposal. There's actually not too much left intact from v1. :) The devil is in the details, but I think I broadly agree with everything suggested in the proposal below. The main

[libvirt] [libvirt-glib] API to save and suspend

2012-01-03 Thread Zeeshan Ali (Khattak)
From: Zeeshan Ali (Khattak) zeesha...@gnome.org Its just a set of synchronous and asynchronous wrappers around virDomainManagedSave. --- libvirt-gobject/libvirt-gobject-domain.c | 122 ++ libvirt-gobject/libvirt-gobject-domain.h | 11 +++

Re: [libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Michal Privoznik
On 03.01.2012 17:33, Eric Blake wrote: On 01/03/2012 04:14 AM, Michal Privoznik wrote: Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation based on array of

[libvirt] [PATCH] virCommand: Properly handle POLLHUP

2012-01-03 Thread Michal Privoznik
It is a good practise to set revents to zero before doing any poll(). Moreover, we should check if event we waited for really occurred or if any of fds we were polling on didn't encountered hangup. --- src/util/command.c | 21 + 1 files changed, 17 insertions(+), 4

Re: [libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 09:33:03AM -0700, Eric Blake wrote: On 01/03/2012 04:14 AM, Michal Privoznik wrote: Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 6:24 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: On Tue, Jan 3, 2012 at 6:06 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Jan 03, 2012 at 05:35:39PM +0200, Zeeshan Ali (Khattak) wrote: On Tue, Jan 3, 2012 at 5:31 PM, Christophe Fergeau

Re: [libvirt] [PATCH] virCommand: Properly handle POLLHUP

2012-01-03 Thread Eric Blake
On 01/03/2012 10:58 AM, Michal Privoznik wrote: It is a good practise to set revents to zero before doing any poll(). Moreover, we should check if event we waited for really occurred or if any of fds we were polling on didn't encountered hangup. Looks like this also solves:

Re: [libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Eric Blake
On 01/03/2012 11:06 AM, Daniel P. Berrange wrote: On Tue, Jan 03, 2012 at 09:33:03AM -0700, Eric Blake wrote: On 01/03/2012 04:14 AM, Michal Privoznik wrote: Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE.

Re: [libvirt] [PATCH] command: Discard FD_SETSIZE limit for opened files

2012-01-03 Thread Eric Blake
On 01/03/2012 04:14 AM, Michal Privoznik wrote: Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation based on array of integers. --- src/util/command.c | 108

Re: [libvirt] [PATCH] virCommand: Properly handle POLLHUP

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 06:58:51PM +0100, Michal Privoznik wrote: It is a good practise to set revents to zero before doing any poll(). Moreover, we should check if event we waited for really occurred or if any of fds we were polling on didn't encountered hangup. --- src/util/command.c |

[libvirt] [PATCH] Fix typos in libvirt messages

2012-01-03 Thread Yuri Chornoivan
Hi! Attached to this message you can find a patch from BZ 770954 [1] Thanks for reviewing it. Additionally, it can be useful to replace all dettach occurrences with detach. Best regards, Yuri [1] https://bugzilla.redhat.com/show_bug.cgi?id=770954 fix-typos-in-messages.patch Description:

[libvirt] [libvirt-glib] Correct gvir_storage_pool_get_volumes' return annotation

2012-01-03 Thread Zeeshan Ali (Khattak)
From: Zeeshan Ali (Khattak) zeesha...@gnome.org --- libvirt-gobject/libvirt-gobject-storage-pool.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c index 76970db..f46dc32

Re: [libvirt] [PATCH] virCPUDefCopy forgot to copy NUMA topology

2012-01-03 Thread Jiri Denemark
On Tue, Jan 03, 2012 at 09:38:52 -0700, Eric Blake wrote: On 01/03/2012 07:22 AM, Jiri Denemark wrote: As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) ACK.

[libvirt] [libvirt-glib] Add docs for gvir_config_domain_set/get_memory

2012-01-03 Thread Zeeshan Ali (Khattak)
From: Zeeshan Ali (Khattak) zeesha...@gnome.org Its not obvious what units these functions deal with so docs are critical for these functions. --- libvirt-gconfig/libvirt-gconfig-domain.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git

[libvirt] [PATCH] schemas: Allow '.' in CPU feature name

2012-01-03 Thread Jiri Denemark
We already support CPU features with '.' in their name (e.g., sse4.1) so we should not forbid that in the schema. --- docs/schemas/domaincommon.rng |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index

Re: [libvirt] [libvirt-glib 4/4] Implement gvir_config_domain_get_devices

2012-01-03 Thread Zeeshan Ali (Khattak)
On Tue, Jan 3, 2012 at 12:11 PM, Christophe Fergeau cferg...@redhat.com wrote: There are some devices which we are not able to parse yet, in these cases a runtime warning is printed to tell what's going on. Actually I see that most of the device types are not being handled. I would suggest we

Re: [libvirt] [libvirt-glib 4/4] Implement gvir_config_domain_get_devices

2012-01-03 Thread Daniel P. Berrange
On Tue, Jan 03, 2012 at 11:38:15PM +0200, Zeeshan Ali (Khattak) wrote: On Tue, Jan 3, 2012 at 12:11 PM, Christophe Fergeau cferg...@redhat.com wrote: There are some devices which we are not able to parse yet, in these cases a runtime warning is printed to tell what's going on. Actually

[libvirt] [PATCH] PolicyKit: Check auth before asking client to obtain it

2012-01-03 Thread Jim Fehlig
I previously mentioned [1] a PolicyKit issue where libvirt would proceed with authentication even though polkit-auth failed: testusr xen134:~ virsh list --all Attempting to obtain authorization for org.libvirt.unix.manage. polkit-grant-helper: given auth type (8 - yes) is bogus Failed to obtain

[libvirt] [PATCH] Fix xenstore serial console path for HVM guests

2012-01-03 Thread Jim Fehlig
The console path in xenstore is /local/domain/id/console/tty for PV guests (PV console) and /local/domain/id/serial/0/tty (serial console) for HVM guests. Similar to Xen's in-tree console client, read the correct path for PV vs HVM. --- src/xen/xend_internal.c |5 - src/xen/xs_internal.c

[libvirt] [PATCH RFCv2 1/5] libssh2_transport: add main libssh2 transport implementation

2012-01-03 Thread Peter Krempa
This patch adds helper functions to libssh2 that enable us to use libssh2 in conjunction with libvirt-native virNetSocket-s instead of using a spawned ssh client process. This implemetation supports tunneled plaintext, keyboard-interactive, private key, ssh agent based and null authentication.

[libvirt] [PATCH RFCv2 0/5] LibSSH2 transport for libvirt

2012-01-03 Thread Peter Krempa
This patchset proposes to use libssh2 as ssh transport option in libvirt instead of the usual spawn the client and connect pipes approach. For this to work, you'll need at least libssh2 v 1.3.0. This is the second iteration of this functionality. I have completed nearly all of the functionality

[libvirt] [PATCH RFCv2 5/5] virsh: Reconnect to daemon if remote netcat crashes while using libssh

2012-01-03 Thread Peter Krempa
This patch enables reconnection if for some reason remote netcat, that is connecting libvirt daemon to the ssh transport layer crashes. * tools/virsh.c: Add support for Libssh's error code --- tools/virsh.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/virsh.c

[libvirt] [PATCH RFCv2 2/5] libssh2_transport: add ssh context support to virNetSocket

2012-01-03 Thread Peter Krempa
This patch enables virNetSocket to be used as an ssh client when properly configured. Fucntion virNetSocketNewConnectLibSSH() is added, that takes all needed parameters and creates a libssh2 session context and performs steps needed to open the connection. * src/libvirt_private.syms: Export the

[libvirt] [PATCH RFCv2 3/5] libssh2_transport: Add libssh2 session support to net client code

2012-01-03 Thread Peter Krempa
This patch adds a glue layer to enable using libssh2 code with the network client code. As in the original client implementation, shell code is sent to the server to detect correct options for netcat. *src/rpc/virnetclient.c: *src/rpc/virnetclient.h: Add function to handle connection to a

[libvirt] [PATCH RFCv2 4/5] libssh2_transport: Use libssh2 driver code in remote driver

2012-01-03 Thread Peter Krempa
This patch adds URI options to support libssh2 transport in the remote driver. A new transport sceme is introduced eg. qemu+libssh://... that utilizes the libssh2 code added in previous patches. The libssh2 code requires the authentication callback to be able to perform keyboard-interactive

[libvirt] [PATCH 0/2] helper functions for virTypedParameters

2012-01-03 Thread Eric Blake
As hinted at here: https://www.redhat.com/archives/libvir-list/2012-January/msg00019.html Eric Blake (2): util: add new file for virTypedParameter utils util: use new virTypedParameter helpers daemon/remote.c |1 + po/POTFILES.in |1 + src/Makefile.am |

[libvirt] [PATCH 1/2] util: add new file for virTypedParameter utils

2012-01-03 Thread Eric Blake
Preparation for another patch that refactors common patterns into the new file for fewer lines of code overall. * src/util/util.h (virTypedParameterArrayClear): Move... * src/util/virtypedparam.h: ...to new file. (virTypedParameterArrayValidate, virTypedParameterAssign): New prototypes. *

[libvirt] [PATCH 1/4 V2] libvirt: Add new public API virDomainGetPcpusUsage

2012-01-03 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- include/libvirt/libvirt.h.in |5 python/generator.py |1 + src/driver.h |7 + src/libvirt.c| 51 ++ src/libvirt_public.syms |5

[libvirt] [PATCH 4/4 V2] virsh: Enable the pcpuinfo command in virsh

2012-01-03 Thread Lai Jiangshan
This command gets information about the physic CPUs. Example: # virsh pcpuinfo rhel6 CPU:0 Curr VCPU: - Usage: 47.3 CPU:1 Curr VCPU: 1 Usage: 46.8 CPU:2 Curr VCPU: 0 Usage: 52.7 CPU:3 Curr VCPU: -

[libvirt] [PATCH 2/4 V2] remote: mplement new API virDomainGetPcpusUsage for remote driver

2012-01-03 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- daemon/remote.c | 68 ++ src/remote/remote_driver.c | 51 +++ src/remote/remote_protocol.x | 17 ++- src/remote_protocol-structs | 13

[libvirt] [PATCH 1/1 V2] ocaml-libvirt: and virDomainGetPcpusUsage() API to ocaml-libvirt

2012-01-03 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- libvirt/libvirt.ml |1 + libvirt/libvirt.mli |4 libvirt/libvirt_c_oneoffs.c | 25 + 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/libvirt/libvirt.ml

[libvirt] [PATCH 0/4 0/1 0/1 V2] Add new public API virDomainGetPcpusUsage() and pcpuinfo command in virsh

2012-01-03 Thread Lai Jiangshan
virt-top -1 can call virDomainGetPcpusUsage() periodically and get the CPU activities per CPU. (See the last patch in this series). virsh is also added a pcpuinfo command which calls virDomainGetPcpusUsage(), it gets information about the physic CPUs, such as the usage of CPUs, the current

[libvirt] [PATCH 3/4 V2] qemu: implement new API virDomainGetPcpusUsage for qemu driver

2012-01-03 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- src/qemu/qemu.conf |5 ++- src/qemu/qemu_conf.c |3 +- src/qemu/qemu_driver.c | 74 src/util/cgroup.c |7 src/util/cgroup.h |1 + 5 files changed, 87

[libvirt] [PATCH 1/1 V2] virt-top: correct virt-top -1 command via cpuacct cgroup

2012-01-03 Thread Lai Jiangshan
Old virt-top -1 is not correct, its output is generated by guess: use average usage for pinned physic CPUs. example(old virt-top -1): PHYCPU %CPU rhel6 Windows 00.6 0.1= 0.5= 10.6 0.1= 0.5=# 2

Re: [libvirt] [libvirt-glib 4/4] Implement gvir_config_domain_get_devices

2012-01-03 Thread Christophe Fergeau
On Tue, Jan 03, 2012 at 10:08:10PM +, Daniel P. Berrange wrote: On Tue, Jan 03, 2012 at 11:38:15PM +0200, Zeeshan Ali (Khattak) wrote: On Tue, Jan 3, 2012 at 12:11 PM, Christophe Fergeau cferg...@redhat.com wrote: There are some devices which we are not able to parse yet, in these

Re: [libvirt] [PATCH 4/4 V2] virsh: Enable the pcpuinfo command in virsh

2012-01-03 Thread Shu Ming
A typo, physic CPU should be physical CPU. On 2012-1-4 12:09, Lai Jiangshan wrote: This command gets information about the physic CPUs. Example: # virsh pcpuinfo rhel6 CPU:0 Curr VCPU: - Usage: 47.3 CPU:1 Curr VCPU: 1 Usage: 46.8 CPU:

Re: [libvirt] [libvirt-glib 4/4] Implement gvir_config_domain_get_devices

2012-01-03 Thread Christophe Fergeau
On Wed, Jan 04, 2012 at 10:50:18AM +0400, Christophe Fergeau wrote: On Tue, Jan 03, 2012 at 10:08:10PM +, Daniel P. Berrange wrote: Agreed, the way we deal with the XML docs ensures we preserve any parts of the DOM we don't know about. IMHO we should only emit a warning if there is a

Re: [libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

2012-01-03 Thread Christophe Fergeau
On Tue, Jan 03, 2012 at 08:47:02PM +0200, Zeeshan Ali (Khattak) wrote: So FWIW I found the patch in Boxes that causes a problem with current API: https://bugzilla.gnome.org/attachment.cgi?id=204140action=edit Compiling that patch should lead you to this: vm-configurator.c: In