[libvirt] [PATCH] daemon: fixup refcounting in close callback handling

2016-03-03 Thread Nikolay Shirokovskiy
remoteDispatchConnectCloseCallbackRegister introduced in f484310add53ebdc26a6fdcb88bc398750325b7e has problems. It refcounts network client object and in case of NOOP driver operations for close callback registering/unregistering (any driveres besides vz) nobody will unref it later. As a result cli

[libvirt] [PATCH 4/7] vbox: Initialize @rc

2016-03-03 Thread Michal Privoznik
In vboxAttachDrivesNew and _vboxAttachDrivesOld compiler thinks that @rc may be used uninitialized. Well, not directly, but maybe after some optimization. Yet again, no harm in initializing a variable. In file included from ./util/virthread.h:26:0, from ./datatypes.h:28,

[libvirt] [PATCH 0/7] Couple of -Os fixes

2016-03-03 Thread Michal Privoznik
So while trying to bring down the size of my nss module, one of the things I've tried was compiling with -Os instead of -O3. Interesting errors pop up. Here are the fixes. If you think I should squash some patches together, I will gladly do that. Michal Privoznik (7): virCommandAddEnv: Drop inli

[libvirt] [PATCH 1/7] virCommandAddEnv: Drop inline

2016-03-03 Thread Michal Privoznik
This function is big enough for the compiler to be not inlined. This is the error message I'm seeing: util/vircommand.c: In function 'virCommandAddEnvFormat': util/vircommand.c:1257:1: error: inlining failed in call to 'virCommandAddEnv': call is unlikely and code size would grow [-Werror=inline]

[libvirt] [PATCH 5/7] qemuDomainBlockCommit: Initialize @baseSource

2016-03-03 Thread Michal Privoznik
Yet again, one uninitialized variable. qemu/qemu_driver.c: In function 'qemuDomainBlockCommit': qemu/qemu_driver.c:17194:9: error: 'baseSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] qemuDomainPrepareDiskChainElement(driver, vm, baseSource, ^ S

[libvirt] [PATCH 6/7] virNetworkDefForwardIf: drop inline

2016-03-03 Thread Michal Privoznik
In file included from network/bridge_driver_platform.h:30:0, from network/bridge_driver_platform.c:26: network/bridge_driver_linux.c: In function 'networkRemoveRoutingFirewallRules': ./conf/network_conf.h:350:1: error: inlining failed in call to 'virNetworkDefForwardIf.constprop':

[libvirt] [PATCH 7/7] virStorageBackendLogicalMatchPoolSource: Initialize @thisSource

2016-03-03 Thread Michal Privoznik
storage/storage_backend_logical.c: In function 'virStorageBackendLogicalMatchPoolSource.isra.2': storage/storage_backend_logical.c:618:33: error: 'thisSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] thisSource->devices[j].path))

[libvirt] [PATCH 2/7] virDomainNumatuneNodeSpecified: Drop inline

2016-03-03 Thread Michal Privoznik
The function is exported and called from other places. It shouldn't be inlined then. Signed-off-by: Michal Privoznik --- src/conf/numa_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index b5963ac..e0d5688 100644 --- a/src/co

[libvirt] [PATCH 3/7] virDomainChrRemove: Initialize @ret

2016-03-03 Thread Michal Privoznik
I've seen the following error message during compilation: conf/domain_conf.c: In function 'virDomainChrRemove': conf/domain_conf.c:13666:24: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] virDomainChrDefPtr ret, **arrPtr = NULL;

Re: [libvirt] [PATCH] Reject migration with both --live and --offline when migration requested from other clients/API.

2016-03-03 Thread Jiri Denemark
The subject is too long, it should be shorter than 65 characters. On Thu, Mar 03, 2016 at 01:11:50 -0500, Nitesh Konkar wrote: > --- > src/libvirt-domain.c | 21 + > 1 file changed, 21 insertions(+) > > diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c > index 9491845.

Re: [libvirt] [PATCH] daemon: fixup refcounting in close callback handling

2016-03-03 Thread Erik Skultety
On 03/03/16 09:01, Nikolay Shirokovskiy wrote: > remoteDispatchConnectCloseCallbackRegister introduced in > f484310add53ebdc26a6fdcb88bc398750325b7e has problems. 8-10 symbols should be enough for most projects :) It refcounts > network client object and in case of NOOP driver operations > for c

