Re: [libvirt] [PATCH] qemuBuildMemoryBackendStr: Handle one more corner case

2017-08-10 Thread Martin Kletzander
On Thu, Aug 10, 2017 at 05:43:13PM +0200, Michal Privoznik wrote: On 08/10/2017 03:44 PM, Martin Kletzander wrote: On Tue, Aug 08, 2017 at 05:04:15PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1458638 This code is so complicated because we allow enabling the

[libvirt] [PATCH v2 7/7] util: check for PF online status earlier in guest startup

2017-08-10 Thread Laine Stump
When using a VF from an SRIOV-capable network card in a guest (either in macvtap passthrough mode, or via VFIO PCI device assignment), The associated PF netdev must be online in order for the VF to be usable by the guest. The guest, however, is not able to change the state of the PF. And libvirt

[libvirt] [PATCH v2 2/7] util: Fix const'ness of 1st arg to virPCIGetNetName()

2017-08-10 Thread Laine Stump
The first arg isn't modified in the function, so it should be const. --- New for V2. src/util/virpci.c | 4 ++-- src/util/virpci.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 2c1b75855..110d9741c 100644 ---

[libvirt] [PATCH v2 4/7] util: match phys_port_id when converting PF-netdev to/from VF-netdev

2017-08-10 Thread Laine Stump
This patch updates functions in netdev.c to pay attention to phys_port_id. It uses the new function virNetDevGetPhysPortID() to learn the phys_port_id of a VF or PF, then sends that info to virPCIGetNetName(), which has newly been modified to take an optional phys_port_id. --- Change from V1 -

[libvirt] [PATCH v2 5/7] util: save the correct VF's info when using a dual port SRIOV NIC in single port mode

2017-08-10 Thread Laine Stump
Mellanox ConnectX-3 dual port SRIOV NICs present a bit of a challenge when assigning one of their VFs to a guest using VFIO device assignment. These NICs have only a single PCI PF device, and that single PF has two netdevs sharing the single PCI address - one for port 1 and one for port 2. When a

[libvirt] [PATCH v2 6/7] util: restructure virNetDevReadNetConfig() to eliminate false error logs

2017-08-10 Thread Laine Stump
virHostdevRestoreNetConfig() calls virNetDevReadNetConfig() to try and read the "original config" of a netdev, and if that fails, it tries again with a different directory/netdev name. This achieves the desired effect (we end up finding the config wherever it may be), but for each failure,

[libvirt] [PATCH v2 1/7] util: new function virNetDevGetPhysPortID()

2017-08-10 Thread Laine Stump
On Linux each network device *can* (but not necessarily *does*) have an attribute called phys_port_id which can be read from the file of that name in the netdev's sysfs directory. The examples I've seen have been a many-digit hexadecimal number (as an ASCII string). This value can be useful when

[libvirt] [PATCH v2 3/7] util: make virPCIGetNetName() more versatile

2017-08-10 Thread Laine Stump
A single PCI device may have multiple netdevs associated with it. Each of those netdevs will have a different phys_port_id entry in sysfs. This patch modifies virPCIGetNetName() to allow selecting one of the potential many netdevs in two different ways: 1) by setting the "idx" argument, the

[libvirt] [PATCH v2 0/7] properly deal with multiple netdevs on a single PF (i.e. Mellanox dual port NICS)

2017-08-10 Thread Laine Stump
I had already sent 3 patches to properly support macvtap passthrough of both ports of a dual port VF, and those patches were ACKed by Michal: https://www.redhat.com/archives/libvir-list/2017-August/msg00170.html When Michal sent the ACK, I was already working on a V2 that updated Patch 2 (now

Re: [libvirt] [PATCH python] rpm: rename packages to python2-libvirt / python3-libvirt

