Re: [libvirt] [PATCH 4/4] util: print errno in virObjectLockableNew

2014-07-15 Thread Jincheng Miao
- Original Message - > Oh, sorry; /me facepalms... > > You're right then, but if you want to change it everywhere in the code > (which I don't require), it would be better to create a > virMutexInitInternal that takes 2 parameters; the second being a bool > that controls error reporting an

Re: [libvirt] [PATCH 4/4] util: print errno in virObjectLockableNew

2014-07-15 Thread Martin Kletzander
On Tue, Jul 15, 2014 at 10:47:04PM -0400, Jincheng Miao wrote: - Original Message - I'm not sure errno is set when using our virMutexInit(). Most of the code uses virReportError instead, I suggest using that. This should Actually, the implement of virMutexInit() already set errno whe

Re: [libvirt] [PATCH] spec: Update polkit dependencies for CVE-2013-4311

2014-07-15 Thread Jiri Denemark
On Tue, Jul 15, 2014 at 17:09:29 -0600, Eric Blake wrote: > On 07/15/2014 07:23 AM, Jiri Denemark wrote: > > Use secured polkit on distros which provide it. However, RHEL-6 will > > still allow for older polkit-0.93 rather than forcing polkit-0.96-5 > > which is not available in all RHEL-6 releases

[libvirt] Changing the default qemu path in libvirt

2014-07-15 Thread satheesh
Hi All, I would like to change the default qemu path in libvirt xml and the changed path has to be used while installing VMs using virt-install. There was a similar question rasied some years back, I could not find the answer to the same. http://www.redhat.com/archives/libvir-list/2011-December

Re: [libvirt] [PATCH 1/4] qemu: fix wrong errno report in qemuMonitorOpenUnix

2014-07-15 Thread Jincheng Miao
- Original Message - > virProcessKill can be called on cleanup paths. I think it might be wiser > to rewrite virProcessKill() to guarantee that it does not modify errno > than it is to make all callers have to store a temporary. Hi Eric, this virProcessKill only test whether this process

Re: [libvirt] [PATCH 4/4] util: print errno in virObjectLockableNew

2014-07-15 Thread Jincheng Miao
- Original Message - > I'm not sure errno is set when using our virMutexInit(). Most of the > code uses virReportError instead, I suggest using that. This should Actually, the implement of virMutexInit() already set errno when failure: int virMutexInit(virMutexPtr m) { int ret;

[libvirt] [PATCH] spec: drop anything older than Fedora 13

2014-07-15 Thread Eric Blake
RHEL 5 is based on libvirt 0.8.2, as was Fedora 13. RHEL 5 also happens to be the oldest box that we actively support with a buildbot, so it is time to clean up some crufty conditionals in the spec file that no longer are necessary for modern Fedora. Although it is probably okay to make further s

Re: [libvirt] Enable kvm on aarch64, Cleanup F-16/18 conditionals

2014-07-15 Thread Eric Blake
On 07/15/2014 04:29 PM, Peter Robinson wrote: >> Doing an out-of-the-box build on RHEL 5 is the oldest configuration >> still actively (if marginally) supported, ideally for as long as RHEL 5 >> remains a live platform (several more years to go). We have build-bots >> that ensure that we can build

[libvirt] [PATCH] spec: fix invalid syntax

2014-07-15 Thread Eric Blake
Commit 20e01504 broke 'make rpm': error: line 540: Unknown tag: %elif 020 >= 12 || 0 >= 6 Apparently, even though shell has elif so that you can do a chain of conditionals, the rpm spec file does not, and you have to nest things instead. * libvirt.spec.in: Convert %elif to proper nested %if.

Re: [libvirt] [PATCH] spec: Update polkit dependencies for CVE-2013-4311

2014-07-15 Thread Eric Blake
On 07/15/2014 07:23 AM, Jiri Denemark wrote: > Use secured polkit on distros which provide it. However, RHEL-6 will > still allow for older polkit-0.93 rather than forcing polkit-0.96-5 > which is not available in all RHEL-6 releases. > > Signed-off-by: Jiri Denemark > --- > libvirt.spec.in | 8

[libvirt] [libvirt-glib v3 4/4] Add gvir_config_domain_cpu_set_model()

2014-07-15 Thread Zeeshan Ali (Khattak)
Add a method to set model of domain CPU. --- libvirt-gconfig/libvirt-gconfig-domain-cpu.c | 11 +++ libvirt-gconfig/libvirt-gconfig-domain-cpu.h | 4 libvirt-gconfig/libvirt-gconfig.sym | 2 ++ 3 files changed, 17 insertions(+) diff --git a/libvirt-gconfig/libvirt-gconfig-