Re: [libvirt] [PATCH 6/7] virNetworkDefForwardIf: drop inline

2016-03-03 Thread Martin Kletzander
On Thu, Mar 03, 2016 at 09:44:41AM +0100, Michal Privoznik wrote: In file included from network/bridge_driver_platform.h:30:0, from network/bridge_driver_platform.c:26: network/bridge_driver_linux.c: In function 'networkRemoveRoutingFirewallRules': ./conf/network_conf.h:350:1: err

[libvirt] [PATCH] Report error when both live and offline flags are used for migration.

2016-03-03 Thread Nitesh Konkar
--- src/libvirt-domain.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 9491845..dc11945 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3617,6 +3617,15 @@ virDomainMigrate(virDomainPtr domain,

Re: [libvirt] [PATCH 0/7] Couple of -Os fixes

2016-03-03 Thread Martin Kletzander
On Thu, Mar 03, 2016 at 09:44:35AM +0100, Michal Privoznik wrote: So while trying to bring down the size of my nss module, one of the things I've tried was compiling with -Os instead of -O3. Interesting errors pop up. Here are the fixes. If you think I should squash some patches together, I will

[libvirt] [PATCH] qemu: Check if domain is active in GetControlInfo

2016-03-03 Thread Jiri Denemark
Reporting status of a control connection makes no sense for an inactive domain. https://bugzilla.redhat.com/show_bug.cgi?id=1281706 Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c i

[libvirt] [PATCH] qemu: forbid renaming domain which has managedsave file

2016-03-03 Thread Shanzhi Yu
after rename a domain which has managedsave file, the new name domain can't boot up from the state it saved, and the managedsave file will exist with the original name. Signed-off-by: Shanzhi Yu --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_dr

Re: [libvirt] [PATCH] qemu: Check if domain is active in GetControlInfo

2016-03-03 Thread Erik Skultety
On 03/03/16 13:43, Jiri Denemark wrote: > Reporting status of a control connection makes no sense for an inactive > domain. > > https://bugzilla.redhat.com/show_bug.cgi?id=1281706 > > Signed-off-by: Jiri Denemark > --- > src/qemu/qemu_driver.c | 6 ++ > 1 file changed, 6 insertions(+) > >

Re: [libvirt] [PATCH] Use correct LDFLAGS for leaseshelper

2016-03-03 Thread Erik Skultety
On 01/03/16 16:00, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > src/Makefile.am | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/Makefile.am b/src/Makefile.am > index a316b4d..d57d303 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -2810,6 +2810,10 @@ l

[libvirt] [PATCH] tools: do not leak uri in disconnect handler

2016-03-03 Thread Ján Tomko
Commit 035947e introduced a call to virConnectGetURI without a matching free() in virshCatchDisconnect. Also fix vshAdmCatchDisconnect where it was copied by commit 6dd7e42. https://bugzilla.redhat.com/show_bug.cgi?id=1303891 --- tools/virsh.c | 1 + tools/virt-admin.c | 1 + 2 files change

[libvirt] ruby-libvirt mixed storage migration

2016-03-03 Thread Tim Förster - Hetzner Online AG
Heyho guys, is there any reason why mixed storage migration is restriced. I am unable to serve parameter "migrate_disks" through #migrate_to_uri3. It looks like there is a missing macro here. http://libvirt.org/git/?p=ruby-libvirt.git;a=blob;f=ext/libvirt/domain.c#l3858. Could you please verify

[libvirt] [PATCH v4 7/8] nss: Introduce a test

2016-03-03 Thread Michal Privoznik
A small test to see how is the nss module working. Signed-off-by: Michal Privoznik --- cfg.mk | 2 +- tests/Makefile.am | 18 tests/nssdata/virbr0.status | 20 + tests/nssdata/virbr1.status | 14 tests/nssmock.c | 140

[libvirt] [PATCH v4 5/8] nss: Implement _nss_libvirt_gethostbyname3_r

2016-03-03 Thread Michal Privoznik
The implementation is pretty straightforward. Moreover, because of the nature of things, gethostbyname_r and gethostbyname2_r can be implemented at the same time too. Signed-off-by: Michal Privoznik --- config-post.h | 24 src/Makefile.am| 59 src/util/vi

[libvirt] [PATCH v4 2/8] virjson: Resolve const correctness

2016-03-03 Thread Michal Privoznik
Plenty of our virJSON*() APIs don't modify passed object. They merely get a value stored in it. Note this fact in their definition and enforce const correctness. Signed-off-by: Michal Privoznik --- src/util/virjson.c | 58 +++--- src/util/virjson.h

[libvirt] [PATCH v4 0/8] NSS module for libvirt

2016-03-03 Thread Michal Privoznik
v4 of: https://www.redhat.com/archives/libvir-list/2016-February/msg00693.html diff to v3: - Introduced yet another test to catch linkage problems - Extended nsstest to test multiple addresses - Reworked src/libvirt_nss.la CFLAGS/LDFLAGS - dropped some dependencies - Dropped checking for lease ti

[libvirt] [PATCH v4 6/8] Implement _nss_libvirt_gethostbyname4_r

2016-03-03 Thread Michal Privoznik
This function is a different beast compared to previous ones. But yet again, nothing surprising is happening here. Signed-off-by: Michal Privoznik --- tools/nss/libvirt_nss.c| 92 ++ tools/nss/libvirt_nss.h| 4 ++ tools/nss/libvirt_nss.syms |

[libvirt] [PATCH v4 1/8] Export virLease* functions for leases file handling

2016-03-03 Thread Michal Privoznik
These functions are going to be reused very shortly. So instead of duplicating the code, lets move them into utils module. Signed-off-by: Michal Privoznik --- po/POTFILES.in | 1 + src/Makefile.am| 1 + src/libvirt_private.syms | 6 + src/network/leaseshelper.c |

[libvirt] [PATCH v4 3/8] Initial support for NSS plugin skeleton

2016-03-03 Thread Michal Privoznik
Name Service Switch is a glibc feature responsible for many things. Translating domain names into IP addresses and vice versa is just one of them. However, currently it's the only functionality that this commit is tickling. Well, in this commit the plugin skeleton is introduced. Implementation to c

[libvirt] [PATCH v4 4/8] libvirt.spec.in: Introduce libvirt-nss package

2016-03-03 Thread Michal Privoznik
Lets put the NSS module into its own package. Signed-off-by: Michal Privoznik --- libvirt.spec.in | 21 + 1 file changed, 21 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 03e2438..733b347 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -155,6 +155,

[libvirt] [PATCH v4 8/8] tests: Introduce nsslinktest

2016-03-03 Thread Michal Privoznik
The only purpose of this test is to catch possible linking problems with libnss_libvirt.so.2. One of the problems I faced was that the NSS plugin was unloaded immediately after it got loaded and the name resolution process continued with next configured option. Without any error. It was very hard t

Re: [libvirt] [PATCH v2 2/4] libxlDomainSetMemoryFlags : reuse virDomainLiveConfigHelperMethod

2016-03-03 Thread Jim Fehlig
On 03/01/2016 08:46 AM, John Ferlan wrote: > $subj: > > Use the "libxl: ..." prefix please > > That way someone filtering on libxl patches may pick up on this. I can > fix this for this one... > > On 02/24/2016 03:38 AM, Nikolay Shirokovskiy wrote: >> Flag expansion is the same as in virDomainObjUp

Re: [libvirt] [PATCH v3 2/2] libxl: reuse virDomainObjUpdateModificationImpact

2016-03-03 Thread Jim Fehlig
On 03/02/2016 07:30 AM, Nikolay Shirokovskiy wrote: > Original current flag expansion does not filter out non > _CONFIG and _LIVE flags explicitly but they are prohibited > earlier by virCheckFlags. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/libxl/libxl_driver.c | 63 > +

Re: [libvirt] [PATCH] tools: do not leak uri in disconnect handler

2016-03-03 Thread Jiri Denemark
On Thu, Mar 03, 2016 at 17:44:55 +0100, Ján Tomko wrote: > Commit 035947e introduced a call to virConnectGetURI > without a matching free() in virshCatchDisconnect. > > Also fix vshAdmCatchDisconnect where it was copied by > commit 6dd7e42. > > https://bugzilla.redhat.com/show_bug.cgi?id=1303891