2017-08-10 Thread Laine Stump
On 08/10/2017 03:30 AM, Martin Kletzander wrote: > On Wed, Aug 09, 2017 at 05:08:58PM +0100, Daniel P. Berrange wrote: >> This compiles with Fedora naming policy for python packages >> > > s/compile/complies/ > >> Signed-off-by: Daniel P. Berrange >> --- >>

Re: [libvirt] [PATCH] qemuBuildMemoryBackendStr: Handle one more corner case

2017-08-10 Thread Michal Privoznik
On 08/10/2017 03:44 PM, Martin Kletzander wrote: > On Tue, Aug 08, 2017 at 05:04:15PM +0200, Michal Privoznik wrote: >> https://bugzilla.redhat.com/show_bug.cgi?id=1458638 >> >> This code is so complicated because we allow enabling the same >> bits at many places. Just like in this case: huge

Re: [libvirt] [PATCH] qemu: Honour

2017-08-10 Thread Martin Kletzander
On Thu, Aug 03, 2017 at 09:36:27AM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1476866 For some reason, we completely ignore setting for domains. The implementation is simply not there. It never was. However, things are slightly more complicated. QEMU sends us

Re: [libvirt] [PATCH] qemuBuildMemoryBackendStr: Handle one more corner case

2017-08-10 Thread Martin Kletzander
On Tue, Aug 08, 2017 at 05:04:15PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1458638 This code is so complicated because we allow enabling the same bits at many places. Just like in this case: huge pages can be enabled by global element under or on per basis.

[libvirt] [PATCH 1/5] virxml: Fix indentation

2017-08-10 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- src/util/virxml.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index 666024809438..39049d869bc1 100644 --- a/src/util/virxml.c +++

[libvirt] [PATCH 4/5] util: Make virResctrlGetCacheControlType() behave like other functions

2017-08-10 Thread Martin Kletzander
That means that returning negative values means error and non-negative values differ in meaning, but are all successful. Signed-off-by: Martin Kletzander --- src/conf/capabilities.c | 6 ++-- src/util/virresctrl.c | 84 ++--- 2

[libvirt] [PATCH 2/5] tests: Fix indentation in virfilewrapper.c

2017-08-10 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- tests/virfilewrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index bf2fa6905a26..fede7b2e89a8 100644 --- a/tests/virfilewrapper.c +++

[libvirt] [PATCH 0/5] Random pre-CAT cleanups

2017-08-10 Thread Martin Kletzander
There are some patches that don't look related, but I found out they are messed up when working on previous versions that got discarded. Why not keep the cleanups, though, right? Martin Kletzander (5): virxml: Fix indentation tests: Fix indentation in virfilewrapper.c Move resctrl-related

[libvirt] [PATCH 3/5] Move resctrl-related code from conf/capabilities to util/virresctrl

2017-08-10 Thread Martin Kletzander
It doesn't access anything from conf/ and ti will be needed to use from other util/ places. This split makes the separation clearer. Signed-off-by: Martin Kletzander --- include/libvirt/virterror.h | 1 + src/Makefile.am | 1 + src/conf/capabilities.c |

[libvirt] [PATCH 5/5] util: Rename virResctrl to virResctrlInfo

2017-08-10 Thread Martin Kletzander
This way later patches can add another structures with virResctrl prefix without the meaning being even more confusing than it needs to be. Signed-off-by: Martin Kletzander --- src/conf/capabilities.h | 2 +- src/util/virresctrl.c | 4 ++-- src/util/virresctrl.h | 8

Re: [libvirt] [PATCH python] rpm: assume python3 is always available

2017-08-10 Thread Daniel P. Berrange
On Thu, Aug 10, 2017 at 02:01:40PM +0200, Martin Kletzander wrote: > On Thu, Aug 10, 2017 at 12:11:00PM +0100, Daniel P. Berrange wrote: > > On Thu, Aug 10, 2017 at 09:27:27AM +0200, Martin Kletzander wrote: > > > On Wed, Aug 09, 2017 at 05:08:44PM +0100, Daniel P. Berrange wrote: > > > >

