Re: [libvirt] [PATCH 1/2] Add VSCSI bus type and VSCSI controller type for pseries guest.

2012-05-30 Thread Li Zhang
On 05/30/2012 07:25 AM, Cole Robinson wrote: On 05/03/2012 10:05 PM, Li Zhang wrote: Now, there is only SCSI bus and controller type in libvirt. And when configuring VSCSI controller, it needs to configure the spapr-vio bus address type externally. It's a little inconvenient to configure the

[libvirt] [PATCH 1/3] avoid closing uninitialized fd

2012-05-30 Thread Wen Congyang
If the system does not support bypass cache, we will close fd, but it is uninitialized. --- src/qemu/qemu_driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fea9c24..1b3391b 100644 --- a/src/qemu/qemu_driver.c

[libvirt] [PATCH 2/3] avoid closing fd more than once

2012-05-30 Thread Wen Congyang
fdstream: If fd is fds[0] or fds[1], we should set to -1 if we meet some error. childfd is fds[0] or fds[1], so we should close it only when virFDStreamOpenFileInternal() successes. qemu_migration: If we migrate to fd, spec-fwdType is not MIGRATION_FWD_DIRECT, we will

[libvirt] [PATCH 3/3] avoid fd leak

2012-05-30 Thread Wen Congyang
virCommandRunAsync() will set errfd if it successes. We should close it if virFDStreamOpenInternal() fails. --- src/fdstream.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/fdstream.c b/src/fdstream.c index d0ea0ee..f068439 100644 --- a/src/fdstream.c +++

[libvirt] [PATCH] build: Fixed generating of libvirt_qemu_probes.h

2012-05-30 Thread Martin Kletzander
I added libvirt_qemu_probes.h into BUILT_SOURCES. That makes it generated, but most probably it is not the clearest way how to do that, but it fixes the build. --- Feel free to clean this, but for the time being, I'm pushing this as a build breaker. src/Makefile.am |1 + 1 files changed, 1

Re: [libvirt] [PATCH] lxc: return correct number of CPUs

