Re: [libvirt] [PATCH V2] storagevol: add nocow to vol xml

2014-07-09 Thread Chun Yan Liu
>>> On 7/9/2014 at 07:25 PM, in message <53bd26a7.9090...@redhat.com>, Ján Tomko wrote: > On 07/08/2014 08:47 AM, Chunyan Liu wrote: > > 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

[libvirt] [PATCH] build: package .pc files for mingw64

2014-07-09 Thread Eric Blake
Commit 65d8c92a fixed the mingw spec file for 32-bit builds, but forgot to make the adjustment for 64-bit builds: Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/eblake/rpmbuild/BUILDROOT/mingw-libvirt-1.2.7-1.fc20.eblake1404944503.x86_64 error: Installed (but unpackaged) file(s)

[libvirt] [PATCH] build: fix gnulib build for mingw

2014-07-09 Thread Eric Blake
Pavel flagged a build regression under mingw, and traced it to a recent flaw in gnulib for working around nl_langinfo. This picks up the fix. * gnulib: Update to latest, for mingw build fixes. Signed-off-by: Eric Blake --- Pushing under the build-breaker rule * .gnulib 9d5efe7...2d28074 (2):

Re: [libvirt] [PATCH v3] libxl: add discard support to libxl_device_disk

2014-07-09 Thread Jim Fehlig
Olaf Hering wrote: > Translate libvirt discard settings into libxl-4.5 discard settings. > > Signed-off-by: Olaf Hering > --- > v3: > passing discard= with old libxl is now a fatal error > v2: > add cast to switch variable to let compiler check if the code handles > all enum values > Thanks

[libvirt] [libvirt-glib] [PATCH v5 1/3] libvirt-gobject-domain: Add _fetch_snapshots

2014-07-09 Thread Timm Bäder
This function can be used to fetch the snapshots of a domain (according to the given GVirDomainSnapshotListFlags) and save them in a domain-internal GHashTable. A function to access them from outside will be added in a later patch. --- libvirt-gobject/libvirt-gobject-domain.c | 86

[libvirt] [libvirt-glib] [PATCH v5 3/3] GVirDomain: Add async version of _fetch_snapshots

2014-07-09 Thread Timm Bäder
--- libvirt-gobject/libvirt-gobject-domain.c | 61 libvirt-gobject/libvirt-gobject-domain.h | 10 ++ libvirt-gobject/libvirt-gobject.sym | 2 ++ 3 files changed, 73 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/li

[libvirt] [libvirt-glib] [PATCH v5 2/3] libvirt-gobject-domain: Add _get_snapshots

2014-07-09 Thread Timm Bäder
... which returns a GList of GVirDomainSnapshots, i.e. without any tree structure or other relationship between the snapshots. --- libvirt-gobject/libvirt-gobject-domain.c | 21 + libvirt-gobject/libvirt-gobject-domain.h | 4 libvirt-gobject/libvirt-gobject.sym | 1

Re: [libvirt] [libvirt-glib] [PATCH v4 3/3] GVirDomain: Add async version of _fetch_snapshots

2014-07-09 Thread Timm Bäder
On 07.07, Christophe Fergeau wrote: > Hey, > > On Mon, Jun 30, 2014 at 07:50:16PM +0200, Timm Bäder wrote: > > --- > > libvirt-gobject/libvirt-gobject-domain.c | 60 > > > > libvirt-gobject/libvirt-gobject-domain.h | 10 ++ > > libvirt-gobject/libvirt-gobject

Re: [libvirt] [libvirt-glib] [PATCH v4 2/3] libvirt-gobject-domain: Add _get_snapshots

2014-07-09 Thread Timm Bäder
On 07.07, Christophe Fergeau wrote: > Hey, > > On Mon, Jun 30, 2014 at 07:50:15PM +0200, Timm Bäder wrote: > > ... which returns a GList of GVirDomainSnapshots, i.e. without any tree > > structure or other relationship between the snapshots. > > Looks good, ACK. Any plans to return the snapshots

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

2014-07-09 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 1/2] Don't output libvirt-UUID.files for LXC apparmor profiles