Re: [libvirt] [PATCH python] rpm: assume python3 is always available

2017-08-10 Thread Martin Kletzander
On Thu, Aug 10, 2017 at 12:11:00PM +0100, Daniel P. Berrange wrote: On Thu, Aug 10, 2017 at 09:27:27AM +0200, Martin Kletzander wrote: On Wed, Aug 09, 2017 at 05:08:44PM +0100, Daniel P. Berrange wrote: > Signed-off-by: Daniel P. Berrange > --- > libvirt-python.spec.in |

Re: [libvirt] [PATCH python] rpm: assume python3 is always available

2017-08-10 Thread Daniel P. Berrange
On Thu, Aug 10, 2017 at 09:27:27AM +0200, Martin Kletzander wrote: > On Wed, Aug 09, 2017 at 05:08:44PM +0100, Daniel P. Berrange wrote: > > Signed-off-by: Daniel P. Berrange > > --- > > libvirt-python.spec.in | 17 - > > 1 file changed, 17 deletions(-) > > >

[libvirt] [PATCH python v2] Change Obsoletes to an explicit version

2017-08-10 Thread Daniel P. Berrange
We only want to obsolete versions which actually had the original name, not all future versions. Signed-off-by: Daniel P. Berrange --- Changed in v2: - Fix both sub-rpms libvirt-python.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH python] Change Obsoletes to an explicit version

2017-08-10 Thread Daniel P. Berrange
We only want to obsolete versions which actually had the original name, not all future versions. Signed-off-by: Daniel P. Berrange --- libvirt-python.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in

[libvirt] [PATCH] virt-aa-helper: locking disk files for qemu 2.10

2017-08-10 Thread Christian Ehrhardt
Testing qemu-2.10-rc2 shows issues like: qemu-system-x86_64: -drive file=/var/lib/uvtool/libvirt/images/kvmguest- \ artful-normal.qcow,format=qcow2,if=none,id=drive-virtio-disk0: Failed to lock byte 100 It seems the following qemu commit changed the needs for the backing image rules:

Re: [libvirt] [PATCH] virt-aa-helper: locking disk files for qemu 2.10

2017-08-10 Thread Christian Ehrhardt
On Thu, Aug 10, 2017 at 11:19 AM, Christian Ehrhardt < christian.ehrha...@canonical.com> wrote: > Testing qemu-2.10-rc2 shows issues like: > qemu-system-x86_64: -drive file=/var/lib/uvtool/libvirt/images/kvmguest- > \ > artful-normal.qcow,format=qcow2,if=none,id=drive-virtio-disk0: > Failed

Re: [libvirt] [PATCH python] Avoid comparing boolean and integers

2017-08-10 Thread Daniel P. Berrange
On Wed, Aug 09, 2017 at 02:17:10PM -0500, Eric Blake wrote: > On 08/09/2017 11:07 AM, Daniel P. Berrange wrote: > > Signed-off-by: Daniel P. Berrange > > --- > > libvirt-utils.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Did you get a compiler that

Re: [libvirt] [PATCH 2/5] testCompareMemLock: Use correct free function for domain def

2017-08-10 Thread Ján Tomko
On Thu, Aug 10, 2017 at 09:29:07AM +0200, Michal Privoznik wrote: This is a nice example of volkswagened code. It passes tests but Please remove the brand reference before pushing Jan doesn't work as expected really. virDomainDef is not an instance of virObject thus virObjectUnref() is not

Re: [libvirt] [PATCH 0/5] Another round of mem leak fixes

2017-08-10 Thread Martin Kletzander
On Thu, Aug 10, 2017 at 09:29:05AM +0200, Michal Privoznik wrote: *** BLURB HERE *** Reblurbed-by: Martin Kletzander Michal Privoznik (5): virDomainNetDefClear: Free @coalesce testCompareMemLock: Use correct free function for domain def securityselinuxtest: Don't

