Re: [libvirt] [PATCH 5/6] docs: Update formatsecrets to include more examples of each type

2013-08-20 Thread Osier Yang
On 08/08/13 08:43, John Ferlan wrote: Update formatsecret docs to describe the various options and provide examples in order to set up secrets for each type of secret. --- docs/formatsecret.html.in | 156 ++ 1 file changed, 145 insertions(+), 11

Re: [libvirt] [PATCH 4/6] docs: Update the formatdomain disk examples

2013-08-20 Thread Osier Yang
On 20/08/13 05:21, John Ferlan wrote: From e31f3596893302ee1f96d2eb0cf4e006294c528c Mon Sep 17 00:00:00 2001 From: John Ferlanjfer...@redhat.com Date: Wed, 7 Aug 2013 09:05:43 -0400 Subject: [PATCH 4/7] docs: Update the formatdomain disk examples Add more iSCSI examples including having a

[libvirt] [PATCH] util:report diskchain as broken if without enough permission

2013-08-20 Thread Guannan Ren
When backing files of a disk file are stored in NFS shared folder, qemu process requires at least the read permission. But in some rare situation, these backing files can not even be read If so, we should treat the diskchains as broken. This patch add a checking for this, report negative in such

[libvirt] [PATCH 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common dealloc function. This patch also fixes a few forgotten checks of return from

[libvirt] [PATCH 2/3] virsh-pool: Improve error message in cmdPoolList

2013-08-20 Thread Peter Krempa
Explicitly let the user know about the unknown volume name. --- tools/virsh-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index b8fc8d7..592b81f 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1000,7 +1000,7 @@

[libvirt] [PATCH 3/3] virsh: Don't leak list of volumes when undefining domain with storage

2013-08-20 Thread Peter Krempa
Use the new semantics of vshStringToArray to avoid leaking the array of volumes to be deleted. The array would be leaked in case the first volume was found in the domain definition. Also refactor the code a bit to sanitize naming of variables hoding arrays and dimensions of the arrays. Resolves:

[libvirt] [PATCH 1/2] storage: Fix coverity warning

2013-08-20 Thread Osier Yang
Introduced by commit e0139e30444: 1777/* Updating pool metadata */ (40) Event var_deref_op: Dereferencing null pointer newvol. Also see events: [assign_zero] 1778pool-def-allocation += newvol-allocation; 1779pool-def-available -= newvol-allocation; ---

[libvirt] [PATCH 2/2] storage: Fix the use-after-free memory bug

2013-08-20 Thread Osier Yang
Introduced by commit e0139e30444. virStorageVolDefFree free'ed the pointers that are still used by the added volume object, this changes it back to VIR_FREE. --- src/storage/storage_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_driver.c

[libvirt] [PATCH 0/2] Follow up patches for the storage fix.

2013-08-20 Thread Osier Yang
Osier Yang (2): storage: Fix coverity warning storage: Fix the use-after-free memory bug src/storage/storage_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.8.1.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 0/3] Clean up usage of vshStringToArray

2013-08-20 Thread Peter Krempa
Usage of vshStringToArray in virsh was problematic in a few places. Clean it up to avoid a few memleaks. Also improve an error message. Peter Krempa (3): virsh: modify vshStringToArray to duplicate the elements too virsh-pool: Improve error message in cmdPoolList virsh: Don't leak list of

[libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Michal Privoznik
Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't configured any, we set the zero in cgroup subsystem making the kernel kill the corresponding qemu process immediately. The proper fix is to set hard_limit iff user has

Re: [libvirt] [PATCH 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Osier Yang
On 20/08/13 17:05, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common dealloc function. This patch also

Re: [libvirt] [PATCH 2/3] virsh-pool: Improve error message in cmdPoolList

2013-08-20 Thread Osier Yang
On 20/08/13 17:05, Peter Krempa wrote: Explicitly let the user know about the unknown volume name. s/volume name/pool type/, ACK with above. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
On 08/20/13 11:16, Osier Yang wrote: On 20/08/13 17:05, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common

[libvirt] [PATCHv2 0/2] Fix error reporting of virBitmapParse

2013-08-20 Thread Peter Krempa
Please see notes in individual patches. Peter Krempa (2): virBitmapParse: Fix behavior in case of error virBitmapParse: Don't shadow errors po/POTFILES.in | 1 + src/conf/domain_conf.c | 5 + src/conf/network_conf.c | 3 --- src/nodeinfo.c | 5 +

[libvirt] [PATCHv2 2/2] virBitmapParse: Don't shadow errors

2013-08-20 Thread Peter Krempa
A few of the callers of virBitmapParse shadow the returned error. --- Notes: I'm kind of worried that we are making some error messages worse compared to what they were before. If you don't like the way this will turn out, I'll prepare a inverse fix where all callers will be fixed

[libvirt] [PATCHv2 1/2] virBitmapParse: Fix behavior in case of error

2013-08-20 Thread Peter Krempa
Re-arrange the code so that the returned bitmap is always initialized to NULL even on early failures and return an error message as some callers are already expecting it. --- Notes: Version 2: Was already ACKed in v1, but: * fixed bracing of arguments of the _() macro * added

[libvirt] SIGSEGV using virConnect.newStream with Python

2013-08-20 Thread Claudio Bley
Hi. I tried this on Fedora 19, using libvirt 1.0.5 and also tested with git v1.1.1-maint as well as git master on Ubuntu 12.04. How to reproduce: python - import libvirt as l c = l.virConnect(test:///default) v = c.virStream() - Here's my GDB session with git master:

[libvirt] [RFC] QCOW2 version defaults in qemu-img and libvirt

2013-08-20 Thread Ján Tomko
Hello! QEMU is switching the default QCOW2 version from v2 (compat=0.10) to v3 (compat=1.1) [1] Currently, libvirt only specifies the compat=0.10 option if it was explicitly requested (to avoid parsing qemu-img help output [2]) and assumes the format to be v2 when it calls qemu-img without the

Re: [libvirt] [PATCH v2]LXC: Helper function for checking ownership of dir when userns enabled

2013-08-20 Thread Chen HanXiao
Hi Any comments? Thanks -Original Message- From: libvir-list-boun...@redhat.com [mailto:libvir-list-boun...@redhat.com] On Behalf Of Chen HanXiao Sent: Wednesday, August 14, 2013 9:30 AM To: 'Daniel P. Berrange' Cc: libvir-list@redhat.com Subject: Re: [libvirt] [PATCH

Re: [libvirt] [RFC] Expose cpu_map.xml via API

2013-08-20 Thread Daniel P. Berrange
On Mon, Aug 19, 2013 at 08:19:56PM +0200, Giuseppe Scrivano wrote: --- I have started working on: https://bugzilla.redhat.com/show_bug.cgi?id=916786 +/** + * virConnectGetCPUMapDesc: + * + * @conn: virConnect connection + * + * Get the content of the cpu_map.xml file used by the

Re: [libvirt] [PATCH v2] Check for --no-copy-dt-needed linker flag

2013-08-20 Thread Daniel P. Berrange
On Mon, Aug 19, 2013 at 08:07:42PM +0200, Guido Günther wrote: On Mon, Aug 19, 2013 at 11:37:24AM -0600, Eric Blake wrote: On 08/19/2013 11:28 AM, Guido Günther wrote: and use it when available --- configure.ac | 1 + m4/virt-linker-no-indirect.m4 | 30

Re: [libvirt] [PATCH 3/3] virsh: Don't leak list of volumes when undefining domain with storage

2013-08-20 Thread Osier Yang
On 20/08/13 17:05, Peter Krempa wrote: Use the new semantics of vshStringToArray to avoid leaking the array of volumes to be deleted. The array would be leaked in case the first volume was found in the domain definition. Also refactor the code a bit to sanitize naming of variables hoding arrays

Re: [libvirt] [RFC] QCOW2 version defaults in qemu-img and libvirt

2013-08-20 Thread Daniel P. Berrange
On Tue, Aug 20, 2013 at 11:33:36AM +0200, Ján Tomko wrote: Hello! QEMU is switching the default QCOW2 version from v2 (compat=0.10) to v3 (compat=1.1) [1] Currently, libvirt only specifies the compat=0.10 option if it was explicitly requested (to avoid parsing qemu-img help output [2])

Re: [libvirt] [PATCH 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Osier Yang
On 20/08/13 17:20, Peter Krempa wrote: On 08/20/13 11:16, Osier Yang wrote: On 20/08/13 17:05, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with

Re: [libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Osier Yang
On 20/08/13 17:10, Michal Privoznik wrote: Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't configured any, we set the zero in cgroup subsystem making the kernel kill the corresponding qemu process immediately. The

Re: [libvirt] [PATCH 3/3] virsh: Don't leak list of volumes when undefining domain with storage

2013-08-20 Thread Peter Krempa
On 08/20/13 11:58, Osier Yang wrote: On 20/08/13 17:05, Peter Krempa wrote: Use the new semantics of vshStringToArray to avoid leaking the array of volumes to be deleted. The array would be leaked in case the first volume was found in the domain definition. Also refactor the code a bit to

Re: [libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Peter Krempa
On 08/20/13 12:08, Osier Yang wrote: On 20/08/13 17:10, Michal Privoznik wrote: Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't s/default,/default/ configured any, we set the zero in cgroup subsystem making the

Re: [libvirt] [PATCH 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
On 08/20/13 12:01, Osier Yang wrote: On 20/08/13 17:20, Peter Krempa wrote: On 08/20/13 11:16, Osier Yang wrote: On 20/08/13 17:05, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a

Re: [libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Ján Tomko
On 08/20/2013 11:10 AM, Michal Privoznik wrote: Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't configured any, we set the zero in cgroup subsystem making the kernel kill the corresponding qemu process immediately.

Re: [libvirt] [PATCH 3/6] Report secret usage error message similarly

2013-08-20 Thread Ján Tomko
On 08/19/2013 11:09 PM, John Ferlan wrote: On 08/16/2013 12:34 PM, Ján Tomko wrote: On 08/08/2013 02:43 AM, John Ferlan wrote: VIR_SECRET_GET_VALUE_INTERNAL_CALL); if (!secret_value) { -

Re: [libvirt] [PATCH] selinux: distinguish failure to label from request to avoid label

2013-08-20 Thread Daniel P. Berrange
On Mon, Aug 12, 2013 at 10:19:47PM -0600, Eric Blake wrote: https://bugzilla.redhat.com/show_bug.cgi?id=924153 Commit 904e05a2 (v0.9.9) added a per-disk seclabel element with an attribute relabel='no' in order to try and minimize the impact of shutdown delays when an NFS server disappears.

[libvirt] [PATCH] qemuBuildCommandLine: Fall back to mem balloon if there's no hard_limit

2013-08-20 Thread Michal Privoznik
If there's no hard_limit set and domain uses VFIO we still must lock the guest memory (prerequisite from qemu). Hence, we should compute the amount to be locked from max_baloon. --- src/qemu/qemu_command.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git

Re: [libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Michal Privoznik
On 20.08.2013 14:11, Ján Tomko wrote: On 08/20/2013 11:10 AM, Michal Privoznik wrote: Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't configured any, we set the zero in cgroup subsystem making the kernel kill the

Re: [libvirt] [PATCH 4/6] docs: Update the formatdomain disk examples

2013-08-20 Thread John Ferlan
On 08/20/2013 03:43 AM, Osier Yang wrote: On 20/08/13 05:21, John Ferlan wrote: From e31f3596893302ee1f96d2eb0cf4e006294c528c Mon Sep 17 00:00:00 2001 From: John Ferlan jfer...@redhat.com Date: Wed, 7 Aug 2013 09:05:43 -0400 Subject: [PATCH 4/7] docs: Update the formatdomain disk examples

Re: [libvirt] [PATCH 0/3] Fix bitmap parsing code and add tests

2013-08-20 Thread Peter Krempa
On 08/16/13 14:41, Peter Krempa wrote: On 08/16/13 12:39, Daniel P. Berrange wrote: On Fri, Aug 16, 2013 at 12:32:06PM +0200, Peter Krempa wrote: The bitmap parsing code might cause a crash of the application using it. Fix it and add tests so that it doesn't happen again. Peter Krempa (3):

Re: [libvirt] [PATCH] qemuSetupMemoryCgroup: Handle hard_limit properly

2013-08-20 Thread Ján Tomko
On 08/20/2013 03:09 PM, Michal Privoznik wrote: On 20.08.2013 14:11, Ján Tomko wrote: On 08/20/2013 11:10 AM, Michal Privoznik wrote: Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default, the limit is zero. Hence, if user hasn't configured any, we set the zero

Re: [libvirt] [PATCH] qemuBuildCommandLine: Fall back to mem balloon if there's no hard_limit

2013-08-20 Thread Eric Blake
On 08/20/2013 07:06 AM, Michal Privoznik wrote: If there's no hard_limit set and domain uses VFIO we still must lock the guest memory (prerequisite from qemu). Hence, we should compute the amount to be locked from max_baloon. s/baloon/balloon/ --- src/qemu/qemu_command.c | 15

Re: [libvirt] [PATCH 01/17] qemu: Typedef monitor callbacks

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:10PM +0200, Jiri Denemark wrote: Otherwise defining variables that hold callbacks pointers is ugly and several places have to be changed when new parameters are added. --- src/qemu/qemu_monitor.c | 6 +- src/qemu/qemu_monitor.h | 171

Re: [libvirt] [PATCH 02/17] qemu: Avoid using global qemu_driver in event handlers

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:11PM +0200, Jiri Denemark wrote: We will have to pass a mock-up of the driver when testing monitor events. --- src/qemu/qemu_capabilities.c | 5 ++- src/qemu/qemu_monitor.c | 24 +++ src/qemu/qemu_monitor.h | 69 --

Re: [libvirt] [PATCH 03/17] qemu: Move qemuDomainAttachDeviceDiskLive to qemu_hotplug.c

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:12PM +0200, Jiri Denemark wrote: --- src/qemu/qemu_driver.c | 114 -- src/qemu/qemu_hotplug.c | 142 src/qemu/qemu_hotplug.h | 16 ++ 3 files changed, 134 insertions(+),

Re: [libvirt] [PATCH 05/17] qemuhotplugtest: Generate better output

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:14PM +0200, Jiri Denemark wrote: Each test case label now contains more data useful to identify the test. --- tests/qemuhotplugtest.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) ACK Daniel -- |: http://berrange.com

Re: [libvirt] [PATCH 04/17] qemu: Move qemuDomainDetachDeviceDiskLive to qemu_hotplug.c

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:13PM +0200, Jiri Denemark wrote: --- src/qemu/qemu_driver.c | 52 -- src/qemu/qemu_hotplug.c | 67 - src/qemu/qemu_hotplug.h | 9 +++ 3 files changed, 64 insertions(+),

Re: [libvirt] [PATCH 06/17] qemuhotplugtest: Compare domain XML after device hotplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:15PM +0200, Jiri Denemark wrote: We need to make sure a device is properly added/removed (or not) to a domain definition to check that a hotplug API did not lie to us. --- tests/qemuhotplugtest.c| 67 +--

Re: [libvirt] [PATCH 07/17] qemuhotplugtest: Define QMP_OK for the most common reply

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:16PM +0200, Jiri Denemark wrote: --- tests/qemuhotplugtest.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) ACK Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o-

Re: [libvirt] [PATCH 08/17] qemuxml2argvtest: Add XML for testing device hotplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:17PM +0200, Jiri Denemark wrote: This is a generic XML usable for hotplugging various types of devices. --- .../qemuxml2argv-hotplug-base.args | 7 .../qemuxml2argvdata/qemuxml2argv-hotplug-base.xml | 38 ++

Re: [libvirt] [PATCH 12/17] qemu: Export qemuProcessHandleDeviceDeleted for tests

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:21PM +0200, Jiri Denemark wrote: --- src/Makefile.am | 1 + src/qemu/qemu_process.c | 5 +++-- src/qemu/qemu_process.h | 2 +- src/qemu/qemu_processpriv.h | 37 + 4 files changed, 42 insertions(+), 3

Re: [libvirt] [PATCH 4/6] docs: Update the formatdomain disk examples

2013-08-20 Thread Osier Yang
On 20/08/13 21:10, John Ferlan wrote: On 08/20/2013 03:43 AM, Osier Yang wrote: On 20/08/13 05:21, John Ferlan wrote: From e31f3596893302ee1f96d2eb0cf4e006294c528c Mon Sep 17 00:00:00 2001 From: John Ferlan jfer...@redhat.com Date: Wed, 7 Aug 2013 09:05:43 -0400 Subject: [PATCH 4/7] docs:

Re: [libvirt] [PATCH 10/17] tests: Add support for passing vm to qemu monitor

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:19PM +0200, Jiri Denemark wrote: Some tests need the monitor to operate on an already existing VM object rather than on a new mock-up the monitor test normally creates. --- tests/qemuhotplugtest.c | 2 +- tests/qemumonitorjsontest.c | 26

Re: [libvirt] [PATCH 09/17] qemuhotplugtest: Add tests for virtio disk hotplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:18PM +0200, Jiri Denemark wrote: diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 4712334..bb047fe 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -313,12 +327,22 @@ mymain(void) driver.config =

Re: [libvirt] [PATCH 11/17] tests: Add support for passing driver to qemu monitor

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:20PM +0200, Jiri Denemark wrote: The driver is then passed to monitor event handlers. --- tests/qemuhotplugtest.c | 2 +- tests/qemumonitortestutils.c | 5 +++-- tests/qemumonitortestutils.h | 6 -- 3 files changed, 8 insertions(+), 5 deletions(-) ACK

Re: [libvirt] [PATCH 14/17] qemuhotplugtest: Add support for DEVICE_DELETED event

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:23PM +0200, Jiri Denemark wrote: --- tests/qemuhotplugtest.c | 29 +++-- tests/qemumonitortestutils.c | 2 ++ 2 files changed, 25 insertions(+), 6 deletions(-) ACK Daniel -- |: http://berrange.com -o-

Re: [libvirt] [PATCH 13/17] qemu: Let tests override waiting time for device unplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:22PM +0200, Jiri Denemark wrote: We don't want tests to wait 5 seconds for an event which we know will never come. --- src/Makefile.am | 1 + src/qemu/qemu_hotplug.c | 10 ++ src/qemu/qemu_hotplugpriv.h | 31

Re: [libvirt] [PATCH] qemuBuildCommandLine: Fall back to mem balloon if there's no hard_limit

2013-08-20 Thread Ján Tomko
On 08/20/2013 03:06 PM, Michal Privoznik wrote: If there's no hard_limit set and domain uses VFIO we still must lock the guest memory (prerequisite from qemu). Hence, we should compute the amount to be locked from max_baloon. You forgot about the bookkeepers, didn't you? ---

Re: [libvirt] [PATCH 15/17] qemuhotplugtest: Add tests for async virtio disk detach

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:24PM +0200, Jiri Denemark wrote: --- tests/qemuhotplugtest.c | 23 +++ 1 file changed, 23 insertions(+) ACK Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o-

Re: [libvirt] [PATCH 17/17] qemuhotplugtest: Add tests for virtio SCSI disk hotplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:26PM +0200, Jiri Denemark wrote: --- tests/qemuhotplugtest.c| 18 + .../qemuhotplugtestdata/qemuhotplug-disk-scsi.xml | 7 .../qemuhotplug-hotplug-base+disk-scsi.xml | 46 ++ 3 files

Re: [libvirt] [PATCH 16/17] qemuhotplugtest: Add tests for USB disk hotplug

2013-08-20 Thread Daniel P. Berrange
On Thu, Aug 01, 2013 at 09:28:25PM +0200, Jiri Denemark wrote: --- tests/qemuhotplugtest.c| 17 tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml | 7 .../qemuhotplug-hotplug-base+disk-usb.xml | 45 ++ 3 files

[libvirt] [PATCHv2 2/3] virsh-pool: Improve error message in cmdPoolList

2013-08-20 Thread Peter Krempa
Explicitly let the user know about the unknown pool type. --- Notes: Version 2: * fixed commit message * ACK'd in v1 (would cause conflict if reordering ...) tools/virsh-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-pool.c

[libvirt] [PATCHv2 3/3] virsh: Don't leak list of volumes when undefining domain with storage

2013-08-20 Thread Peter Krempa
Use the new semantics of vshStringToArray to avoid leaking the array of volumes to be deleted. The array would be leaked in case the first volume was found in the domain definition. Also refactor the code a bit to sanitize naming of variables hoding arrays and dimensions of the arrays. Resolves:

[libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common dealloc function. This patch also fixes a few forgotten checks of return from

Re: [libvirt] [PATCH 5/6] docs: Update formatsecrets to include more examples of each type

2013-08-20 Thread John Ferlan
On 08/20/2013 02:09 AM, Osier Yang wrote: On 08/08/13 08:43, John Ferlan wrote: Update formatsecret docs to describe the various options and provide examples in order to set up secrets for each type of secret. --- docs/formatsecret.html.in | 156

[libvirt] [PATCHv2 0/3] Clean up usage of vshStringToArray

2013-08-20 Thread Peter Krempa
Fixed after review from Osier, please see individual patches. Peter Krempa (3): virsh: modify vshStringToArray to duplicate the elements too virsh-pool: Improve error message in cmdPoolList virsh: Don't leak list of volumes when undefining domain with storage tools/virsh-domain.c | 134

[libvirt] Schedule for next release

2013-08-20 Thread Daniel Veillard
To try to stay on the end of month release schedule, I am suggesting to enter the freeze for 1.1.2 next Tuesday, i.e. the 27th Aug, and then shoot for a release on the morning of Monday 2nd of Sep. So unless I hear disagreements, that's the plan :-) Daniel -- Daniel Veillard | Open

Re: [libvirt] [PATCH 1/2] storage: Fix coverity warning

2013-08-20 Thread John Ferlan
On 08/20/2013 05:08 AM, Osier Yang wrote: Introduced by commit e0139e30444: 1777 /* Updating pool metadata */ (40) Event var_deref_op: Dereferencing null pointer newvol. Also see events: [assign_zero] 1778 pool-def-allocation += newvol-allocation; 1779

Re: [libvirt] [PATCH 2/2] storage: Fix the use-after-free memory bug

2013-08-20 Thread John Ferlan
On 08/20/2013 05:08 AM, Osier Yang wrote: Introduced by commit e0139e30444. virStorageVolDefFree free'ed the pointers that are still used by the added volume object, this changes it back to VIR_FREE. --- src/storage/storage_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[libvirt] [PATCH v2] storage: Fix coverity warning

2013-08-20 Thread Osier Yang
Introduced by commit e0139e30444: 1777/* Updating pool metadata */ (40) Event var_deref_op: Dereferencing null pointer newvol. Also see events: [assign_zero] 1778pool-def-allocation += newvol-allocation; 1779pool-def-available -= newvol-allocation; ---

Re: [libvirt] [PATCH v2] storage: Fix coverity warning

2013-08-20 Thread Eric Blake
On 08/20/2013 09:28 AM, Osier Yang wrote: Introduced by commit e0139e30444: 1777 /* Updating pool metadata */ (40) Event var_deref_op: Dereferencing null pointer newvol. Also see events: [assign_zero] 1778 pool-def-allocation += newvol-allocation; 1779

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Osier Yang
On 20/08/13 22:15, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common dealloc function. This patch also

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Eric Blake
On 08/20/2013 08:15 AM, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the common dealloc function. This patch

Re: [libvirt] [PATCHv2 3/3] virsh: Don't leak list of volumes when undefining domain with storage

2013-08-20 Thread Osier Yang
On 20/08/13 22:15, Peter Krempa wrote: Use the new semantics of vshStringToArray to avoid leaking the array of volumes to be deleted. The array would be leaked in case the first volume was found in the domain definition. Also refactor the code a bit to sanitize naming of variables hoding arrays

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Osier Yang
On 20/08/13 23:42, Eric Blake wrote: On 08/20/2013 08:15 AM, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
On 08/20/13 17:42, Eric Blake wrote: On 08/20/2013 08:15 AM, Peter Krempa wrote: At a slightly larger memory expense allow stealing of items from the string array returned from vshStringToArray and turn the result into a string list compatible with virStringSplit. This will allow to use the

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Eric Blake
On 08/20/2013 09:45 AM, Peter Krempa wrote: +++ b/tools/virsh.h @@ -37,6 +37,7 @@ # include virerror.h # include virthread.h # include virnetdevbandwidth.h +# include virstring.h Is this change necessary? It's to import virStringFreeList to virsh as it's used to free the string

Re: [libvirt] [PATCHv2 1/3] virsh: modify vshStringToArray to duplicate the elements too

2013-08-20 Thread Peter Krempa
On 08/20/13 17:56, Eric Blake wrote: On 08/20/2013 09:45 AM, Peter Krempa wrote: +++ b/tools/virsh.h @@ -37,6 +37,7 @@ # include virerror.h # include virthread.h # include virnetdevbandwidth.h +# include virstring.h Is this change necessary? It's to import virStringFreeList to

Re: [libvirt] [PATCH] selinux: distinguish failure to label from request to avoid label

2013-08-20 Thread Eric Blake
On 08/20/2013 07:04 AM, Daniel P. Berrange wrote: On Mon, Aug 12, 2013 at 10:19:47PM -0600, Eric Blake wrote: https://bugzilla.redhat.com/show_bug.cgi?id=924153 The solution is to separate the semantics of a chain that must not be labeled (which the user can set even on persistent domains)

Re: [libvirt] [PATCH] libxl: implement NUMA capabilities reporting

2013-08-20 Thread John Ferlan
On 08/16/2013 05:46 PM, Jim Fehlig wrote: From: Dario Faggioli dario.faggi...@citrix.com ...snip... + + cleanup: +if (ret != 0) { +for (i = 0; i nr_nodes; i++) +VIR_FREE(cpus[i]); +virCapabilitiesFreeNUMAInfo(caps); +} + Coverity got grumpy with

Re: [libvirt] [PATCH] libxl: implement NUMA capabilities reporting

2013-08-20 Thread Eric Blake
On 08/20/2013 11:01 AM, John Ferlan wrote: The following resolves Coverity's complaint and keeps things safer: -for (i = 0; i nr_nodes; i++) +for (i = 0; cpus i nr_nodes; i++) Pre-approved ACK if you want to work that into a formal patch. -- Eric Blake eblake

[libvirt] [PATCH] libxl: Resolve possible NULL dereference

2013-08-20 Thread John Ferlan
If we reached cleanup: prior to allocating cpus, it was possible that 'nr_nodes' had a value, but cpus was NULL leading to a possible NULL deref. Add a 'cpus' as an end condition to for loop --- Will push based upon pre-approved ACK:

Re: [libvirt] [PATCH 0/6] Additional iSCSI/chap changes

2013-08-20 Thread John Ferlan
On 08/07/2013 08:43 PM, John Ferlan wrote: These patches address a couple of issues I ran into while doing extra testing on the iSCSI chap authentication patches: https://www.redhat.com/archives/libvir-list/2013-July/msg01378.html The first 2 or 3 patches should be candidiates to be put

Re: [libvirt] [PATCH] python: return dictionay without value in case of no blockjob

2013-08-20 Thread Eric Blake
On 07/15/2013 04:13 AM, Guannan Ren wrote: On 07/13/2013 01:36 AM, Michal Privoznik wrote: On 17.05.2013 08:30, Guannan Ren wrote: s/dictionay/dictionary/ in $SUBJ Currently, when there is no blockjob, dom.blockJobInfo('vda') still reports error because it didn't distinguish return value 0

[libvirt] [PATCH 1/2] Simplify RELRO_LDFLAGS

2013-08-20 Thread Guido Günther
by adding it to AM_LDFLAGS instead of every linking rule and by avoiding a forked grep. --- Daniel kind of nacked the AM_LDFLAGS part already but I think it's a reasonable cleanup. We should rather use AM_LDFLAGS everywhere which (we currently don't and which would be another cleanup). Or are

Re: [libvirt] [PATCH 1/2] Simplify RELRO_LDFLAGS

2013-08-20 Thread Eric Blake
On 08/20/2013 08:39 AM, Guido Günther wrote: by adding it to AM_LDFLAGS instead of every linking rule and by avoiding a forked grep. --- Daniel kind of nacked the AM_LDFLAGS part already but I think it's a reasonable cleanup. We should rather use AM_LDFLAGS everywhere which (we currently

[libvirt] [PATCH 2/2 v3] Check for --no-copy-dt-needed linker flag

2013-08-20 Thread Guido Günther
and use it when available --- configure.ac | 1 + daemon/Makefile.am| 1 + m4/virt-linker-no-indirect.m4 | 30 ++ src/Makefile.am | 1 + tests/Makefile.am | 1 + tools/Makefile.am | 1 + 6 files

Re: [libvirt] [PATCH v2] Check for --no-copy-dt-needed linker flag

2013-08-20 Thread Guido Günther
On Mon, Aug 19, 2013 at 01:36:36PM -0600, Eric Blake wrote: On 08/19/2013 12:07 PM, Guido Günther wrote: +NO_INDIRECT_LDFLAGS= +`$LD --help 21 | grep -- --no-copy-dt-needed-entries /dev/null` \ Doesn't do what you think (it tries to execute the output of grep - which is

[libvirt] [PATCH] docs: Reformat disk attribute description in formatdomain

2013-08-20 Thread John Ferlan
Reformat the description to more cleanly delineate the attributes for a disk element. --- Similar to the recently changed source attribute. docs/formatdomain.html.in | 121 +++--- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git

Re: [libvirt] [PATCH 2/2 v3] Check for --no-copy-dt-needed linker flag

2013-08-20 Thread Eric Blake
On 08/20/2013 08:40 AM, Guido Günther wrote: and use it when available --- +AC_DEFUN([LIBVIRT_LINKER_NO_INDIRECT],[ +AC_MSG_CHECKING([for how to avoid indirect lib deps]) + +NO_INDIRECT_LDFLAGS= +`$LD --help 21 | grep -- --no-copy-dt-needed-entries /dev/null` \ +

Re: [libvirt] [PATCH] util:report diskchain as broken if without enough permission

2013-08-20 Thread Eric Blake
On 08/20/2013 01:54 AM, Guannan Ren wrote: When backing files of a disk file are stored in NFS shared folder, qemu process requires at least the read permission. But in some rare situation, these backing files can not even be read If so, we should treat the diskchains as broken. This patch

[libvirt] [PATCH v2 0/9] virsh: More intelligent auto-completion

2013-08-20 Thread Tomas Meszaros
Original series + some fixes/improvements. Tomas Meszaros (9): virsh: C99 style for info_domfstrim and opts_lxc_enter_namespace virsh: Add vshCmdCompleter and vshOptCompleter virsh: Improve readline generators and readline completion virsh: Add vshDomainCompleter virsh: Add

[libvirt] [PATCH v2 1/9] virsh: C99 style for info_domfstrim and opts_lxc_enter_namespace

2013-08-20 Thread Tomas Meszaros
Change info_domfstrim and opts_lxc_enter_namespace initialization style to C99. --- tools/virsh-domain.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index b29f934..5d4913d 100644 --- a/tools/virsh-domain.c

[libvirt] [PATCH v2 3/9] virsh: Improve readline generators and readline completion

2013-08-20 Thread Tomas Meszaros
* vshMalloc is now used in vshDetermineCommandName * vshStrdup instead of vshMalloc + snprintf * joined if's in vshReadlineOptionsCompletionGenerator --- tools/virsh.c | 395 ++ 1 file changed, 373 insertions(+), 22 deletions(-) diff --git

[libvirt] [PATCH v2 4/9] virsh: Add vshDomainCompleter

2013-08-20 Thread Tomas Meszaros
* global variable __my_conn renamed to vshConn * @name is now const char * * label cleanup renamed to error --- tools/virsh.c | 53 + tools/virsh.h | 2 ++ 2 files changed, 55 insertions(+) diff --git a/tools/virsh.c b/tools/virsh.c index

[libvirt] [PATCH v2 6/9] virsh: Add vshRebootShutdownModeCompleter

2013-08-20 Thread Tomas Meszaros
vshRebootShutdownModeCompleter returns available modes for reboot/shutdown commands. --- tools/virsh.c | 28 tools/virsh.h | 1 + 2 files changed, 29 insertions(+) diff --git a/tools/virsh.c b/tools/virsh.c index 85d74ad..965b141 100644 --- a/tools/virsh.c +++

[libvirt] [PATCH v2 5/9] virsh: Add vshSuspendTargetCompleter

2013-08-20 Thread Tomas Meszaros
* label cleanup renamed to error * vshSuspendTargetCompleter added to opts_dom_pm_suspend --- tools/virsh-domain.c | 3 ++- tools/virsh.c| 28 tools/virsh.h| 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c

[libvirt] [PATCH v2 8/9] virsh: Add completer functions to snapshotCmds

2013-08-20 Thread Tomas Meszaros
Add .completer and .completer_flags to snapshotCmds. Provides domain completion for most of the snapshotCmds commands. --- tools/virsh-snapshot.c | 45 - 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/tools/virsh-snapshot.c

[libvirt] [PATCH v2 9/9] virsh: Add completer functions to domMonitoringCmds

2013-08-20 Thread Tomas Meszaros
Add .completer and .completer_flags to domMonitoringCmds. Provides domain completion for domMonitoringCmds commands. --- tools/virsh-domain-monitor.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/tools/virsh-domain-monitor.c

[libvirt] [PATCH v2 2/9] virsh: Add vshCmdCompleter and vshOptCompleter

2013-08-20 Thread Tomas Meszaros
completer and completer_flags added to the _vshCmdDef and _vshCmdOptDef structures so it will be possible for completion generators to conveniently call completer functions with desired flags. --- tools/virsh.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/virsh.h

[libvirt] [PATCH v2 7/9] virsh: Add completer functions to domManaggementCmds

2013-08-20 Thread Tomas Meszaros
* opts_dom_pm_suspend completer initialization for target removed (moved to another patch) --- tools/virsh-domain.c | 230 +++ 1 file changed, 179 insertions(+), 51 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index

Re: [libvirt] [PATCH v2 4/9] virsh: Add vshDomainCompleter

2013-08-20 Thread Eric Blake
On 08/20/2013 02:02 PM, Tomas Meszaros wrote: Your commit message should give a brief summary of your change and why it is important (Add vshDomainCompleter is the what, but you didn't spell out the why - something along the lines of future patches will use this to improve readline completion).

Re: [libvirt] [PATCH v2 1/9] virsh: C99 style for info_domfstrim and opts_lxc_enter_namespace

2013-08-20 Thread Eric Blake
On 08/20/2013 02:02 PM, Tomas Meszaros wrote: Change info_domfstrim and opts_lxc_enter_namespace initialization style to C99. --- tools/virsh-domain.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) ACK. I wonder if it is worth adding a 'make syntax-check' test

Re: [libvirt] [PATCH v2 4/9] virsh: Add vshDomainCompleter

2013-08-20 Thread Eric Blake
On 08/20/2013 02:30 PM, Eric Blake wrote: I'm not a fan of this. We worked hard to get some commands (like 'virsh echo') to NOT need a connection, and this would be undoing that work. I think we should NOT autoconnect UNTIL we reach the point that completion is being attempted on something

  1   2   >