2014-07-09 Thread Cédric Bosdonnat
--- src/security/virt-aa-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index b5f66f3..d563b98 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1342,7 +1342,8 @@ main(int

[libvirt] [PATCH 0/2] AppArmor lxc profile fixes

2014-07-09 Thread Cédric Bosdonnat
Hi all, Here are 2 patches fixing AppArmor profiles for lxc containers. The main problem was that the current profile was: 1/ too restricting as it needed to allow all needed applications 2/ used PUx permissions, which made systemd (or bash) run as unprofiled as they have no profiles de

Re: [libvirt] [PATCH] qemu: don't error out when cgroups don't exist

2014-07-09 Thread Eric Blake
On 07/09/2014 02:15 AM, Martin Kletzander wrote: > When creating cgroups for vcpu and emulator threads whilst starting a > domain, we explicitly skip creating those cgroups in case priv->cgroup > is NULL (cgroups not supported) because SetAffinity() serves the same > purpose. If the host supports

Re: [libvirt] [PATCH] check for cfg->spiceTLS earlier in qemuProcessSPICEAllocatePorts

2014-07-09 Thread Eric Blake
On 07/09/2014 03:09 AM, Ján Tomko wrote: > This saves a few lines of code and catches the error when: > > > > is specified with spice_tls = 0 in qemu.conf. > > Instead of this error in qemuBuildGraphicsSPICECommandLine: > error: unsupported configuration: spice secure channels set in XML > co

Re: [libvirt] [PATCH] util: storage: Fix build after 25924dec0f9329d429aadae14e273602307e2214

2014-07-09 Thread Peter Krempa
On 07/09/14 15:01, Eric Blake wrote: > On 07/09/2014 02:05 AM, Peter Krempa wrote: >> The commit referenced above changed function arguments of >> virStorageFileGetMetadataFromBuf() but didn't tweak the >> ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it >> actually obeys them. We

Re: [libvirt] [PATCH] util: storage: Fix build after 25924dec0f9329d429aadae14e273602307e2214

2014-07-09 Thread Eric Blake
On 07/09/2014 02:05 AM, Peter Krempa wrote: > The commit referenced above changed function arguments of > virStorageFileGetMetadataFromBuf() but didn't tweak the > ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it > actually obeys them. We disabled them for GCC and thus it didn't sh

[libvirt] [PATCH 2/3] virSecurityDeviceLabelDef: substitute 'norelabel' with 'relabel'

2014-07-09 Thread Michal Privoznik
Similarly to the previous commit, boolean variables should not start with 'no-' prefix. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 12 ++-- src/security/security_dac.c | 8 src/security/security_selinux.c | 10 +- src/util/virseclabel.c

[libvirt] [PATCH 1/3] virSecurityLabelDef: substitute 'norelabel' with 'relabel'

2014-07-09 Thread Michal Privoznik
This negation in names of boolean variables is driving me insane. The code is much more readable if we drop the 'no-' prefix. Well, at least for me. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 20 ++-- src/security/security_apparmor.c | 10 +- s

[libvirt] [PATCH 3/3] conf: Disallow

2014-07-09 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1113860 The combination of type='none' and relabel='yes' makes no sense as 'none' type basically means relabel='no'. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/

[libvirt] [PATCH 0/3] Couple of seclabels improvements

2014-07-09 Thread Michal Privoznik
Yes, the first two patches basically revert 693eac388f1759d. Only the last one fixes a real problem. Michal Privoznik (3): virSecurityLabelDef: substitute 'norelabel' with 'relabel' virSecurityDeviceLabelDef: substitute 'norelabel' with 'relabel' conf: Disallow src/conf/domain_conf.c

Re: [libvirt] [PATCHv2] conf: Improve metadata type verification

2014-07-09 Thread Peter Krempa
On 07/09/14 14:52, Ján Tomko wrote: > On 07/09/2014 02:44 PM, Peter Krempa wrote: >> Split out checking of invalid metadata type from the switch statement so >> that we can use the typecasted enum value to allow tracking addition of >> new items by the compliler. >> >> Also avoids two dead-code bre

Re: [libvirt] [PATCH] virsh: document the possibility of accepting integers for numatune mode

2014-07-09 Thread Ján Tomko
On 07/09/2014 10:15 AM, Martin Kletzander wrote: > According to the code, 'virsh numatune' supports integers for > specifying --mode as well as the string definitions "strict", > "interleave", and "preferred". However, this possibility was not > documented anywhere, so this patch adds it to both t

Re: [libvirt] [PATCHv2] conf: Improve metadata type verification

2014-07-09 Thread Ján Tomko
On 07/09/2014 02:44 PM, Peter Krempa wrote: > Split out checking of invalid metadata type from the switch statement so > that we can use the typecasted enum value to allow tracking addition of > new items by the compliler. > > Also avoids two dead-code break statements. > --- > Version 2: > - move

Re: [libvirt] [PATCH] qemu: don't error out when cgroups don't exist

2014-07-09 Thread Ján Tomko
On 07/09/2014 02:30 PM, Martin Kletzander wrote: > On Wed, Jul 09, 2014 at 01:07:47PM +0200, Ján Tomko wrote: >> On 07/09/2014 10:15 AM, Martin Kletzander wrote: >>> When creating cgroups for vcpu and emulator threads whilst starting a >>> domain, we explicitly skip creating those cgroups in case p

[libvirt] [PATCHv2] conf: Improve metadata type verification

2014-07-09 Thread Peter Krempa
Split out checking of invalid metadata type from the switch statement so that we can use the typecasted enum value to allow tracking addition of new items by the compliler. Also avoids two dead-code break statements. --- Version 2: - move the check back to the original function so that we don't br

Re: [libvirt] [PATCH] qemu: don't error out when cgroups don't exist

2014-07-09 Thread Martin Kletzander
On Wed, Jul 09, 2014 at 01:07:47PM +0200, Ján Tomko wrote: On 07/09/2014 10:15 AM, Martin Kletzander wrote: When creating cgroups for vcpu and emulator threads whilst starting a domain, we explicitly skip creating those cgroups in case priv->cgroup is NULL (cgroups not supported) because SetAffi

Re: [libvirt] [PATCH V2] storagevol: add nocow to vol xml

2014-07-09 Thread Ján Tomko
On 07/08/2014 08:47 AM, Chunyan Liu wrote: > 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

Re: [libvirt] [PATCH] qemu: don't error out when cgroups don't exist

2014-07-09 Thread Ján Tomko
On 07/09/2014 10:15 AM, Martin Kletzander wrote: > When creating cgroups for vcpu and emulator threads whilst starting a > domain, we explicitly skip creating those cgroups in case priv->cgroup > is NULL (cgroups not supported) because SetAffinity() serves the same > purpose. If the host supports

Re: [libvirt] Build failed in Jenkins: libvirt-syntax-check #2465

2014-07-09 Thread Pádraig Brady
On 07/08/2014 03:38 PM, Eric Blake wrote: > [adding bug-gnulib] > > On 07/08/2014 08:05 AM, Guido Günther wrote: >> On Tue, Jul 08, 2014 at 03:49:02PM +0200, Jenkins CI wrote: >>> 0.43 prohibit_empty_lines_at_EOF >>> prohibit_error_without_use >>> grep: write error >>> grep: write error >>> /bin/s

Re: [libvirt] [RFC][scale] new API for querying domains stats

2014-07-09 Thread Daniel P. Berrange
On Wed, Jul 09, 2014 at 06:14:12AM -0400, Francesco Romani wrote: > > > - Original Message - > > From: "Francesco Romani" > > To: libvir-list@redhat.com > > Sent: Friday, July 4, 2014 6:44:07 PM > > Subject: Re: [libvirt] [RFC][scale] new API for querying domains stats > > > > > However

Re: [libvirt] [RFC][scale] new API for querying domains stats

2014-07-09 Thread Francesco Romani
- Original Message - > From: "Francesco Romani" > To: libvir-list@redhat.com > Sent: Friday, July 4, 2014 6:44:07 PM > Subject: Re: [libvirt] [RFC][scale] new API for querying domains stats > > > However, a question here about bulk APIs. > > > One cornerstone of oVirt is shared storage

Re: [libvirt] [PATCHv5 22/28] util: storage: Return complete parent info from virStorageFileChainLookup

2014-07-09 Thread Peter Krempa
On 07/09/14 01:28, Eric Blake wrote: > On 07/04/2014 05:29 AM, Peter Krempa wrote: >> Instead of just returning the parent path, return the complete parent >> source structure. >> --- >> src/qemu/qemu_driver.c| 16 - >> src/util/virstoragefile.c | 17 -- >> src/util/virstoragef

Re: [libvirt] [PATCHv5 27/28] qemu: snapshot: Refactor image labelling of new snapshot files

2014-07-09 Thread Peter Krempa
On 07/09/14 03:59, Eric Blake wrote: > On 07/04/2014 05:29 AM, Peter Krempa wrote: >> Now that cgroups/security driver/locking driver support labelling of >> individual images and tolerate network storage we don't have to refrain >> from passing all image files to it. This allows to remove checking

Re: [libvirt] [PATCH] qemu: fix domxml-to-native failing when spice_tls is not enabled

2014-07-09 Thread Ján Tomko
On 06/27/2014 04:37 PM, Jincheng Miao wrote: > The default graphics channel mode is 'any', so as to defaultMode attribute. > If defaultMode and channel mode are all the default value 'any', > qemuConnectDomainXMLToNative will set TLSPort. > But in qemuBuildGraphicsSPICECommandLine, if spice_tls is

[libvirt] [PATCH] check for cfg->spiceTLS earlier in qemuProcessSPICEAllocatePorts

2014-07-09 Thread Ján Tomko
This saves a few lines of code and catches the error when: is specified with spice_tls = 0 in qemu.conf. Instead of this error in qemuBuildGraphicsSPICECommandLine: error: unsupported configuration: spice secure channels set in XML configuration, but TLS port is not provided an error is repo

Re: [libvirt] [PATCH] util: storage: Fix build after 25924dec0f9329d429aadae14e273602307e2214

2014-07-09 Thread Peter Krempa
On 07/09/14 10:12, Michal Privoznik wrote: > On 09.07.2014 10:05, Peter Krempa wrote: >> The commit referenced above changed function arguments of >> virStorageFileGetMetadataFromBuf() but didn't tweak the >> ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it >> actually obeys them.

[libvirt] [PATCH] virsh: document the possibility of accepting integers for numatune mode

2014-07-09 Thread Martin Kletzander
According to the code, 'virsh numatune' supports integers for specifying --mode as well as the string definitions "strict", "interleave", and "preferred". However, this possibility was not documented anywhere, so this patch adds it to both the man page and command help. Resolves: https://bugzilla

[libvirt] [PATCH] qemu: don't error out when cgroups don't exist

2014-07-09 Thread Martin Kletzander
When creating cgroups for vcpu and emulator threads whilst starting a domain, we explicitly skip creating those cgroups in case priv->cgroup is NULL (cgroups not supported) because SetAffinity() serves the same purpose. If the host supports only some cgroups (the ones we need are either unmounted

Re: [libvirt] [PATCH] util: storage: Fix build after 25924dec0f9329d429aadae14e273602307e2214

2014-07-09 Thread Michal Privoznik
On 09.07.2014 10:05, Peter Krempa wrote: The commit referenced above changed function arguments of virStorageFileGetMetadataFromBuf() but didn't tweak the ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it actually obeys them. We disabled them for GCC and thus it didn't show up. A

Re: [libvirt] [PATCH 2/3] util: XML: Avoid forward function declaration

2014-07-09 Thread Peter Krempa
On 07/08/14 17:51, Eric Blake wrote: > On 07/08/2014 09:29 AM, Peter Krempa wrote: >> Recursive functions apparently don't need them, but I originally thought >> they do. >> --- >> src/util/virxml.c | 5 - >> 1 file changed, 5 deletions(-) > > ACK. When it comes to static functions, it's onl

[libvirt] [PATCH] util: storage: Fix build after 25924dec0f9329d429aadae14e273602307e2214

2014-07-09 Thread Peter Krempa
The commit referenced above changed function arguments of virStorageFileGetMetadataFromBuf() but didn't tweak the ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it actually obeys them. We disabled them for GCC and thus it didn't show up. Additionally in commit 3ea661deeabadc3c114df

Re: [libvirt] [PATCH] virEventPollDispatchHandles: Honour array boundaries

2014-07-09 Thread Ján Tomko
On 07/09/2014 09:57 AM, Michal Privoznik wrote: > When dispatching events from the event loop, the array of registered > handles is searched to see what handles happened an event on. However, > the array is searched in weird way: the check for the array boundaries > is at the end, so we may touch t

[libvirt] [PATCH] virEventPollDispatchHandles: Honour array boundaries

2014-07-09 Thread Michal Privoznik
When dispatching events from the event loop, the array of registered handles is searched to see what handles happened an event on. However, the array is searched in weird way: the check for the array boundaries is at the end, so we may touch the elements after the end of the array: ==10434== Inval

Re: [libvirt] [PATCH] util: cgroup: Fix build on non-cgroup platforms

2014-07-09 Thread Peter Krempa
On 07/09/14 07:11, Martin Kletzander wrote: > On Tue, Jul 08, 2014 at 05:40:40PM +0200, Peter Krempa wrote: >> Commit 48f44510098cead629ede9a49ea4e840a28ccca introduced a helper > > You probably meant a48f44510098cead629ede9a49ea4e840a28ccca. > I've fixed the typos pointed by Eric and also return