Re: [libvirt] [PATCH 1/5] virDomainNetDefClear: Free @coalesce

2017-08-10 Thread Martin Kletzander
On Thu, Aug 10, 2017 at 09:29:06AM +0200, Michal Privoznik wrote: In virDomainNetDefParseXML() the def->coalesce is parsed and allocated by virDomainNetDefCoalesceParseXML() but in fact it's never freed . s/d \./d./ Signed-off-by: Michal Privoznik ---

Re: [libvirt] [PATCH python] rpm: rename packages to python2-libvirt / python3-libvirt

2017-08-10 Thread Martin Kletzander
On Wed, Aug 09, 2017 at 05:08:58PM +0100, Daniel P. Berrange wrote: This compiles with Fedora naming policy for python packages s/compile/complies/ Signed-off-by: Daniel P. Berrange --- libvirt-python.spec.in | 28 +++- 1 file changed, 23

[libvirt] [PATCH 5/5] virhostdevtest: Don't leak @mgr->activeSCSIHostdevs

2017-08-10 Thread Michal Privoznik
So the hostdev manager has some lists to keep track which devices are active (=assigned to a domain) or inactive. The manager and its lists are allocated in myInit and freed in myCleanup but one of them (activeSCSIHostdevs) was missing. Also, the order in which the cleanup was done doesn't make it

[libvirt] [PATCH 1/5] virDomainNetDefClear: Free @coalesce

2017-08-10 Thread Michal Privoznik
In virDomainNetDefParseXML() the def->coalesce is parsed and allocated by virDomainNetDefCoalesceParseXML() but in fact it's never freed . Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH 0/5] Another round of mem leak fixes

2017-08-10 Thread Michal Privoznik
*** BLURB HERE *** Michal Privoznik (5): virDomainNetDefClear: Free @coalesce testCompareMemLock: Use correct free function for domain def securityselinuxtest: Don't leak @mgr vircgrouptest: Don't leak @cgroup virhostdevtest: Don't leak @mgr->activeSCSIHostdevs src/conf/domain_conf.c

[libvirt] [PATCH 4/5] vircgrouptest: Don't leak @cgroup

2017-08-10 Thread Michal Privoznik
In these test cases we create internal representation of cgroup, however, never free it. Signed-off-by: Michal Privoznik --- tests/vircgrouptest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index b932b1ad5..1e551cfc7

[libvirt] [PATCH 2/5] testCompareMemLock: Use correct free function for domain def

2017-08-10 Thread Michal Privoznik
This is a nice example of volkswagened code. It passes tests but doesn't work as expected really. virDomainDef is not an instance of virObject thus virObjectUnref() is not the correct function to be called. Signed-off-by: Michal Privoznik --- tests/qemumemlocktest.c | 2 +-

[libvirt] [PATCH 3/5] securityselinuxtest: Don't leak @mgr

2017-08-10 Thread Michal Privoznik
The security manager is created so that test cases can use it. However, it is never released. Signed-off-by: Michal Privoznik --- tests/securityselinuxtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index

Re: [libvirt] [PATCH python] rpm: assume python3 is always available

2017-08-10 Thread Martin Kletzander
On Wed, Aug 09, 2017 at 05:08:44PM +0100, Daniel P. Berrange wrote: Signed-off-by: Daniel P. Berrange --- libvirt-python.spec.in | 17 - 1 file changed, 17 deletions(-) Reviewed-by: Martin Kletzander I think this is reasonable even

Re: [libvirt] Qemu only support VHDx disk format, but libvirt force use VHD format

2017-08-10 Thread Martin Kletzander
On Wed, Aug 09, 2017 at 04:07:14PM +, Komeiji Kuroko wrote: Hello all, I am trying to use a VHDx format disk on libvirt. According to https://en.wikibooks.org/wiki/QEMU/Images, Qemu supports VHDx but not VHD. But when I set disk format to 'vhdx' in virt-manager, it prompts "Error changing