[libvirt] CPU model API (v3)

2014-07-15 Thread Zeeshan Ali (Khattak)
v3: Two classes for CPU model: * CapabilitiesCpuModel * DomainCpuModel that derives from CapabilitiesCpuModel. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [libvirt-glib v3 2/4] Add gvir_config_capabilities_cpu_get_model()

2014-07-15 Thread Zeeshan Ali (Khattak)
Add a method to get the model of the CPU from capabilities. --- libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c | 23 ++ libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h | 3 +++ libvirt-gconfig/libvirt-gconfig.sym| 2 ++ 3 files changed, 28 insertions(+)

[libvirt] [libvirt-glib v3 1/4] Add GVirConfigCapabilitiesCpuModel class

2014-07-15 Thread Zeeshan Ali (Khattak)
Add a class to represent 'model' node under capabilities/host/cpu. --- libvirt-gconfig/Makefile.am| 2 + .../libvirt-gconfig-capabilities-cpu-model.c | 94 ++ .../libvirt-gconfig-capabilities-cpu-model.h | 72 + libvirt-gconf

[libvirt] [libvirt-glib v3 3/4] Add GVirConfigDomainCpuModel class

2014-07-15 Thread Zeeshan Ali (Khattak)
Add a class to represent 'model' node under domain/cpu. --- libvirt-gconfig/Makefile.am| 2 + libvirt-gconfig/libvirt-gconfig-domain-cpu-model.c | 75 ++ libvirt-gconfig/libvirt-gconfig-domain-cpu-model.h | 68 libvirt-gconfig/libvi

Re: [libvirt] Enable kvm on aarch64, Cleanup F-16/18 conditionals

2014-07-15 Thread Eric Blake
On 07/15/2014 04:00 PM, Peter Robinson wrote: [reformatting to avoid top-posting] > On Tue, Jul 15, 2014 at 6:52 PM, Daniel P. Berrange wrote: >> Historically we've kept support for building libvirt against >> Fedora versions even if unsupported by Fedora itself, because >> we've found people o

Re: [libvirt] [PREPOST 05/17] src/xenxs:Refactor PCI parsing code

2014-07-15 Thread Eric Blake
On 07/11/2014 11:09 AM, Jim Fehlig wrote: > David Kiarie wrote: >> + >> +/* pci=[':00:1b.0',':00:13.0'] */ >> +if (!(key = list->str)) >> +goto skippci; >> +if (!(nextkey = strchr(key, ':'))) >> +goto skippci; >> + >> +

Re: [libvirt] [PREPOST 15/17] src/xenxs:Refactor Vif formating code

2014-07-15 Thread Jim Fehlig
David kiarie wrote: > Thanks for the review, am applying changes to address your comments. > Thanks David, looking forward to a V2. BTW, 16/17 and 17/17 look good with exception of the usual whitespace comments. Regards, Jim -- libvir-list mailing list libvir-list@redhat.com https://www.redh

Re: [libvirt] [PREPOST 03/17] src/xenxm:Refactor network config parsing code

2014-07-15 Thread Jim Fehlig
Jim Fehlig wrote: > David Kiarie wrote: > >> From: Kiarie Kahurani >> >> I introduced the function >> xenFormatXMVif(virConfPtr conf, ..); >> which parses network configuration >> >> signed-off-by: David Kiarie >> --- >> src/xenxs/xen_xm.c | 298 >> -

Re: [libvirt] [PATCH 6/6] storage: fs: Don't fail volume update if backing store isn't accessible

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > When the backing store of a volume wasn't accessible while updating the > volume definition the call would fail alltogether. In cases where we s/alltogether/altogether/ > currently (incorrectly) treat remote backing stores as local one this > might le

Re: [libvirt] [PATCH 5/6] storage: fs: Properly parse backing store info

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > Use the backing store parser to properly create the information about a > volume's backing store. Unfortunately as the storage driver isn't > perpared to allow volumes backed by networked filesystems add a s/perpared/prepared/ > workaroud that will av

Re: [libvirt] [PATCH 4/4] virFree: Check const correctness

2014-07-15 Thread Eric Blake
On 07/15/2014 07:46 AM, Eric Blake wrote: > But if you take my suggestion in 2/4 about merely removing the > 'cast-away-const' while still keeping type safety, then a > single-argument virFree() should still be noisy on attempts to VIR_FREE > a const pointer. > > >> @@ -543,11 +543,23 @@ void vi