2012-05-30 Thread Martin Kletzander
On 05/29/2012 06:39 PM, Eric Blake wrote: On 05/29/2012 01:12 AM, Martin Kletzander wrote: When getting number of CPUs the host has assigned, there was always number 1 returned. Even though all lxc domains with no pinning launched by libvirt run on all pCPUs (by default, no matter what's the

[libvirt] [PATCH] virCommand: Extend debug message for handshake

2012-05-30 Thread Michal Privoznik
Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return any FDs. Therefore, it's wise to log the other ends as well. --- src/util/command.c |6

Re: [libvirt] [PATCH] build: Fixed generating of libvirt_qemu_probes.h

2012-05-30 Thread Eric Blake
On 05/30/2012 04:15 AM, Martin Kletzander wrote: I added libvirt_qemu_probes.h into BUILT_SOURCES. That makes it generated, but most probably it is not the clearest way how to do that, but it fixes the build. --- Feel free to clean this, but for the time being, I'm pushing this as a build

Re: [libvirt] [PATCH] virCommand: Extend debug message for handshake

2012-05-30 Thread Eric Blake
On 05/30/2012 06:20 AM, Michal Privoznik wrote: Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return any FDs. Therefore, it's wise to log

Re: [libvirt] [PATCH libvirt-java] Return a byte[] array with secretGetValue

2012-05-30 Thread Wido den Hollander
Hi, On 05/26/2012 04:28 AM, Eric Blake wrote: On 03/16/2012 04:08 AM, Wido den Hollander wrote: Signed-off-by: Wido den Hollanderw...@widodh.nl --- No commit message explaining why this is needed? src/main/java/org/libvirt/Secret.java | 11 +--

Re: [libvirt] [PATCH] virCommand: Extend debug message for handshake

2012-05-30 Thread Michal Privoznik
On 30.05.2012 14:45, Eric Blake wrote: On 05/30/2012 06:20 AM, Michal Privoznik wrote: Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return

Re: [libvirt] [PATCH] build: Fixed generating of libvirt_qemu_probes.h

2012-05-30 Thread Eric Blake
On 05/30/2012 06:43 AM, Eric Blake wrote: On 05/30/2012 04:15 AM, Martin Kletzander wrote: I added libvirt_qemu_probes.h into BUILT_SOURCES. That makes it generated, but most probably it is not the clearest way how to do that, but it fixes the build. --- Feel free to clean this, but for the

Re: [libvirt] [PATCH] build: include augeas-gentest.pl and libvirt_qemu_probes.h into dist file

2012-05-30 Thread Eric Blake
On 05/29/2012 08:32 PM, Eric Blake wrote: On 05/29/2012 08:15 PM, Wen Congyang wrote: We generate *.aug from *.aug.in by augeas-gentest.pl, so this script should be included in dist file. This part still needs fixing, We split QEMU dtrace probes into separate file, but we forget include

Re: [libvirt] [PATCH] command: avoid double close bugs

2012-05-30 Thread Eric Blake
On 05/29/2012 09:51 PM, Wen Congyang wrote: At 05/30/2012 09:20 AM, Eric Blake Wrote: KAMEZAWA Hiroyuki reported a nasty double-free bug when virCommand is used to convert a string into input to a child command. The problem is that the poll() loop of virCommandProcessIO would close() the

Re: [libvirt] [PATCH 1/3] avoid closing uninitialized fd

2012-05-30 Thread Eric Blake
On 05/30/2012 03:20 AM, Wen Congyang wrote: If the system does not support bypass cache, we will close fd, but it is uninitialized. --- src/qemu/qemu_driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

Re: [libvirt] [PATCH 3/3] avoid fd leak

2012-05-30 Thread Eric Blake
On 05/30/2012 03:20 AM, Wen Congyang wrote: virCommandRunAsync() will set errfd if it successes. We should s/successes/succeeds/ close it if virFDStreamOpenInternal() fails. --- src/fdstream.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/fdstream.c

Re: [libvirt] [PATCH] build: Fixed generating of libvirt_qemu_probes.h

2012-05-30 Thread Martin Kletzander
On 05/30/2012 03:02 PM, Eric Blake wrote: On 05/30/2012 06:43 AM, Eric Blake wrote: On 05/30/2012 04:15 AM, Martin Kletzander wrote: I added libvirt_qemu_probes.h into BUILT_SOURCES. That makes it generated, but most probably it is not the clearest way how to do that, but it fixes the build.

[libvirt] [snmp PATCH 0/2] Cleanup for libvirt-snmp

2012-05-30 Thread Martin Kletzander
This series cleans up the libvirt-snmp codebase with some visual (whitespaces) and semantic (memory leaks) cleanups. Martin Kletzander (2): cleanup: whitespaces removed from ends of lines Stop event thread on server stop autogen.sh |4 +-

[libvirt] [snmp PATCH 1/2] cleanup: whitespaces removed from ends of lines

2012-05-30 Thread Martin Kletzander
--- autogen.sh |4 +- docs/libvirtMib_subagent.pod |4 +- src/LIBVIRT-MIB.txt|4 +- src/libvirtGuestTable-README-FIRST.txt |6 +-

[libvirt] [PATCH] command: Fix debug message during handshake

2012-05-30 Thread Jiri Denemark
Probably a result of copypaste... --- src/util/command.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/command.c b/src/util/command.c index 5b94f1e..8b581cf 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -2538,7 +2538,7 @@ int

Re: [libvirt] [PATCH] command: Fix debug message during handshake

2012-05-30 Thread Michal Privoznik
On 30.05.2012 15:49, Jiri Denemark wrote: Probably a result of copypaste... --- ACK Michal -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [snmp PATCH 2/2] Stop event thread on server stop

2012-05-30 Thread Martin Kletzander
When C-c is sent to the process, the main thread (server) receives it and sets keep_running to 0, but the second thread is still running. Also, the second thread is not cleaned up after pthread_join() or pthread_destroy(). This patch adds the cleanup function before all exit points of the program

Re: [libvirt] [PATCH 2/3] avoid closing fd more than once

2012-05-30 Thread Eric Blake
On 05/30/2012 03:20 AM, Wen Congyang wrote: fdstream: If fd is fds[0] or fds[1], we should set to -1 if we meet some error. childfd is fds[0] or fds[1], so we should close it only when virFDStreamOpenFileInternal() successes. qemu_migration: If we migrate to fd,

[libvirt] [PATCH] file: Log closing filedescriptors

2012-05-30 Thread Jiri Denemark
--- src/util/virfile.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index db3d737..bc7f2c9 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -35,6 +35,7 @@ #include configmake.h #include memory.h #include

Re: [libvirt] [PATCH2 2/1] build: fix testing of augeas files in VPATH builds

2012-05-30 Thread Martin Kletzander
On 05/30/2012 12:03 AM, Eric Blake wrote: Without this fix, a VPATH build (such as used by ./autobuild.sh) fails with messages like: make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/daemon' ../../build-aux/augeas-gentest.pl libvirtd.conf ../../daemon/test_libvirtd.aug.in

Re: [libvirt] [PATCH] build: silence warning from autoconf

2012-05-30 Thread Martin Kletzander
On 05/29/2012 04:18 PM, Eric Blake wrote: Autoconf 2.60 and later insist on using ${datarootdir}, rather than the derived ${datadir} (although the latter defaults to the former, it is possible to set configure arguments so that they differ): config.status: creating libvirt.pc config.status:

Re: [libvirt] [PATCH 3/1] build: use same perl binary throughout build

2012-05-30 Thread Martin Kletzander
On 05/30/2012 12:03 AM, Eric Blake wrote: Some of our rules used $(PERL), while others used 'perl'. Always using the variable allows a developer to point to a different (often better) perl than the default one found on $PATH. * daemon/Makefile.am ($(srcdir)/remote_dispatch.h):

Re: [libvirt] [snmp PATCH 1/2] cleanup: whitespaces removed from ends of lines

2012-05-30 Thread Michal Privoznik
On 30.05.2012 15:29, Martin Kletzander wrote: --- autogen.sh |4 +- docs/libvirtMib_subagent.pod |4 +- src/LIBVIRT-MIB.txt|4 +- src/libvirtGuestTable-README-FIRST.txt |

Re: [libvirt] [PATCH] file: Log closing filedescriptors

2012-05-30 Thread Eric Blake
On 05/30/2012 08:34 AM, Jiri Denemark wrote: --- src/util/virfile.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index db3d737..bc7f2c9 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -35,6 +35,7 @@ #include

Re: [libvirt] [PATCH 3/1] build: use same perl binary throughout build

2012-05-30 Thread Martin Kletzander
On 05/30/2012 01:05 AM, Eric Blake wrote: On 05/29/2012 04:03 PM, Eric Blake wrote: Some of our rules used $(PERL), while others used 'perl'. Always using the variable allows a developer to point to a different (often better) perl than the default one found on $PATH. * daemon/Makefile.am

Re: [libvirt] [snmp PATCH 2/2] Stop event thread on server stop

2012-05-30 Thread Michal Privoznik
On 30.05.2012 15:29, Martin Kletzander wrote: When C-c is sent to the process, the main thread (server) receives it and sets keep_running to 0, but the second thread is still running. Also, the second thread is not cleaned up after pthread_join() or pthread_destroy(). This patch adds the

Re: [libvirt] [PATCH] file: Log closing filedescriptors

2012-05-30 Thread Jiri Denemark
On Wed, May 30, 2012 at 08:48:22 -0600, Eric Blake wrote: On 05/30/2012 08:34 AM, Jiri Denemark wrote: --- src/util/virfile.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index db3d737..bc7f2c9 100644 ---

Re: [libvirt] [PATCH] file: Log closing filedescriptors

2012-05-30 Thread Eric Blake
On 05/30/2012 08:56 AM, Jiri Denemark wrote: On Wed, May 30, 2012 at 08:48:22 -0600, Eric Blake wrote: On 05/30/2012 08:34 AM, Jiri Denemark wrote: --- src/util/virfile.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index

Re: [libvirt] [snmp PATCH 2/2] Stop event thread on server stop

2012-05-30 Thread Martin Kletzander
On 05/30/2012 04:53 PM, Michal Privoznik wrote: On 30.05.2012 15:29, Martin Kletzander wrote: When C-c is sent to the process, the main thread (server) receives it and sets keep_running to 0, but the second thread is still running. Also, the second thread is not cleaned up after

Re: [libvirt] [PATCH2 2/1] build: fix testing of augeas files in VPATH builds

2012-05-30 Thread Eric Blake
On 05/30/2012 08:39 AM, Martin Kletzander wrote: On 05/30/2012 12:03 AM, Eric Blake wrote: Without this fix, a VPATH build (such as used by ./autobuild.sh) fails with messages like: make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/daemon' ../../build-aux/augeas-gentest.pl

[libvirt] [PATCH] Fixes for check and rpm builds without sanlock (and qemu)

2012-05-30 Thread Martin Kletzander
Apart from the non-sanlock check build, there is also a little fix for qemu (EXTRA_DIST had qemu.conf and others inside even if the build was supposed to be without qemu). --- libvirt.spec.in |5 + src/Makefile.am |6 +- 2 files changed, 10 insertions(+), 1 deletions(-) diff

Re: [libvirt] [PATCH2 2/1] build: fix testing of augeas files in VPATH builds

2012-05-30 Thread Martin Kletzander
On 05/30/2012 05:34 PM, Eric Blake wrote: On 05/30/2012 08:39 AM, Martin Kletzander wrote: On 05/30/2012 12:03 AM, Eric Blake wrote: Without this fix, a VPATH build (such as used by ./autobuild.sh) fails with messages like: make[3]: Entering directory

Re: [libvirt] [PATCH] Fixes for check and rpm builds without sanlock (and qemu)

2012-05-30 Thread Eric Blake
On 05/30/2012 09:35 AM, Martin Kletzander wrote: Apart from the non-sanlock check build, there is also a little fix for qemu (EXTRA_DIST had qemu.conf and others inside even if the build was supposed to be without qemu). --- libvirt.spec.in |5 + src/Makefile.am |6 +- 2

Re: [libvirt] [PATCH] build: include augeas-gentest.pl and libvirt_qemu_probes.h into dist file

2012-05-30 Thread Eric Blake
On 05/30/2012 07:03 AM, Eric Blake wrote: On 05/29/2012 08:32 PM, Eric Blake wrote: On 05/29/2012 08:15 PM, Wen Congyang wrote: We generate *.aug from *.aug.in by augeas-gentest.pl, so this script should be included in dist file. This part still needs fixing, In fact, I've now pushed the

[libvirt] error: this function is not supported by the connection driver : virConnectNumOfStoragePool

2012-05-30 Thread Onkar
Hello, I configured libvirt like this ./configure --prefix=/ --exec-prefix=/usr/ --libdir=/usr/lib64/ --with-storage-dir --with-storage-dir --with-storage-dir --with-storage-dir --with-storage-dir --with-storage-dir --with-storage-dir --with-storage-dir --with-qemu --with-libvirtd

Re: [libvirt] [PATCH] Fixes for check and rpm builds without sanlock (and qemu)

2012-05-30 Thread Eric Blake
On 05/30/2012 10:59 AM, Martin Kletzander wrote: On 05/30/2012 05:50 PM, Eric Blake wrote: On 05/30/2012 09:35 AM, Martin Kletzander wrote: Apart from the non-sanlock check build, there is also a little fix for qemu (EXTRA_DIST had qemu.conf and others inside even if the build was supposed to

Re: [libvirt] [PATCH] Fixes for check and rpm builds without sanlock (and qemu)

2012-05-30 Thread Martin Kletzander
On 05/30/2012 05:50 PM, Eric Blake wrote: On 05/30/2012 09:35 AM, Martin Kletzander wrote: Apart from the non-sanlock check build, there is also a little fix for qemu (EXTRA_DIST had qemu.conf and others inside even if the build was supposed to be without qemu). --- libvirt.spec.in |5

[libvirt] [libvirt-sandbox][PATCH] module lookup and rundir fix

2012-05-30 Thread Radu C.
Hello, I've been trying to get libvirt-sandbox working on my Gentoo box but I ran into some difficulties. The version I'm using is the latest git one. The first problem was the following when running virt-sandbox: Unable to start sandbox: Error opening fileĀ 

Re: [libvirt] [PATCH 3/3] avoid fd leak

2012-05-30 Thread Eric Blake
On 05/30/2012 07:08 AM, Eric Blake wrote: On 05/30/2012 03:20 AM, Wen Congyang wrote: virCommandRunAsync() will set errfd if it successes. We should s/successes/succeeds/ close it if virFDStreamOpenInternal() fails. --- src/fdstream.c |1 + 1 files changed, 1 insertions(+), 0

[libvirt] Compiling out SSL support - status?

2012-05-30 Thread Chris Van Heuveln
Hi, I want to remove TLS from libvirt (0.8.4). I ran across this earlier thread on the same topic: http://www.redhat.com/archives/libvir-list/2012-January/msg00479.html ...just curious if any further development occurred in this area since then? ie, support for a --without-gnutls compiler

[libvirt] [PATCH] SNMP: include inactive domains in guest table

2012-05-30 Thread Jonathan Daugherty
Hi, I've written a patch to include inactive domains in the guest table available via the libvirt-snmp subagent. This makes it possible to start domains via SNMP (a state transition which AFAICT was previously impossible, because inactive domains never appeared in the SNMP result). The code now

Re: [libvirt] [PATCH] SNMP: include inactive domains in guest table

2012-05-30 Thread Eric Blake
On 05/30/2012 04:04 PM, Jonathan Daugherty wrote: Hi, I've written a patch to include inactive domains in the guest table available via the libvirt-snmp subagent. This makes it possible to start domains via SNMP (a state transition which AFAICT was previously impossible, because inactive

Re: [libvirt] [PATCH] SNMP: include inactive domains in guest table

2012-05-30 Thread Jonathan Daugherty
Even better would be to require libvirt 0.9.13 and use the proposed virConnectListAllDomains() API to get all domains in one shot, as the approach you have used is inherently racy due to the flaws in the older APIs (which reminds me, Peter is still working on posting a v2 of that series).

Re: [libvirt] [PATCH 2/3] avoid closing fd more than once

2012-05-30 Thread Wen Congyang
At 05/30/2012 09:17 PM, Eric Blake Wrote: On 05/30/2012 03:20 AM, Wen Congyang wrote: fdstream: If fd is fds[0] or fds[1], we should set to -1 if we meet some error. childfd is fds[0] or fds[1], so we should close it only when virFDStreamOpenFileInternal() successes.

[libvirt] [PATCH] build: fix 'make distcheck' issues

2012-05-30 Thread Eric Blake
We have a distributed file depending on a generated file, which is a no-no for a VPATH build from a read-only source tree (no wonder 'make distcheck' gives us precisely that situation): File `libvirt_driver_remote.la' does not exist. File `libvirt_driver_remote_la-remote_driver.lo'

[libvirt] [PATCH 1/3] avoid closing fd more than once in virFDStreamOpenFileInternal()

2012-05-30 Thread Wen Congyang
When we assign fd and childfd to elements of fds[], we will close these fds more than once on error. So we should assign fds[] to -1 after we assign fd and childfd to elements of fds[]. We should also close childfd on error. --- src/fdstream.c |4 +++- 1 files changed, 3 insertions(+), 1

[libvirt] [PATCH 2/3] qemu: avoid closing fd more than once during migration

2012-05-30 Thread Wen Congyang
If we migrate to fd, spec-fwdType is not MIGRATION_FWD_DIRECT, and we will close spec-dest.fd.local in qemuMigrationRun(). So we should set spec-dest.fd.local to -1 in qemuMigrationRun() because the caller doTunnelMigrate() will close it too. --- src/qemu/qemu_migration.c |4 +++- 1 files

[libvirt] [PATCH 3/3] avoid closing fd more than once when running command fails

2012-05-30 Thread Wen Congyang
We should not set *outfd or *errfd if virExecWithHook() failed, because the caller may close these fds. --- src/util/command.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/command.c b/src/util/command.c index 5b94f1e..aef9131 100644 ---

[libvirt] [PATCHv2 1/4] command: avoid double close bugs

2012-05-30 Thread Eric Blake
KAMEZAWA Hiroyuki reported a nasty double-free bug when virCommand is used to convert a string into input to a child command. The problem is that the poll() loop of virCommandProcessIO would close() the write end of the pipe in order to let the child see EOF, then the caller virCommandRun() would

[libvirt] [PATCHv2 0/4] double close() fixes

2012-05-30 Thread Eric Blake
Updated version of Wen's and my patches. In this version, I fixed review comments, split Wen's patch into 3, and tracked down when each bug was introduced. Eric Blake (2): command: avoid double close bugs fdstream: avoid double close bug Wen Congyang (2): command: check for fork error

[libvirt] [PATCHv2 2/4] fdstream: avoid double close bug

2012-05-30 Thread Eric Blake
Wen Congyang reported that we have a double-close bug if we fail virFDStreamOpenInternal, since childfd duplicated one of the fds[] array contents. In truth, since we always transfer both members of fds to other variables, we should close the fds through those other names, and just use fds[] for

Re: [libvirt] [PATCH 2/3] avoid closing fd more than once

2012-05-30 Thread Eric Blake
On 05/30/2012 09:03 PM, Wen Congyang wrote: At 05/30/2012 09:17 PM, Eric Blake Wrote: On 05/30/2012 03:20 AM, Wen Congyang wrote: fdstream: If fd is fds[0] or fds[1], we should set to -1 if we meet some error. childfd is fds[0] or fds[1], so we should close it only when

[libvirt] [PATCHv2 4/4] qemu: avoid closing fd more than once

2012-05-30 Thread Eric Blake
From: Wen Congyang we...@cn.fujitsu.com If we migrate to fd, spec-fwdType is not MIGRATION_FWD_DIRECT, we will close spec-dest.fd.local in qemuMigrationRun(). So we should set spec-dest.fd.local to -1 in qemuMigrationRun(). Bug present since 0.9.5 (commit 326176179). --- v2: split into separate

[libvirt] [PATCHv2 3/4] command: check for fork error before closing fd

2012-05-30 Thread Eric Blake
From: Wen Congyang we...@cn.fujitsu.com We should not set *outfd or *errfd if virExecWithHook() failed because the caller may close these fds. Bug present since v0.4.5 (commit 60ed1d2a). --- v2: split into separate patch, track down origin src/util/command.c |8 1 files changed,

Re: [libvirt] [PATCHv2 0/4] double close() fixes

2012-05-30 Thread Eric Blake
On 05/30/2012 09:43 PM, Eric Blake wrote: Updated version of Wen's and my patches. In this version, I fixed review comments, split Wen's patch into 3, and tracked down when each bug was introduced. Eric Blake (2): command: avoid double close bugs fdstream: avoid double close bug