[libvirt] [libvirt-designer 4/4] virtxml: Errors loading the Osinfo DB are not fatal

2013-01-22 Thread Christophe Fergeau
An error will be reported even if loading partially worked (for example when the system DB could be loaded, but the user DB failed to load). Since the code will still work correctly even if the DB could not be loaded at all, we can ignore the error when DB loading failed. (code still works but

[libvirt] [libvirt-designer 3/4] virtxml: Fix various memory leaks

2013-01-22 Thread Christophe Fergeau
All memory was not cleaned up properly upon exit, and a string could be leaked from guess_os_from_disk when we issue a continue/break early during the loop iteration. --- examples/virtxml.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/virtxml.c

[libvirt] [libvirt-designer 2/4] virtxml: Switch to use osinfo_db_identify_media

2013-01-22 Thread Christophe Fergeau
virtxml is using osinfo_db_guess_os_from_media for that which is deprecated. --- examples/virtxml.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/virtxml.c b/examples/virtxml.c index 18b0456..d719e5f 100644 --- a/examples/virtxml.c +++

[libvirt] [libvirt-designer 1/4] virtxml: Make global var local

2013-01-22 Thread Christophe Fergeau
OsinfoLoader is declared as a global variable in virtxml.c but is only used in one function, so it can be made local. --- examples/virtxml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/virtxml.c b/examples/virtxml.c index 2918ee0..18b0456 100644 ---

Re: [libvirt] [libvirt-glib PATCH] Add smartcard support to libvirt-gconfig

2012-12-19 Thread Christophe Fergeau
On Tue, Dec 18, 2012 at 02:26:53PM +0100, al...@redhat.com wrote: From: Alexander Larsson al...@redhat.com diff --git a/libvirt-gconfig/libvirt-gconfig-domain-smartcard-host-certificates.h b/libvirt-gconfig/libvirt-gconfig-domain-smartcard-host-certificates.h new file mode 100644 index

Re: [libvirt] [libvirt-glib 1/2] Use g_strlcpy instead of strncpy

2012-12-19 Thread Christophe Fergeau
Ping? Christophe On Fri, Dec 14, 2012 at 05:03:37PM +0100, Christophe Fergeau wrote: This guarantees that the string will be nul-terminated. Coverity warned about this issue. --- libvirt-gobject/libvirt-gobject-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [libvirt] [libvirt-glib PATCH] Add smartcard support to libvirt-gconfig

2012-12-19 Thread Christophe Fergeau
I've fixed the space-before-parens nit and pushed this, thanks for the patch! Christophe On Wed, Dec 19, 2012 at 12:21:44PM +0100, Christophe Fergeau wrote: On Tue, Dec 18, 2012 at 02:26:53PM +0100, al...@redhat.com wrote: From: Alexander Larsson al...@redhat.com diff --git a/libvirt

[libvirt] [libvirt-glib 2/2] Fix potential crashes in error cases

2012-12-14 Thread Christophe Fergeau
fetch_list implementations in libvirt-gobject-connection.c and libvirt-gobject-storage-pool.c can misbehave in error situations or when the call is cancelled: - when the call is cancelled, 'lst' will be NULL and 'n' non-0 so we'll try to iterate over 'lst', which will cause a crash - when

[libvirt] [libvirt-glib 1/2] Use g_strlcpy instead of strncpy

2012-12-14 Thread Christophe Fergeau
This guarantees that the string will be nul-terminated. Coverity warned about this issue. --- libvirt-gobject/libvirt-gobject-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-gobject/libvirt-gobject-connection.c

Re: [libvirt] [PATCH] util: rework error reporting in virGet(User|Group)IDByName

2012-12-12 Thread Christophe Fergeau
On Tue, Dec 11, 2012 at 09:30:53PM +0100, Peter Krempa wrote: This patch gets rid of the undeterministic error reporting code done on return values of get(pw|gr)nam_r. With this patch, if the group record is not returned by the corresponding function this error is not considered fatal even if

Re: [libvirt] [PATCH 1/2] util: Don't fail virGetUserIDByName when user not found

2012-12-07 Thread Christophe Fergeau
On Fri, Dec 07, 2012 at 01:40:20AM +0800, Osier Yang wrote: How about make the logic a bit more clear like: if (!pw) { if ((rc == 0) || (rc == EINTR) || (rc == EIO) || (rc == EMFILE) || (rc == ENFILE) || (rc == ENOMEM)) { This does not look right, we want to run the

Re: [libvirt] [PATCH 1/2] util: Don't fail virGetUserIDByName when user not found

2012-12-06 Thread Christophe Fergeau
On Thu, Dec 06, 2012 at 03:07:32PM +0100, Peter Krempa wrote: On 12/05/12 13:03, Christophe Fergeau wrote: virGetUserIDByName is documented as returning 1 if the username cannot be found. getpwnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name

[libvirt] [PATCHv2 1/2] util: Don't fail virGetUserIDByName when user not found

2012-12-06 Thread Christophe Fergeau
virGetUserIDByName is documented as returning 1 if the username cannot be found. getpwnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or uid was not found. » and that: « The formulation given above under RETURN VALUE is from POSIX.1-2001. It does

[libvirt] [PATCHv2 2/2] util: Don't fail virGetGroupIDByName when group not found

2012-12-06 Thread Christophe Fergeau
virGetGroupIDByName is documented as returning 1 if the groupname cannot be found. getgrnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or gid was not found. » and that: « The formulation given above under RETURN VALUE is from POSIX.1-2001. It

[libvirt] [PATCHv2] util: Fix virGet{User, Group}IDByName when the user/group cannot be found

2012-12-06 Thread Christophe Fergeau
Here is the v2 of this patch series. Changes since v1: - return an error only for documented error values returnef from getpwnam_r/getgrnam_r instead of trying to guess what error values mean 'entry not found' - this addresses the indenting comment raised by Osier -- libvir-list mailing list

Re: [libvirt] [PATCHv2 1/2] util: Don't fail virGetUserIDByName when user not found

2012-12-06 Thread Christophe Fergeau
On Thu, Dec 06, 2012 at 05:01:22PM +0100, Peter Krempa wrote: On 12/06/12 15:37, Christophe Fergeau wrote: virGetUserIDByName is documented as returning 1 if the username cannot be found. getpwnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name

[libvirt] [PATCH 2/2] util: Don't fail virGetGroupIDByName when group not found

2012-12-05 Thread Christophe Fergeau
virGetGroupIDByName is documented as returning 1 if the groupname cannot be found. getgrnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or gid was not found. » and that: « The formulation given above under RETURN VALUE is from POSIX.1-2001. It

[libvirt] Fix virGet{User, Group}IDByName when the user/group cannot be found

2012-12-05 Thread Christophe Fergeau
Hey, I've been having issues recently after upgrading to a newer libvirt on a RHEL6 box. 'virsh start vmname' fails with 'error :internal error Failed to get user record for name '107': No such file or directory ' Looking deeper into this, this comes from 'user not found' errors from

[libvirt] [PATCH 1/2] util: Don't fail virGetUserIDByName when user not found

2012-12-05 Thread Christophe Fergeau
virGetUserIDByName is documented as returning 1 if the username cannot be found. getpwnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or uid was not found. » and that: « The formulation given above under RETURN VALUE is from POSIX.1-2001. It does

Re: [libvirt] [PATCH] Correct include-password option for domdisplay

2012-11-23 Thread Christophe Fergeau
On Thu, Nov 22, 2012 at 11:32:38AM +0100, Ján Tomko wrote: On 11/22/12 11:03, Martin Kletzander wrote: I'll rework it to make it as URI as possible then. Just one question, though (for anyone, I guess); why do we append port as a parameter for spice scheme? Martin I think

Re: [libvirt] [libvirt-glib v2] gobject: Also delete storage volume from its pool's list

2012-11-22 Thread Christophe Fergeau
On Wed, Nov 21, 2012 at 08:04:36PM +0200, Zeeshan Ali (Khattak) wrote: From: Zeeshan Ali (Khattak) zeesha...@gnome.org Without this patch, storage pool still lists the volume even after it is deleted. Related Boxes bug: https://bugzilla.gnome.org/show_bug.cgi?id=688724 ---

Re: [libvirt] [libvirt-glib] gobject: Also delete storage volume from its pool's list

2012-11-21 Thread Christophe Fergeau
On Wed, Nov 21, 2012 at 09:30:02AM +0100, Michal Privoznik wrote: On 20.11.2012 19:51, Zeeshan Ali (Khattak) wrote: The latter one has been already checked as can be seen in context of the last chunk. The first one should not fail since it is us who inserted the value into volume-priv-vol;

Re: [libvirt] [libvirt-glib] gobject: Also delete storage volume from its pool's list

2012-11-21 Thread Christophe Fergeau
On Tue, Nov 20, 2012 at 08:51:23PM +0200, Zeeshan Ali (Khattak) wrote: From: Zeeshan Ali (Khattak) zeesha...@gnome.org Without this patch, storage pool still lists the volume even after it is deleted. Related Boxes bug: https://bugzilla.gnome.org/show_bug.cgi?id=688724 ---

[libvirt] [libvirt-glib] Return an error when virConnectGetVersion returns 0

2012-11-21 Thread Christophe Fergeau
virConnectGetVersion can return 0 'if the version can't be extracted by lack of capabilities'. I've also seen it return 0 when libvirtd 1.0 is running but virsh 0.10.2 is used to get the version. gvir_connection_get_version is documented as returning 0 on error. However, currently it only sets the

Re: [libvirt] [PATCH] virsh: fix uninitialized variable in cmdSnapshotEdit

2012-11-16 Thread Christophe Fergeau
On Thu, Nov 15, 2012 at 11:37:32AM +0100, Ján Tomko wrote: If the domain can't be looked up, name is used unitialized after the cleanup label. Found by coverity. --- tools/virsh-snapshot.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virsh-snapshot.c

Re: [libvirt] [PATCH] virsh: fix uninitialized variable in cmdSnapshotEdit

2012-11-16 Thread Christophe Fergeau
On Fri, Nov 16, 2012 at 12:10:10PM +0100, Ján Tomko wrote: On 11/16/12 11:58, Christophe Fergeau wrote: Shouldn't we call vshError with a different message in the !ret !name case? Christophe vshCommandOptDomain and vshLookupSnapshot already give reasonable error messages in that case

Re: [libvirt] [libvirt-glib 2/2] conn-test: Fix gvir_connection_get_version error check

2012-11-15 Thread Christophe Fergeau
Hey, On Wed, Nov 14, 2012 at 03:45:49PM +0100, Michal Privoznik wrote: On 14.11.2012 15:16, Christophe Fergeau wrote: This method returns a version number, which can be 0, so we cannot check the return value for 0 to know if an error happened. Test if the GError is set instead to detect

Re: [libvirt] [libvirt-glib] Add gvir_domain_update_device() and enums needed for it

2012-11-14 Thread Christophe Fergeau
On Wed, Nov 14, 2012 at 01:12:39AM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 13, 2012 at 8:06 PM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Nov 13, 2012 at 07:22:35PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 13, 2012 at 7:10 PM, Alexander Larsson al...@redhat.com

Re: [libvirt] [libvirt-glib 1/4] gobject: don't try to use pool's volumes before a successful refresh

2012-11-14 Thread Christophe Fergeau
On Tue, Nov 13, 2012 at 06:45:56PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 6, 2012 at 1:45 PM, Christophe Fergeau cferg...@redhat.com wrote: gvir_storage_pool_refresh must be called and must be successful before trying to use gvir_storage_pool_get_volume

Re: [libvirt] [libvirt-glib] miscellaneous fixes

2012-11-14 Thread Christophe Fergeau
On Tue, Nov 13, 2012 at 06:30:26PM +0100, Christophe Fergeau wrote: This series does misc leak fixes in libvirt-glib, as well as an API doc fix, and a deprecation warning fix. Pushed all of this except 4/5, I've split the g_type_init() one into 2 separate commits. Christophe

Re: [libvirt] [libvirt-glib] Introduce gvir_warning/gvir_critical

2012-11-14 Thread Christophe Fergeau
On Tue, Nov 13, 2012 at 06:50:11PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 6, 2012 at 1:41 PM, Christophe Fergeau cferg...@redhat.com wrote: They are similar to g_warning/g_critical, but also log the last libvirt error. They are meant to be called right after a libvirt call failed

Re: [libvirt] [libvirt-glib 1/4] gobject: don't try to use pool's volumes before a successful refresh

2012-11-14 Thread Christophe Fergeau
On Wed, Nov 14, 2012 at 02:05:11PM +0100, Zeeshan Ali (Khattak) wrote: On Wed, Nov 14, 2012 at 10:31 AM, Christophe Fergeau cferg...@redhat.com wrote: On Tue, Nov 13, 2012 at 06:45:56PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 6, 2012 at 1:45 PM, Christophe Fergeau cferg...@redhat.com

[libvirt] [libvirt-glib 1/2] Fix glib version check for g_type_init

2012-11-14 Thread Christophe Fergeau
g_type_init has been deprecated in glib 2.35, not 2.34. With versions older than 2.35, we have to call it or we'll get a runtime failure. --- libvirt-gconfig/libvirt-gconfig-compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-gconfig/libvirt-gconfig-compat.h

[libvirt] [libvirt-glib 2/2] conn-test: Fix gvir_connection_get_version error check

2012-11-14 Thread Christophe Fergeau
This method returns a version number, which can be 0, so we cannot check the return value for 0 to know if an error happened. Test if the GError is set instead to detect errors. --- examples/conn-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/conn-test.c

[libvirt] [libvirt-glib v2] gobject: Fix GMutex leak

2012-11-14 Thread Christophe Fergeau
When GLib deprecated g_mutex_new/g_mutex_free, we introduced a compatibility wrapper to implement these using non-deprecated functions. This was done by allocating 0-filled memory by the mutex, and then letting GLib initialize the structure when needed. However, we must call g_mutex_clear when

Re: [libvirt] [libvirt-glib 1/2] Fix glib version check for g_type_init

2012-11-14 Thread Christophe Fergeau
Hey, On Wed, Nov 14, 2012 at 03:45:00PM +0100, Michal Privoznik wrote: On 14.11.2012 15:16, Christophe Fergeau wrote: g_type_init has been deprecated in glib 2.35, not 2.34. With versions older than 2.35, we have to call it or we'll get a runtime failure. --- libvirt-gconfig/libvirt

Re: [libvirt] [libvirt-glib] Introduce gvir_warning/gvir_critical

2012-11-13 Thread Christophe Fergeau
Ping? Christophe On Tue, Nov 06, 2012 at 01:41:01PM +0100, Christophe Fergeau wrote: They are similar to g_warning/g_critical, but also log the last libvirt error. They are meant to be called right after a libvirt call failed, in other cases g_warning/g_critical are still to be used

[libvirt] [libvirt-glib] gobject: Add gvir_storage_pool_get_{active, persistent}

2012-11-13 Thread Christophe Fergeau
--- This goes on top of the [libvirt-glib 1/4] gobject: don't try to use pool's volumes before a successful refresh series. Christophe libvirt-gobject/libvirt-gobject-storage-pool.c | 15 +++ libvirt-gobject/libvirt-gobject-storage-pool.h | 2 ++

Re: [libvirt] [libvirt-glib 1/4] gobject: don't try to use pool's volumes before a successful refresh

2012-11-13 Thread Christophe Fergeau
Ping for these 4 patches? On Tue, Nov 06, 2012 at 01:45:12PM +0100, Christophe Fergeau wrote: gvir_storage_pool_refresh must be called and must be successful before trying to use gvir_storage_pool_get_volume, gvir_storage_pool_get_volumes and gvir_storage_pool_create_volume. As the storage

[libvirt] [libvirt-glib 2/5] gobject: Error out on NULL name in gvir_storage_pool_get_volume

2012-11-13 Thread Christophe Fergeau
Without this change, gvir_storage_pool_get_volume segfaults when trying to do the hash table lookup with a NULL 'name' key. --- libvirt-gobject/libvirt-gobject-storage-pool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c

[libvirt] [libvirt-glib 1/5] Don't call g_type_init on newer glib

2012-11-13 Thread Christophe Fergeau
, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Christophe Fergeau cferg...@redhat.com + */ + +#ifndef __LIBVIRT_GCONFIG_COMPAT_H__ +#define __LIBVIRT_GCONFIG_COMPAT_H__ + +#include glib-object.h + +#if GLIB_CHECK_VERSION(2, 34, 0) +#define g_type_init() +#endif + +#endif

[libvirt] [libvirt-glib] miscellaneous fixes

2012-11-13 Thread Christophe Fergeau
This series does misc leak fixes in libvirt-glib, as well as an API doc fix, and a deprecation warning fix. Christophe -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [libvirt-glib 3/5] gobject: Fix handle leak on wrapper object creation

2012-11-13 Thread Christophe Fergeau
When creating an object wrapping a libvirt object (GVirDomain, GVirStoragePool, GVirStorageVol), libvirt-gobject gets a reference to a libvirt object to be used as a handle, and then creates the wrapper object by calling g_object_new(..., handle, handle, NULL); However, the underlying libvirt

[libvirt] [libvirt-glib 4/5] gobject: Fix GMutex leak

2012-11-13 Thread Christophe Fergeau
When GLib deprecated g_mutex_new/g_mutex_free, we introduced a compatibility wrapper to implement these using non-deprecated functions. This was done by allocating 0-filled memory by the mutex, and then letting GLib initialize the structure when needed. However, we must call g_mutex_clear when

[libvirt] [libvirt-glib 5/5] stream: Fix small error in gvir_stream_receive doc

2012-11-13 Thread Christophe Fergeau
--- libvirt-gobject/libvirt-gobject-stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-stream.c b/libvirt-gobject/libvirt-gobject-stream.c index f0e43d0..2cb8967 100644 --- a/libvirt-gobject/libvirt-gobject-stream.c +++

Re: [libvirt] [libvirt-glib 1/5] Don't call g_type_init on newer glib

2012-11-13 Thread Christophe Fergeau
On Tue, Nov 13, 2012 at 06:53:48PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 13, 2012 at 6:30 PM, Christophe Fergeau cferg...@redhat.com wrote: diff --git a/libvirt-gconfig/tests/test-domain-parse.c b/libvirt-gconfig/tests/test-domain-parse.c index 11880de..33fc7be 100644

Re: [libvirt] [libvirt-glib] Add gvir_domain_update_device() and enums needed for it

2012-11-13 Thread Christophe Fergeau
On Tue, Nov 13, 2012 at 07:22:35PM +0100, Zeeshan Ali (Khattak) wrote: On Tue, Nov 13, 2012 at 7:10 PM, Alexander Larsson al...@redhat.com wrote: This is a wrapper for virDomainUpdateDeviceFlags. Looks good. ACK. diff --git a/libvirt-gobject/libvirt-gobject.sym

Re: [libvirt] [libvirt-glib] Log virStreamFinish error when it fails

2012-11-06 Thread Christophe Fergeau
On Mon, Nov 05, 2012 at 02:29:27PM +0100, Michal Privoznik wrote: On 05.11.2012 14:21, Christophe Fergeau wrote: GVirObjectStream::finalize() logs a critical() if virStreamFinish fails. This commit adds the libvirt error message to this critical to ease debugging. ACK Actually I'm going

[libvirt] [libvirt-glib] Introduce gvir_warning/gvir_critical

2012-11-06 Thread Christophe Fergeau
They are similar to g_warning/g_critical, but also log the last libvirt error. They are meant to be called right after a libvirt call failed, in other cases g_warning/g_critical are still to be used. --- libvirt-glib/libvirt-glib-error.c | 34 +++

[libvirt] [libvirt-glib 1/4] gobject: don't try to use pool's volumes before a successful refresh

2012-11-06 Thread Christophe Fergeau
gvir_storage_pool_refresh must be called and must be successful before trying to use gvir_storage_pool_get_volume, gvir_storage_pool_get_volumes and gvir_storage_pool_create_volume. As the storage pool refresh can fail for reasons external to libvirt/libvirt-gobject, the library user should check

[libvirt] [libvirt-glib 2/4] gobject: Wrap virStoragePoolDestroy

2012-11-06 Thread Christophe Fergeau
--- libvirt-gobject/libvirt-gobject-storage-pool.c | 90 ++ libvirt-gobject/libvirt-gobject-storage-pool.h | 10 +++ libvirt-gobject/libvirt-gobject.sym| 6 ++ 3 files changed, 106 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c

[libvirt] [libvirt-glib 3/4] gobject: Wrap virStoragePoolUndefine

2012-11-06 Thread Christophe Fergeau
--- libvirt-gobject/libvirt-gobject-storage-pool.c | 90 ++ libvirt-gobject/libvirt-gobject-storage-pool.h | 11 libvirt-gobject/libvirt-gobject.sym| 3 + 3 files changed, 104 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c

[libvirt] [libvirt-glib 4/4] gobject: Wrap virStoragePoolDelete

2012-11-06 Thread Christophe Fergeau
--- libvirt-gobject/libvirt-gobject-storage-pool.c | 105 + libvirt-gobject/libvirt-gobject-storage-pool.h | 11 +++ libvirt-gobject/libvirt-gobject.sym| 3 + 3 files changed, 119 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c

Re: [libvirt] [libvirt-glib] gobject: Add GVirDomainRebootFlags

2012-11-06 Thread Christophe Fergeau
Looks good, ACK Christophe On Wed, Oct 31, 2012 at 11:51:54PM +0200, Zeeshan Ali (Khattak) wrote: From: Zeeshan Ali (Khattak) zeesha...@gnome.org Add flags to be used with gvir_domain_reboot(). --- libvirt-gobject/libvirt-gobject-domain.c | 2 +- libvirt-gobject/libvirt-gobject-domain.h

[libvirt] [libvirt-glib] Log virStreamFinish error when it fails

2012-11-05 Thread Christophe Fergeau
GVirObjectStream::finalize() logs a critical() if virStreamFinish fails. This commit adds the libvirt error message to this critical to ease debugging. --- libvirt-gobject/libvirt-gobject-stream.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH] iohelper: Don't try to fdatasync(stdout)

2012-11-05 Thread Christophe Fergeau
After upgrading to libvirt 1.0.0, I've started getting warnings from libvirt: (gnome-boxes:5965): Libvirt.GObject-CRITICAL **: cannot finish stream: internal error libvirt_iohelper: unable to fsync stdout: Invalid argument On further investigation, in iohelper.c:runIO(), fdatasync can get called

Re: [libvirt] [PATCHv2] Fix disabling of apparmor/selinux security drivers

2012-10-23 Thread Christophe Fergeau
On Mon, Oct 22, 2012 at 02:59:14PM -0600, Eric Blake wrote: On 10/22/2012 03:49 AM, Christophe Fergeau wrote: When using --without-$name --without-secdriver-$name with $name being selinux or apparmor, configure will fail saying that AppArmor/SELinux development package must be installed

[libvirt] [PATCHv2] Fix disabling of apparmor/selinux security drivers

2012-10-22 Thread Christophe Fergeau
When using --without-$name --without-secdriver-$name with $name being selinux or apparmor, configure will fail saying that AppArmor/SELinux development package must be installed. This is caused by a small bug in --with-secdriver-$name handling in configure.ac which treats --without-secdriver-$name

[libvirt] [PATCH] Fix disabling of apparmor security driver

2012-10-21 Thread Christophe Fergeau
When using --without-apparmor --without-secdriver-apparmor, configure will fail saying that AppArmor development package must be installed. This is caused by a small bug in --with-secdriver-apparmor handling in configure.ac which treats --without-secdriver-apparmor as if the user had requested to

Re: [libvirt] [PATCH] Fix disabling of apparmor security driver

2012-10-21 Thread Christophe Fergeau
self NACK, a similar issue seems to be present a bit further in configure.ac, I'll have to look some more and send a v2 Christophe On Sun, Oct 21, 2012 at 08:38:49PM +0200, Christophe Fergeau wrote: When using --without-apparmor --without-secdriver-apparmor, configure will fail saying

Re: [libvirt] [libvirt-glib v2] gconfig: Add API to set domain/pm tree

2012-10-11 Thread Christophe Fergeau
Thanks for figuring out why it was not working for you initially! Especially as this was hiding 2 bugs (one in libvirt documentation and one in this patch). Looks good, as for the very long function prototype lines, I sometimes split them right after the return value: void very_long_foo(Foo

Re: [libvirt] [libvirt-glib] gconfig: Add API to set domain/pm tree

2012-10-10 Thread Christophe Fergeau
with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: + * + * Zeeshan Ali (Khattak) zeesha...@gnome.org + * Christophe Fergeau cferg...@redhat.com + */ + +#include config.h + +#include libvirt

Re: [libvirt] [libvirt-glib PATCH] Add wrappers for virDomainPMWakeup

2012-10-04 Thread Christophe Fergeau
On Wed, Oct 03, 2012 at 03:45:53PM +0200, Michal Privoznik wrote: On 03.10.2012 14:23, Alexander Larsson wrote: +gboolean gvir_domain_wakeup(GVirDomain *dom, +guint flags, +GError **err) Maybe we could use gvir_domain_pmwakeup here;

Re: [libvirt] [libvirt-glib 1/2] gobject: Handle PMSUSPENDED state from libvirt

2012-10-03 Thread Christophe Fergeau
On Fri, Sep 28, 2012 at 07:01:23PM +0200, Christophe Fergeau wrote: Emit a signal when switching to the PMSUSPENDED state, and add an enum entry to describe this state. This avoids runtime warnings with newer libvirt. This also breaks compilation with older libvirt, so we need to either bump

Re: [libvirt] [libvirt-glib PATCH] Add wrappers for virDomainPMWakeup

2012-10-03 Thread Christophe Fergeau
Looks good, ACK. Christophe On Wed, Oct 03, 2012 at 02:23:01PM +0200, Alexander Larsson wrote: --- libvirt-gobject/libvirt-gobject-domain.c | 87 libvirt-gobject/libvirt-gobject-domain.h | 11 libvirt-gobject/libvirt-gobject.sym | 4 ++ 3 files

[libvirt] [libvirt-glib 2/2] build-sys: Raise libvirt requirement to 0.10.2

2012-10-03 Thread Christophe Fergeau
The recent PMSuspend changes need libvirt 0.10.2 or newer. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 369b368..c117106 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ AC_CANONICAL_HOST

[libvirt] [libvirt-glib 1/2] spec: Get min libvirt version from configure.ac

2012-10-03 Thread Christophe Fergeau
The minimum libvirt version we need is duplicated in configure.ac and libvirt.spec.in. Since libvirt.spec.in already gets some variables substituted, we can also substitute LIBVIRT_REQUIRED to avoid the duplication. --- configure.ac | 1 + libvirt-glib.spec.in | 2 +- 2 files changed, 2

[libvirt] [libvirt-glib 1/2] gobject: Handle PMSUSPENDED state from libvirt

2012-09-28 Thread Christophe Fergeau
Emit a signal when switching to the PMSUSPENDED state, and add an enum entry to describe this state. This avoids runtime warnings with newer libvirt. --- libvirt-gobject/libvirt-gobject-connection.c | 7 +++ libvirt-gobject/libvirt-gobject-domain.c | 11 +++

[libvirt] [libvirt-glib 2/2] gobject: Emit a signal on WAKEUP events

2012-09-28 Thread Christophe Fergeau
This avoids a runtime warning about this kind of event not being handled. --- libvirt-gobject/libvirt-gobject-connection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c index ad7aa07..9628989

[libvirt] [libvirt-glib PATCHv2 1/3] Implement gvir_config_domain_graphics_vnc_set_socket

2012-09-26 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 10 ++ libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h | 3 +++ libvirt-gconfig/libvirt-gconfig.sym | 2 ++ 3 files changed, 15 insertions(+) diff --git

[libvirt] [libvirt-glib PATCHv2 3/3] Implement gvir_config_domain_graphics_spice_get_port

2012-09-26 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c | 8 libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 2 ++ libvirt-gconfig/tests/test-domain-create.c | 1 + 4 files changed, 12 insertions(+)

Re: [libvirt] [libvirt-glib] Don't call g_set_error with a NULL format string

2012-09-25 Thread Christophe Fergeau
Ping? On Wed, Sep 12, 2012 at 04:22:04PM +0200, Christophe Fergeau wrote: From: Jovanka Gulicoska jovanka.gulico...@gmail.com The format string passed to g_set_error cannot be NULL or a runtime warning will be printed. --- libvirt-gobject/libvirt-gobject-stream.c | 6 -- 1 file

Re: [libvirt] [libvirt-glib] Add a few more getters/setters to VNC/SPICE configuration

2012-09-25 Thread Christophe Fergeau
Ping? On Wed, Sep 12, 2012 at 03:55:25PM +0200, Christophe Fergeau wrote: Hey, This patch series implements a few more getters/setters for GVirConfigDomainGraphicsVnc and GVirConfigDomainGraphicsSpice. They will be useful in GNOME Boxes as the same is currently achieved through XPath use

Re: [libvirt] [libvirt-glib PATCHv3] Fix *_new_from_xml

2012-09-25 Thread Christophe Fergeau
Ping? Can this patch go as is, or do we want to go all the way to switching to GInitable as Marc-André suggested in http://www.mail-archive.com/libvir-list@redhat.com/msg59538.html ? Christophe On Tue, Jul 24, 2012 at 05:49:21PM +0200, Christophe Fergeau wrote: For objects with a subtype 'type

Re: [libvirt] [libvirt-glib 1/4] config: Implement gvir_config_domain_graphics_spice_set_listen

2012-09-25 Thread Christophe Fergeau
On Tue, Sep 25, 2012 at 02:07:39PM +0200, Michal Privoznik wrote: Hey, libvirt supports listen on IP address or a network and I think we need to distinguish these. As I understand it, to listen on an IP address or a network, you'd use a listen child node to the graphics node. This patch sets

Re: [libvirt] [libvirt-glib 1/4] config: Implement gvir_config_domain_graphics_spice_set_listen

2012-09-25 Thread Christophe Fergeau
On Tue, Sep 25, 2012 at 03:04:47PM +0200, Michal Privoznik wrote: On 25.09.2012 14:47, Christophe Fergeau wrote: It seems it's not necessarily an IP address but this can be a hostname if the .rng is to be trusted. I had in the back of my mind the possibility of adding _set_listen_address

Re: [libvirt] [libvirt-glib 1/4] config: Implement gvir_config_domain_graphics_spice_set_listen

2012-09-25 Thread Christophe Fergeau
On Tue, Sep 25, 2012 at 03:32:10PM +0100, Daniel P. Berrange wrote: I wonder if we should simply not expose an API for the listen= attribute at all. Only have APIs for reading/writing the listen elements [...] IOW, I don't think applications should need to care about the listen= attribute at

Re: [libvirt] [PATCH] build: fix detection of netcf linked with libnl1

2012-09-24 Thread Christophe Fergeau
Ping ? Christophe On Wed, Sep 19, 2012 at 05:08:08PM +0200, Christophe Fergeau wrote: Commit 9298bfbcb introduced code to detect if netcf is linked with libnl1, and to prefer libnl1 over libnl3 when this is the case. This behaviour can be disabled by setting LIBNL_CFLAGS to any value

Re: [libvirt] [libvirt-designer][PATCH v2] Create manpage for virtxml

2012-09-24 Thread Christophe Fergeau
ACK Christophe On Thu, Sep 20, 2012 at 04:18:34PM +0200, Michal Privoznik wrote: --- diff to v1: -move content from virtxml.pod to virtxml.c -wording and spelling as pointed out by Christophe .gitignore |1 + examples/Makefile.am |9 +++ examples/virtxml.c

Re: [libvirt] [PATCHv2] build: force libnl1 if netcf also used libnl1

2012-09-19 Thread Christophe Fergeau
Hey, On Thu, Sep 13, 2012 at 06:14:05AM -0600, Eric Blake wrote: On 09/12/2012 10:46 PM, Osier Yang wrote: On 2012年09月11日 06:14, Eric Blake wrote: Recent spec file changes ensure that in distro situations, netcf and libvirt will link against the same libnl in order to avoid dumping core.

[libvirt] [PATCH] build: fix detection of netcf linked with libnl1

2012-09-19 Thread Christophe Fergeau
Commit 9298bfbcb introduced code to detect if netcf is linked with libnl1, and to prefer libnl1 over libnl3 when this is the case. This behaviour can be disabled by setting LIBNL_CFLAGS to any value, including the empty string. However, configure.ac sets LIBNL_CFLAGS to before attempting libnl

Re: [libvirt] [libvirt-designer][PATCH 2/6] Create basic documentation

2012-09-19 Thread Christophe Fergeau
On Tue, Sep 18, 2012 at 05:52:25PM +0200, Michal Privoznik wrote: In fact, it's only bare skeleton for gtkdoc This seems to be missing a call to GTK_DOC_CHECK in configure.ac, and potentially DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc=yes in Makefile.am Christophe pgpoIIPtjwEJm.pgp

Re: [libvirt] [libvirt-designer][PATCH 5/6] Create manpage for virtxml

2012-09-19 Thread Christophe Fergeau
On Tue, Sep 18, 2012 at 05:52:28PM +0200, Michal Privoznik wrote: --- .gitignore |1 + examples/Makefile.am | 11 examples/virtxml.pod | 121 ++ It's weird to have it in examples/ while one of the commit adds a

Re: [libvirt] [libvirt-designer][PATCH 0/6] Another functional extension

2012-09-19 Thread Christophe Fergeau
On Tue, Sep 18, 2012 at 05:52:23PM +0200, Michal Privoznik wrote: and couple of fixes for clean RPM build. ACK except for 2/6 and 5/6 (see my comments in the corresponding patches) Christophe pgpVgNqGFEI4a.pgp Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [libvirt-designer][PATCH v2 1/4] virtxml: Init variables

2012-09-14 Thread Christophe Fergeau
On Thu, Sep 13, 2012 at 04:04:28PM +0200, Michal Privoznik wrote: to avoid their uninitialized usage. ACK, I've sent a similar patch but forgot --subject-prefix for some reason... https://www.redhat.com/archives/libvir-list/2012-September/msg00804.html Let's use yours. Christophe ---

Re: [libvirt] [libvirt-designer][PATCH v2 2/4] virtxml: Detect OS from given ISO

2012-09-14 Thread Christophe Fergeau
Hey, Looks good, a few cosmetic comments below, On Thu, Sep 13, 2012 at 04:04:29PM +0200, Michal Privoznik wrote: In some cases telling OS version is redundant as ISO image with specified OS is passed some arguments later as disk. Don't require --os then. --- examples/virtxml.c | 110

Re: [libvirt] [libvirt-designer][PATCH v2 4/4] Implement resources setting

2012-09-14 Thread Christophe Fergeau
On Thu, Sep 13, 2012 at 04:04:31PM +0200, Michal Privoznik wrote: Users can choose between minimum and recommended values for VCPU count and amount of RAM. Moreover, recommended values should inherit defaults from the minimum. --- examples/virtxml.c | 12

Re: [libvirt] [libvirt-designer][PATCH v2 3/4] virtxml: Detect platform from libvirt connection URI

2012-09-14 Thread Christophe Fergeau
Looks good, ACK (would have been easier to review with the load_osinfo changes in a separate patch, this would have halved the size of the patch doing real code changes I think). Christophe On Thu, Sep 13, 2012 at 04:04:30PM +0200, Michal Privoznik wrote: as in nearly all cases users will

Re: [libvirt] [PATCH 1/2] build: allow building with newer glibc-headers and -O0

2012-09-14 Thread Christophe Fergeau
On Fri, Sep 14, 2012 at 11:05:05AM -0600, Eric Blake wrote: On 09/12/2012 09:42 AM, Christophe Fergeau wrote: Fix copied from libvirt, commit by Eric Blake. glibc 2.15 (on Fedora 17) coupled with explicit disabling of optimization during development dies a painful death: /usr

Re: [libvirt] [libvirt-designer][PATCH 0/3] Another cleanup

2012-09-13 Thread Christophe Fergeau
Hey, On Wed, Sep 12, 2012 at 05:09:32PM +0200, Michal Privoznik wrote: to address Chritophe's improvements hints. Ah thanks for polishing these small nits, series looks good to me too. Christophe pgpWJyI3DbVfX.pgp Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [libvirt-glib][PATCH v4 2/2] gobject: Introduce gvir_connection_get_version

2012-09-13 Thread Christophe Fergeau
Hey, Series looks good to me, ACK to both patches. Christophe On Wed, Sep 12, 2012 at 07:42:56PM +0200, Michal Privoznik wrote: which is basically a wrapper for virConnectGetVersion(). --- examples/conn-test.c | 13 +

Re: [libvirt] [libvirt-designer][PATCH v2 1/4] Load osinfo DB on init

2012-09-12 Thread Christophe Fergeau
Hey, I should have looked more in depth at these commits earlier, sorry for the late feedback ;) On Mon, Sep 10, 2012 at 03:58:25PM +0200, Michal Privoznik wrote: diff --git a/libvirt-designer/libvirt-designer-internal.h b/libvirt-designer/libvirt-designer-internal.h new file mode 100644

Re: [libvirt] [libvirt-designer][PATCH v2 4/4] domain: Introduce interface support

2012-09-12 Thread Christophe Fergeau
On Mon, Sep 10, 2012 at 03:58:28PM +0200, Michal Privoznik wrote: Let users add NICs to domains. --- examples/virtxml.c | 78 ++ libvirt-designer/libvirt-designer-domain.c | 83

Re: [libvirt] [libvirt-designer][PATCH v2 2/4] domain: Introduce disk support

2012-09-12 Thread Christophe Fergeau
On Mon, Sep 10, 2012 at 03:58:26PM +0200, Michal Privoznik wrote: +static GList * +gvir_designer_domain_get_supported_disk_bus_types(GVirDesignerDomain *design) +{ +GVirDesignerDomainPrivate *priv = design-priv; +OsinfoDeviceList *dev_list; +GHashTable *bus_hash =

Re: [libvirt] [libvirt-designer][PATCH v2 1/4] Load osinfo DB on init

2012-09-12 Thread Christophe Fergeau
On Wed, Sep 12, 2012 at 11:48:31AM +0200, Michal Privoznik wrote: +osinfo_loader = osinfo_loader_new(); +osinfo_loader_process_default_path(osinfo_loader, err); +if (err) +return FALSE; I'm not sure we want to error out there, see

Re: [libvirt] [libvirt-glib][PATCH 1/2] gobject: Introduce gvir_connection_get_hypervisor_name

2012-09-12 Thread Christophe Fergeau
On Tue, Sep 11, 2012 at 07:42:41PM +0200, Michal Privoznik wrote: which is basically a wrapper for virConnectGetType(). --- examples/conn-test.c | 12 ++ libvirt-gobject/libvirt-gobject-connection.c | 53 ++

Re: [libvirt] [libvirt-glib][PATCH 2/2] gobject: Introduce gvir_connection_get_version

2012-09-12 Thread Christophe Fergeau
On Tue, Sep 11, 2012 at 07:42:42PM +0200, Michal Privoznik wrote: +gboolean +gvir_connection_get_version(GVirConnection *conn, +gulong *version, +GError **err) gulong gvir_connection_get_version(GVirConnection *conn, GError **error)

Re: [libvirt] [libvirt-glib 1/2] Use 1 GB of RAM in Python example (instead of 1 TB)

2012-09-12 Thread Christophe Fergeau
Hey, I've pushed your 2 patches and added your name to the AUTHORS file, thanks for the patches! Christophe On Mon, Sep 10, 2012 at 04:12:43PM +0300, Timo Juhani Lindfors wrote: --- examples/config-demo.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[libvirt] [libvirt-glib 2/4] config: Add 2 more setters to GVirConfigDomainDisplayVnc

2012-09-12 Thread Christophe Fergeau
Implement gvir_config_domain_graphics_vnc_set_listen and gvir_config_domain_graphics_vnc_set_socket. --- libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 19 +++ libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h | 6 ++ libvirt-gconfig/libvirt-gconfig.sym

[libvirt] [libvirt-glib 4/4] config: Add a few GVirConfigDomainGraphicsSpice getters

2012-09-12 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c | 16 libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h | 2 ++ libvirt-gconfig/libvirt-gconfig.sym | 2 ++ libvirt-gconfig/tests/test-domain-create.c | 2 ++ 4 files changed, 22

<    3   4   5   6   7   8   9   10   11   12   >