Re: [libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

2014-07-15 Thread Eric Blake
On 07/15/2014 06:38 AM, Michal Privoznik wrote: > There are just two places where we rely on the fact that VIR_FREE() > macro is without any side effects. In the future, this property of the > macro is going to change, so we need the code to be adjusted to deal > with argument passed to VIR_FREE()

[libvirt] [PATCH v2] util: forbid freeing const pointers

2014-07-15 Thread Eric Blake
Now that we've finally fixed all the violators, it's time to enforce that any pointer to a const object is never freed (it is aliasing some other memory, where the non-const original should be freed instead). Alas, the code still needs a normal vs. Coverity version, but at least we are still guara

Re: [libvirt] [PATCH 4/6] storage: fs: Process backing store data in virStorageBackendProbeTarget

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > Move the processing of the backend metadata directly to the helper > instead of passing it through arguments to the function. > --- > src/storage/storage_backend_fs.c | 72 > ++-- > 1 file changed, 33 insertions(+),

Re: [libvirt] [PATCH 1/4] Fix const correctness

2014-07-15 Thread Eric Blake
On 07/15/2014 06:38 AM, Michal Privoznik wrote: > In many places we define a variable as a 'const char *' when in fact > we modify it just a few lines below. Or even free it. We should not do > that. > > There's one exception though, in xenSessionFree() xenapi_utils.c. We > are freeing the xen_ses

Re: [libvirt] [PATCH 2/6] storage: Track backing store of a volume in the target struct

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > As we have a nested pointer for storing the backing store of a volume > there's no need to store it in a separate struct. > --- > src/conf/storage_conf.c | 53 > --- > src/conf/storage_conf.h

Re: [libvirt] [PATCH 0/2] Implement interface stats for BSD

2014-07-15 Thread Roman Bogorodskiy
Michal Privoznik wrote: > ACK to both patches. Pushed, thanks! Roman Bogorodskiy pgpdVFTqkiyz4.pgp Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Enable kvm on aarch64, Cleanup F-16/18 conditionals

2014-07-15 Thread Daniel P. Berrange
On Tue, Jul 15, 2014 at 11:14:54AM -0600, Eric Blake wrote: > reposting to the upstream list - we'd like to keep the downstream .spec > file in sync with upstream, rather than needlessly diverging. > > On 07/15/2014 10:52 AM, Peter Robinson wrote: > > commit ae37ed3500672f12383825c84dd5ae940fb90ff

Re: [libvirt] [PATCH 0/3] libxl: support hotplug of device

2014-07-15 Thread Jim Fehlig
Chunyan Liu wrote: > This patch series is to add support for attach/detaching an > device. At the same time, add two fixes (1/3 and 3/3) > > Chunyan Liu (3): > libxl: add HOSTDEV type in libxlDomainDetachDeviceConfig > libxl: support hotplug of > libxl: fix return value error Attach|DetachD

Re: [libvirt] Enable kvm on aarch64, Cleanup F-16/18 conditionals

2014-07-15 Thread Eric Blake
reposting to the upstream list - we'd like to keep the downstream .spec file in sync with upstream, rather than needlessly diverging. On 07/15/2014 10:52 AM, Peter Robinson wrote: > commit ae37ed3500672f12383825c84dd5ae940fb90ff8 > Author: Peter Robinson > Date: Tue Jul 15 17:52:18 2014 +0100 >

Re: [libvirt] [PATCH v2 07/16] numatune: Encapsulate numatune configuration in order to unify results

2014-07-15 Thread Eric Blake
On 07/15/2014 02:44 AM, Michal Privoznik wrote: >> >> I take the 'const' as a sign of the fact that I won't be modifying >> any part of the string. Just adding 'const' to a pointer should be >> perfectly OK, but I have not objections to your idea, so I squashed >> this in: > > Well, I look at fr

Re: [libvirt] [PATCH 1/2] Introduce virDomainYesNo enum type

2014-07-15 Thread Eric Blake
On 07/15/2014 04:41 AM, Ján Tomko wrote: >> >> Is it just a matter of coming up with a better name? Maybe: >> >> VIR_TRISTATE_ABSENT = 0, >> VIR_TRISTATE_NO, >> VIR_TRISTATE_YES, > > Without the DOMAIN prefix, this could be used for network_conf.c too. > How about: > VIR_TRISTATE_SWITCH_ABSENT =

Re: [libvirt] [PATCHv3] Rework lxc apparmor profile

2014-07-15 Thread Eric Blake
On 07/15/2014 03:02 AM, Cédric Bosdonnat wrote: > Rework the apparmor lxc profile abstraction to mimic ubuntu's > container-default. > This profile allows quite a lot, but strives to restrict access to > dangerous resources. > > Removing the explicit authorizations to bash, systemd and cron files

Re: [libvirt] [PATCH 3/6] storage: backend: fs: Touch up coding style

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > virStorageBackendFileSystemRefresh() used "cleanup" label just for error > exits and didn't meet libvirt's standard for braces in one case. > --- > src/storage/storage_backend_fs.c | 23 --- > 1 file changed, 12 insertions(+), 11 de

Re: [libvirt] [PATCH 1/6] storage: backend: Fix formatting of function arguments

2014-07-15 Thread Eric Blake
On 07/15/2014 07:25 AM, Peter Krempa wrote: > --- > src/storage/storage_backend.c| 12 ++-- > src/storage/storage_backend_fs.c | 6 +++--- > 2 files changed, 9 insertions(+), 9 deletions(-) ACK; mechanical. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization

Re: [libvirt] [PREPOST 15/17] src/xenxs:Refactor Vif formating code

2014-07-15 Thread David kiarie
Thanks for the review, am applying changes to address your comments. On Tue, Jul 15, 2014 at 1:49 AM, Jim Fehlig wrote: > David Kiarie wrote: >> From: Kiarie Kahurani >> >> Introduce the function >> xenFormatXMDomainNet(..) >> > > On the parsing side, you called this xenParseXMVif. To be

Re: [libvirt] [PATCH] spec: Update polkit dependencies for CVE-2013-4311

2014-07-15 Thread Jiri Denemark
On Tue, Jul 15, 2014 at 07:56:28 -0600, Eric Blake wrote: > On 07/15/2014 07:23 AM, Jiri Denemark wrote: > > Use secured polkit on distros which provide it. However, RHEL-6 will > > still allow for older polkit-0.93 rather than forcing polkit-0.96-5 > > which is not available in all RHEL-6 releases

Re: [libvirt] [PATCH 2/2] Rework lxc apparmor profile

2014-07-15 Thread Serge Hallyn
Quoting Cedric Bosdonnat (cbosdon...@suse.com): > Hi Serge, > > On Mon, 2014-07-14 at 13:55 +, Serge Hallyn wrote: > > Quoting Cédric Bosdonnat (cbosdon...@suse.com): > > > > > diff --git a/examples/apparmor/libvirt-lxc b/examples/apparmor/libvirt-lxc > > > index d404328..4bfb503 100644 > > >

Re: [libvirt] [PATCH] spec: Update polkit dependencies for CVE-2013-4311

2014-07-15 Thread Eric Blake
On 07/15/2014 07:23 AM, Jiri Denemark wrote: > Use secured polkit on distros which provide it. However, RHEL-6 will > still allow for older polkit-0.93 rather than forcing polkit-0.96-5 > which is not available in all RHEL-6 releases. > > Signed-off-by: Jiri Denemark > --- > libvirt.spec.in | 8

Re: [libvirt] [PATCH 0/2] Fix condition value assignments in conditions

2014-07-15 Thread Martin Kletzander
On Tue, Jul 15, 2014 at 02:59:50PM +0200, Ján Tomko wrote: Split into two patches, as we might want to backport the first one somewhere. Ján Tomko (2): Fix error on fs pool build failure Fix assignment of comparison against zero src/storage/storage_backend_fs.c | 2 +- tests/virnettlshelpers.c

Re: [libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

2014-07-15 Thread Ján Tomko
On 07/15/2014 03:38 PM, Michal Privoznik wrote: > On 15.07.2014 14:58, Ján Tomko wrote: >> On 07/15/2014 02:38 PM, Michal Privoznik wrote: >> IMO we should set n to 0 in all *Clear functions, not just >> virNetworkDNSHostDefClear, after which NULL might be dereferenced based on >> the >> n variabl

Re: [libvirt] [PATCH 2/4] viralloc: Honor const correctness in VIR_FREE

2014-07-15 Thread John Ferlan
On 07/15/2014 09:41 AM, Eric Blake wrote: <...snip...> > > This definition was doing two things - casting away const, AND doing > type validation. virFree(&foo) will compile even if foo is an int, but > we want to ensure that foo is of type char*. > > I think what you want is: > > # define

Re: [libvirt] [PATCH 4/4] virFree: Check const correctness

2014-07-15 Thread Eric Blake
On 07/15/2014 06:38 AM, Michal Privoznik wrote: > Up to now it's possible to do something like this: > > const char *ptr; > > ptr = strdup("my example string"); > > VIR_FREE(ptr); > > The problem is, const char * pointers should not be modified (and > freeing them is kind of modification). We s

Re: [libvirt] [PATCH 2/4] viralloc: Honor const correctness in VIR_FREE

2014-07-15 Thread Eric Blake
On 07/15/2014 06:38 AM, Michal Privoznik wrote: > Since we've corrected all the callers that passed a const pointer to > VIR_FREE() we may drop the typecasting horribility and let the macro > be a simple wrapper over the virFree() function. > > Signed-off-by: Michal Privoznik > --- > src/util/vi

Re: [libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

2014-07-15 Thread Michal Privoznik
On 15.07.2014 14:58, Ján Tomko wrote: On 07/15/2014 02:38 PM, Michal Privoznik wrote: There are just two places where we rely on the fact that VIR_FREE() macro is without any side effects. In the future, this property of the macro is going to change, so we need the code to be adjusted to deal wi

Re: [libvirt] [PATCH] qemu: blockcopy: Initialize correct source structure

2014-07-15 Thread Peter Krempa
On 07/15/14 15:24, Eric Blake wrote: > On 07/15/2014 02:35 AM, Peter Krempa wrote: >> 4cc1f1a01fb338de939ba88eb933931687b22336 introduced a crash when doing a >> block copy as virStorageSourceInitChainElement was called on >> "disk->mirror" that is still NULL at that point instead of "mirror" >> wh

Re: [libvirt] [PATCH 4/4] virFree: Check const correctness

2014-07-15 Thread Michal Privoznik
On 15.07.2014 15:27, Martin Kletzander wrote: On Tue, Jul 15, 2014 at 02:38:36PM +0200, Michal Privoznik wrote: Up to now it's possible to do something like this: const char *ptr; ptr = strdup("my example string"); VIR_FREE(ptr); The problem is, const char * pointers should not be modified (

Re: [libvirt] [PATCH 4/4] virFree: Check const correctness

2014-07-15 Thread Martin Kletzander
On Tue, Jul 15, 2014 at 02:38:36PM +0200, Michal Privoznik wrote: Up to now it's possible to do something like this: const char *ptr; ptr = strdup("my example string"); VIR_FREE(ptr); The problem is, const char * pointers should not be modified (and freeing them is kind of modification). We s

Re: [libvirt] [PATCH 1/4] qemu: fix wrong errno report in qemuMonitorOpenUnix

2014-07-15 Thread Eric Blake
On 07/15/2014 02:32 AM, Jincheng Miao wrote: > In qemuMonitorOpenUnix, after connect(), virProcessKill will be > invoked when cpid is not empty. But if the qemu-kvm process exited > early, virProcessKill will flush errno as ESRCH, so the wrong > message will be recorded in log as: > error: qemuMoni

[libvirt] [PATCH 4/6] storage: fs: Process backing store data in virStorageBackendProbeTarget

2014-07-15 Thread Peter Krempa
Move the processing of the backend metadata directly to the helper instead of passing it through arguments to the function. --- src/storage/storage_backend_fs.c | 72 ++-- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/src/storage/storage_backen

[libvirt] [PATCH 6/6] storage: fs: Don't fail volume update if backing store isn't accessible

2014-07-15 Thread Peter Krempa
When the backing store of a volume wasn't accessible while updating the volume definition the call would fail alltogether. In cases where we currently (incorrectly) treat remote backing stores as local one this might lead to strange errors. Ignore the opening errors until we figure out how to trac

[libvirt] [PATCH 5/6] storage: fs: Properly parse backing store info

2014-07-15 Thread Peter Krempa
Use the backing store parser to properly create the information about a volume's backing store. Unfortunately as the storage driver isn't perpared to allow volumes backed by networked filesystems add a workaroud that will avoid changing the XML output. --- src/storage/storage_backend_fs.c | 21 +++

[libvirt] [PATCH 0/6] Fix regression with relative backing names in storage pools

2014-07-15 Thread Peter Krempa
Our recent refactors broke relative backing names in storage pools, fix it partially. Peter Krempa (6): storage: backend: Fix formatting of function arguments storage: Track backing store of a volume in the target struct storage: backend: fs: Touch up coding style storage: fs: Process bac

Re: [libvirt] [PATCH] qemu: blockcopy: Initialize correct source structure

2014-07-15 Thread Eric Blake
On 07/15/2014 02:35 AM, Peter Krempa wrote: > 4cc1f1a01fb338de939ba88eb933931687b22336 introduced a crash when doing a > block copy as virStorageSourceInitChainElement was called on > "disk->mirror" that is still NULL at that point instead of "mirror" > which temporarily holds the mirror source str

[libvirt] [PATCH 2/6] storage: Track backing store of a volume in the target struct

2014-07-15 Thread Peter Krempa
As we have a nested pointer for storing the backing store of a volume there's no need to store it in a separate struct. --- src/conf/storage_conf.c | 53 --- src/conf/storage_conf.h | 1 - src/storage/storage_backend.c | 27 +

[libvirt] [PATCH 1/6] storage: backend: Fix formatting of function arguments

2014-07-15 Thread Peter Krempa
--- src/storage/storage_backend.c| 12 ++-- src/storage/storage_backend_fs.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 7b17ca4..a36996f 100644 --- a/src/storage/storage_backend.c +++ b

[libvirt] [PATCH 3/6] storage: backend: fs: Touch up coding style

2014-07-15 Thread Peter Krempa
virStorageBackendFileSystemRefresh() used "cleanup" label just for error exits and didn't meet libvirt's standard for braces in one case. --- src/storage/storage_backend_fs.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/storage/storage_backend_f

[libvirt] [PATCH] spec: Update polkit dependencies for CVE-2013-4311

2014-07-15 Thread Jiri Denemark
Use secured polkit on distros which provide it. However, RHEL-6 will still allow for older polkit-0.93 rather than forcing polkit-0.96-5 which is not available in all RHEL-6 releases. Signed-off-by: Jiri Denemark --- libvirt.spec.in | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-)

[libvirt] [PATCH 0/2] Fix condition value assignments in conditions

2014-07-15 Thread Ján Tomko
Split into two patches, as we might want to backport the first one somewhere. Ján Tomko (2): Fix error on fs pool build failure Fix assignment of comparison against zero src/storage/storage_backend_fs.c | 2 +- tests/virnettlshelpers.c | 4 ++-- tools/virsh-network.c| 2 +

[libvirt] [PATCH 1/2] Fix error on fs pool build failure

2014-07-15 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1119592 Introduced by commit 62927dd v0.7.6. --- src/storage/storage_backend_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 1615c12..bfaa41f 100644 --- a

[libvirt] [PATCH 2/2] Fix assignment of comparison against zero

2014-07-15 Thread Ján Tomko
Assign the value we're comparing: (val = func()) < 0 instead of assigning the comparison value: (val = func() < 0) Both were introduced along with the code, the TLS tests by commit bd789df in 0.9.4 net events by commit de87691 in 1.2.2. Note that the event id type fix is a no-op: vshNetworkEventI

Re: [libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

2014-07-15 Thread Ján Tomko
On 07/15/2014 02:38 PM, Michal Privoznik wrote: > There are just two places where we rely on the fact that VIR_FREE() > macro is without any side effects. In the future, this property of the > macro is going to change, so we need the code to be adjusted to deal > with argument passed to VIR_FREE()

[libvirt] [PATCH 1/4] Fix const correctness

2014-07-15 Thread Michal Privoznik
In many places we define a variable as a 'const char *' when in fact we modify it just a few lines below. Or even free it. We should not do that. There's one exception though, in xenSessionFree() xenapi_utils.c. We are freeing the xen_session structure which is defined in xen/api/xen_common.h publ

[libvirt] [PATCH 4/4] virFree: Check const correctness

2014-07-15 Thread Michal Privoznik
Up to now it's possible to do something like this: const char *ptr; ptr = strdup("my example string"); VIR_FREE(ptr); The problem is, const char * pointers should not be modified (and freeing them is kind of modification). We should avoid this. A little trick is used: assigning a const pointer

[libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

2014-07-15 Thread Michal Privoznik
There are just two places where we rely on the fact that VIR_FREE() macro is without any side effects. In the future, this property of the macro is going to change, so we need the code to be adjusted to deal with argument passed to VIR_FREE() being evaluated multiple times. Signed-off-by: Michal P

[libvirt] [PATCH 2/4] viralloc: Honor const correctness in VIR_FREE

2014-07-15 Thread Michal Privoznik
Since we've corrected all the callers that passed a const pointer to VIR_FREE() we may drop the typecasting horribility and let the macro be a simple wrapper over the virFree() function. Signed-off-by: Michal Privoznik --- src/util/viralloc.h | 15 +-- 1 file changed, 1 insertion(+),

[libvirt] [PATCH 0/4] Resolve const correctness isues

2014-07-15 Thread Michal Privoznik
Okay, okay. The approach in 4/4 can be considered hackish, but hey - it works! Michal Privoznik (4): Fix const correctness viralloc: Honor const correctness in VIR_FREE VIR_FREE: Avoid doing side work in callees virFree: Check const correctness src/conf/network_conf.c | 12 +

[libvirt] [PATCH v2] qemu: pass numa node binding preferences to qemu

2014-07-15 Thread Martin Kletzander
Currently, we only bind the whole QEMU domain to memory nodes specified in nodemask altogether. That, however, doesn't make much sense when one wants to control from where the memory for particular guest nodes should be allocated. QEMU allows us to do that by specifying 'host-nodes' parameter for

[libvirt] [PATCH v2] conf, schema: add support for memnode elements

2014-07-15 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in | 15 ++ docs/schemas/domaincommon.rng | 17 ++ src/conf/numatune_conf.c | 187 +++-- .../qemuxml2argv-numatune-memnode-no-memory.xml| 30 +

Re: [libvirt] [PATCH v2 09/16] numatune: add support for per-node memory bindings in private APIs

2014-07-15 Thread Martin Kletzander
On Fri, Jul 11, 2014 at 05:11:02PM +0200, Michal Privoznik wrote: On 08.07.2014 13:50, Martin Kletzander wrote: Signed-off-by: Martin Kletzander --- src/conf/numatune_conf.c | 111 --- src/conf/numatune_conf.h | 14 -- src/libvirt_private.sym

Re: [libvirt] [PATCH 1/2] Introduce virDomainYesNo enum type

2014-07-15 Thread Ján Tomko
On 07/14/2014 06:58 PM, Eric Blake wrote: > On 07/14/2014 10:40 AM, Daniel P. Berrange wrote: > > } > -def->os.bios.useserial = VIR_DOMAIN_BIOS_USESERIAL_YES; > +def->os.bios.useserial = VIR_DOMAIN_YES_NO_ENABLED; > } else { > -

Re: [libvirt] [PATCH v2 08/16] conf, schema: add support for memnode elements

2014-07-15 Thread Martin Kletzander
On Fri, Jul 11, 2014 at 05:10:53PM +0200, Michal Privoznik wrote: On 08.07.2014 13:50, Martin Kletzander wrote: Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in | 15 ++ docs/schemas/domaincommon.rng | 17 ++ src/conf/numatune_co

Re: [libvirt] [PATCH 2/4] lxc: print ENOTSUP when usernamespace is not supported

2014-07-15 Thread Martin Kletzander
On Tue, Jul 15, 2014 at 04:32:01PM +0800, Jincheng Miao wrote: In lxcContainerStart, when user namespace is not supported, the virReportSystemError is called. But the first argument should be ENOTSUPP, instead of VIR_ERR_CONFIG_UNSUPPORTED. Signed-off-by: Jincheng Miao --- src/lxc/lxc_container

Re: [libvirt] [PATCH 4/4] util: print errno in virObjectLockableNew

2014-07-15 Thread Martin Kletzander
On Tue, Jul 15, 2014 at 04:32:03PM +0800, Jincheng Miao wrote: In virObjectLockableNew, when virMutexInit fails, virReportSystemError should use errno to get the right error number, instead of VIR_ERR_INTERNAL_ERROR. Signed-off-by: Jincheng Miao --- src/util/virobject.c | 2 +- 1 file changed, 1

Re: [libvirt] [PATCH 2/2] Rework lxc apparmor profile

2014-07-15 Thread Cedric Bosdonnat
Hi Serge, On Mon, 2014-07-14 at 13:55 +, Serge Hallyn wrote: > Quoting Cédric Bosdonnat (cbosdon...@suse.com): > > > diff --git a/examples/apparmor/libvirt-lxc b/examples/apparmor/libvirt-lxc > > index d404328..4bfb503 100644 > > --- a/examples/apparmor/libvirt-lxc > > +++ b/examples/apparmor

[libvirt] [PATCHv3] Rework lxc apparmor profile

2014-07-15 Thread Cédric Bosdonnat
Rework the apparmor lxc profile abstraction to mimic ubuntu's container-default. This profile allows quite a lot, but strives to restrict access to dangerous resources. Removing the explicit authorizations to bash, systemd and cron files, forces them to keep the lxc profile for all applications in

[libvirt] [PATCH V3 1/2] storagevol: add nocow to vol xml

2014-07-15 Thread Chunyan Liu
Add 'nocow' to storage volume xml so that user can have an option to set NOCOW flag to the newly created volume. It's useful on btrfs file system to enhance performance. Btrfs has low performance when hosting VM images, even more when the guest in those VM are also using btrfs as file system. One

[libvirt] [PATCH V3 0/2] storagevol: add 'nocow' option to vol xml

2014-07-15 Thread Chunyan Liu
Add 'nocow' option to vol xml, so that user can have a chance to create a volume with NOCOW flag set on btrfs. It improves performance when the volume is a file image on btrfs and is used in VM environment. --- Changes: * fix typo in V2 * add test case for 'nocow', in separate patch V2 is he

[libvirt] [PATCH V3 2/2] add nocow test case

2014-07-15 Thread Chunyan Liu
Add file in storagevolxml2xmlin and storagevolxml2xmlout, let storagevolxml2xmltest and storagevolschematest cover 'nocow'. Add test case to storagevolxml2argvtest to cover 'nocow'. Signed-off-by: Chunyan Liu --- .../storagevolxml2argvdata/qcow2-nocow-compat.argv | 3 ++ tests/storagevolxml2arg

Re: [libvirt] [PATCH v2 04/16] conf, schema: add 'id' field for cells

2014-07-15 Thread Michal Privoznik
On 15.07.2014 08:23, Martin Kletzander wrote: On Fri, Jul 11, 2014 at 05:11:05PM +0200, Michal Privoznik wrote: On 08.07.2014 13:50, Martin Kletzander wrote: In XML format, by definition, order of fields should not matter, so order of parsing the elements doesn't affect the end result. When sp

Re: [libvirt] [PATCH v2 07/16] numatune: Encapsulate numatune configuration in order to unify results

2014-07-15 Thread Michal Privoznik
On 15.07.2014 08:33, Martin Kletzander wrote: On Fri, Jul 11, 2014 at 05:11:00PM +0200, Michal Privoznik wrote: On 08.07.2014 13:50, Martin Kletzander wrote: There were numerous places where numatune configuration (and thus domain config as well) was changed in different ways. On some places t

[libvirt] [PATCH] qemu: blockcopy: Initialize correct source structure

2014-07-15 Thread Peter Krempa
4cc1f1a01fb338de939ba88eb933931687b22336 introduced a crash when doing a block copy as virStorageSourceInitChainElement was called on "disk->mirror" that is still NULL at that point instead of "mirror" which temporarily holds the mirror source struct until it's fully initialized. This resulted into

[libvirt] [PATCH 3/4] openvz: print EOVERFLOW when barrier:limit are too long

2014-07-15 Thread Jincheng Miao
In openvzReadFSConf, when barrier:limit are so long to overflow, pass EOVERFLOW to virReportSystemError, instead of VIR_ERR_OVERFLOW. Signed-off-by: Jincheng Miao --- src/openvz/openvz_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvz/openvz_conf.c b/src/openv

[libvirt] [PATCH 4/4] util: print errno in virObjectLockableNew

2014-07-15 Thread Jincheng Miao
In virObjectLockableNew, when virMutexInit fails, virReportSystemError should use errno to get the right error number, instead of VIR_ERR_INTERNAL_ERROR. Signed-off-by: Jincheng Miao --- src/util/virobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virobject.c

[libvirt] [PATCH 1/4] qemu: fix wrong errno report in qemuMonitorOpenUnix

2014-07-15 Thread Jincheng Miao
In qemuMonitorOpenUnix, after connect(), virProcessKill will be invoked when cpid is not empty. But if the qemu-kvm process exited early, virProcessKill will flush errno as ESRCH, so the wrong message will be recorded in log as: error: qemuMonitorOpenUnix:309 : failed to connect to monitor socket:

[libvirt] [PATCH 0/4] fix virReportSystemError misuse

2014-07-15 Thread Jincheng Miao
virReportSystemError() reports some OS errors, and the first argument of it should be the error number defined in errno.h. virReportError() reports libvirt errors, and the first argument should be the error number defined in virerrno.h. This patch set fix some misuse of virReportSystemError: pass

[libvirt] [PATCH 2/4] lxc: print ENOTSUP when usernamespace is not supported

2014-07-15 Thread Jincheng Miao
In lxcContainerStart, when user namespace is not supported, the virReportSystemError is called. But the first argument should be ENOTSUPP, instead of VIR_ERR_CONFIG_UNSUPPORTED. Signed-off-by: Jincheng Miao --- src/lxc/lxc_container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

Re: [libvirt] [PATCH 1/2] Introduce virDomainYesNo enum type

2014-07-15 Thread Daniel P. Berrange
On Mon, Jul 14, 2014 at 10:58:27AM -0600, Eric Blake wrote: > On 07/14/2014 10:40 AM, Daniel P. Berrange wrote: > > } > -def->os.bios.useserial = VIR_DOMAIN_BIOS_USESERIAL_YES; > +def->os.bios.useserial = VIR_DOMAIN_YES_NO_ENABLED; >

Re: [libvirt] [libvirt-users] LVM Volume Creation

2014-07-15 Thread Ján Tomko
On 07/15/2014 08:28 AM, Ravi Samji wrote: > Hi All, > > I'm having issue with creating LVM Volume via libvirt. > > We are running libvirtd 1.2 with KVM. > > We are creating Volume Group (VG01) outside of libvirt and defining a storage > pool for it. > Here is the StoragePool XML for the Volume