[libvirt] [ISSUE go-xml] go-xml does NOT support DomainDisk marshal

2017-06-02 Thread ZhenweiPi
Hi, In the case of disk hot-plug, we need a xml like this : /// // // // // // // // // /// For now, go-xml does not support DomainDisk marshal. Any good idea ? -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH go-xml] add emulator supported

2017-06-02 Thread zhenwei.pi
--- domain.go | 1 + domain_test.go | 6 ++ 2 files changed, 7 insertions(+) diff --git a/domain.go b/domain.go index dcb8f65..723e761 100644 --- a/domain.go +++ b/domain.go @@ -307,6 +307,7 @@ type DomainDeviceList struct { Channels[]DomainChardev`xml:"channel"`

Re: [libvirt] [PATCH 10/10] apparmor, libvirt-qemu: Allow access to certificates used by libvirt-vnc

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:48PM +0200, Stefan Bader wrote: > From: Serge Hallyn > > When setting up VncTLS according to the official Libvirt documentation, > only one certificate for libvirt/libvirt-vnc is used. The document > indicates to use the following directories : > > /etc/pki/CA > /

Re: [libvirt] [PATCH 06/10] apparmor, libvirtd: Allow libxl-save-helper to run on Debian/Ubuntu

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:44PM +0200, Stefan Bader wrote: > On Debian/Ubuntu the libxl-save-helper (used when saving/restoring > a domain through libxl) is located under /usr/lib/xen-/bin. > > Bug-Ubuntu: https://bugs.launchpad.net/bugs/1334195 > > Signed-off-by: Christian Ehrhardt > Signed-

Re: [libvirt] [PATCH 07/10] apparmor, libvirt-qemu: Allow access to ceph config

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:45PM +0200, Stefan Bader wrote: > From: Serge Hallyn > > Signed-off-by: Christian Ehrhardt > Signed-off-by: Stefan Bader > --- > examples/apparmor/libvirt-qemu | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/examples/apparmor/libvirt-qemu b/examples/a

Re: [libvirt] [PATCH 08/10] apparmor, libvirt-qemu: Allow macvtap access

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:46PM +0200, Stefan Bader wrote: > From: Guilhem Lettron > > Add rule to allow access to /dev/tap* used by macvtap. > > Bug-Ubuntu: https://bugs.launchpad.net/bugs/921870 > > Signed-off-by: Christian Ehrhardt > Signed-off-by: Stefan Bader > --- > examples/apparmo

Re: [libvirt] [PATCH 01/10] virt-aa-helper, apparmor: allow /usr/share/OVMF/ too

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:39PM +0200, Stefan Bader wrote: > From: Simon McVittie > > The split firmware and variables files introduced by > https://bugs.debian.org/764918 are in a different directory for > some reason. Let the virtual machine read both. > > Signed-off-by: Christian Ehrhardt

Re: [libvirt] [PATCH 02/10] virt-aa-helper: Generalize test for firmware paths

2017-06-02 Thread Guido Günther
On Tue, May 23, 2017 at 06:22:40PM +0200, Stefan Bader wrote: > From: Christian Ehrhardt > > This replaces individual tests for firmware locations by > a generic function which will simplify having additional > locations in the future. > > Signed-off-by: Christian Ehrhardt > Signed-off-by: Stef

Re: [libvirt] [PATCH 00/26] Support multiple PHBs for pSeries guests

2017-06-02 Thread Andrea Bolognani
Now for a slightly more serious overview; more details can be obtained by reading the bug report[1]. There are two main goals behind this series:   1) allow the use of multiple PHBs for pSeries guests;   2) isolate hostdevs from emulated devices. By implementing these changes, pSeries guests run

[libvirt] [PATCH 26/26] qemu: Isolate hostdevs on pSeries guests

2017-06-02 Thread Andrea Bolognani
All the pieces are now in place, so we can finally start using isolation groups to achieve our initial goal, which is separating hostdevs from emulated PCI devices while keeping hostdevs that belong to the same host IOMMU group together. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=128054

[libvirt] [PATCH 23/26] conf: Introduce isolation groups

2017-06-02 Thread Andrea Bolognani
Isolation groups will eventually allow us to make sure certain devices, eg. PCI hostdevs, are assigned to guest PCI buses in a way that guarantees improved isolation, error detection and recovery for machine types and hypervisors that support it, eg. pSeries guest on QEMU. --- src/bhyve/bhyve_devi

[libvirt] [PATCH 24/26] schema: Allow

2017-06-02 Thread Andrea Bolognani
--- docs/schemas/domaincommon.rng | 5 + 1 file changed, 5 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index d565a0b..7328fd3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2009,6 +2009,11 @@

[libvirt] [PATCH 10/26] qemu: Relax pci-root index requirement for pSeries guests

2017-06-02 Thread Andrea Bolognani
pSeries guests will soon be allowed to have multiple PHBs (pci-root controllers), meaning the current check on the controller index no longer applies to them. --- src/qemu/qemu_domain.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qem

[libvirt] [PATCH 15/26] qemu: Automatically pick index and model for pci-root controllers

2017-06-02 Thread Andrea Bolognani
pSeries guests will soon need the new information; luckily, we can figure it out automatically most of the time, so users won't have to bother with it. --- src/qemu/qemu_domain_address.c | 57 +- .../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 5 +- ..

[libvirt] [PATCH 25/26] conf: Parse and format

2017-06-02 Thread Andrea Bolognani
--- src/conf/domain_conf.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 10998ea..989ed88 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9176,6 +9176,15 @@ virDomainControllerDefPa

[libvirt] [PATCH 18/26] qemu: Use multiple PHBs for pSeries guests

2017-06-02 Thread Andrea Bolognani
Additional PHBs (pci-root controllers) will be created for the guest using the spapr-pci-host-bridge QEMU device, if available; the implicit default PHB, while present in the guest configuration, will be skipped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 --- src/qemu/qemu_comm

[libvirt] [PATCH 17/26] qemu: Deal with PHB naming convention

2017-06-02 Thread Andrea Bolognani
Usually, a controller with alias 'x' will create a bus with the same name; however, the bus created by a PHBs with alias 'x' will be named 'x.0' instead, so we need to account for that. As an exception to the exception, the implicit PHB that's added automatically to every pSeries guest creates the

[libvirt] [PATCH 20/26] tests: Add baseline tests for automatic PHB usage

2017-06-02 Thread Andrea Bolognani
These tests demonstrate that, while it's now possible for the user to create PHB explicitly and manually assign devices to them, libvirt still defaults to extending the guest PCI topology using PCI bridges and making suboptimal device placement choices. The next few commits will improve on these b

[libvirt] [PATCH 14/26] conf: Add 'spapr-pci-host-bridge' controller model

2017-06-02 Thread Andrea Bolognani
Adding it to the virDomainControllerPCIModelName enumeration is enough for existing code to handle it, so parsing and formatting will work without further tweaking. --- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH 11/26] schema: Allow

2017-06-02 Thread Andrea Bolognani
--- docs/schemas/domaincommon.rng | 5 + 1 file changed, 5 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4d9f8d1..cff595b 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1996,6 +1996,11 @@

[libvirt] [PATCH 16/26] qemu: Introduce QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE

2017-06-02 Thread Andrea Bolognani
This new capability can be used to detect whether a QEMU binary supports the spapr-pci-host-bridge controller. --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + 3 files

[libvirt] [PATCH 22/26] qemu: Use PHBs when extending the guest PCI topology

2017-06-02 Thread Andrea Bolognani
When looking for slots suitable for a PCI device, libvirt might need to add an extra PCI controller: for pSeries guests, we want that extra controller to be a PHB (pci-root) rather than a PCI bridge. --- Better viewed with 'git diff -w'. src/conf/domain_addr.c | 56 +++

[libvirt] [PATCH 19/26] tests: Add tests for pSeries guests with multiple PHBs

2017-06-02 Thread Andrea Bolognani
--- .../qemuxml2argv-pseries-phb-default-missing.args | 22 +++ .../qemuxml2argv-pseries-phb-default-missing.xml | 16 +++ .../qemuxml2argv-pseries-phb-simple.args | 22 +++ .../qemuxml2argv-pseries-phb-simple.xml| 17 +++ tests/qemu

[libvirt] [PATCH 13/26] schema: Allow 'spapr-pci-host-bridge' controller model

2017-06-02 Thread Andrea Bolognani
--- docs/schemas/domaincommon.rng | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index cff595b..d565a0b 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1953,6 +1953,8 @@

[libvirt] [PATCH 05/26] tests: Mock IOMMU groups

2017-06-02 Thread Andrea Bolognani
Later on we're going to need access to information about IOMMU groups for host devices. Implement the support in virpcimock, and start using that mock library in a few QEMU test cases. --- tests/qemumemlocktest.c | 21 - tests/qemuxml2argvtest.c | 25 ++---

[libvirt] [PATCH 21/26] qemu: Use PHBs to fill holes in PCI bus numbering

2017-06-02 Thread Andrea Bolognani
PCI bus has to be numbered sequentially, and no index can be missing, so libvirt will fill in the blanks automatically for the user. Up until now, it has done so using either pci-bridge, for machine types based on legacy PCI, or pcie-root-port, for machine types based on PCI Express. Neither choic

[libvirt] [PATCH 08/26] qemu: Tweak index number checking

2017-06-02 Thread Andrea Bolognani
Moving the check and rewriting it this way doesn't alter the current behavior, but will allow us to special-case pci-root down the line. --- src/qemu/qemu_command.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qe

[libvirt] [PATCH 07/26] qemu: Allow qemuBuildControllerDevStr() to return NULL

2017-06-02 Thread Andrea Bolognani
We will soon need to be able to return a NULL pointer without the caller considering that an error: to make it possible, change the return type to int and use an out parameter for the string instead. Add some documentation for the function as well. --- src/qemu/qemu_command.c | 53 +++

[libvirt] [PATCH 06/26] conf: Simplify slot allocation

2017-06-02 Thread Andrea Bolognani
The current algorithm for slot allocation tries to be clever and avoid looking at buses / slots more than once unless it's necessary. Unfortunately that makes the code more complex, and it will cause problem later on in some situations unless even more complex code is added. Since the performance

[libvirt] [PATCH 09/26] conf: Move index number checking to drivers

2017-06-02 Thread Andrea Bolognani
pSeries guests will soon be allowed to have multiple PHBs (pci-root controllers), which of course means that all but one of them will have a non-zero index; hence, we'll need to relax the current check. However, right now the check is performed in the conf module, which is generic rather than tied

[libvirt] [PATCH 01/26] conf: Remove obsolete comment

2017-06-02 Thread Andrea Bolognani
The virDomainDeviceInfoIsSet() function no longer exists. --- src/conf/device_conf.h | 4 1 file changed, 4 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index a20de85..58b2c9c 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -134,10 +134,6 @@ s

[libvirt] [PATCH 00/26] Support multiple PHBs for pSeries guests

2017-06-02 Thread Andrea Bolognani
Book 1: A Journey Begins These commits merely set the stage for what's coming next. Adventure! Challenges! Friendship! Perhaps even love? 00-03: Trivial cleanups 04-05: Test suite changes that will make implementing future test cases possible; get them out of

[libvirt] [PATCH 12/26] conf: Parse and format

2017-06-02 Thread Andrea Bolognani
--- src/conf/domain_conf.c | 24 src/conf/domain_conf.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d5dff8e..deb0dce 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1803,6 +1803,7 @@ vir

[libvirt] [PATCH 03/26] conf: Tweak virDomainPCIAddressGetNextAddr() signature

2017-06-02 Thread Andrea Bolognani
Move @function after @flags to match other functions in the same module like virDomainPCIAddressReserveNextAddr(). Also move virDomainPCIAddressReserveNextAddr() closer to virDomainPCIAddressReserveAddr() in the header file. --- src/conf/domain_addr.c | 6 +++--- src/conf/domain_addr.h | 12

[libvirt] [PATCH 02/26] conf: Make virDomainPCIAddressSetGrow() private

2017-06-02 Thread Andrea Bolognani
There are no external users. --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 5 - src/libvirt_private.syms | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 639168e..9c809e8 100644 --- a/src/conf/domain_ad

[libvirt] [PATCH 04/26] tests: Update qemumemlock data

2017-06-02 Thread Andrea Bolognani
Use 0001:01:00.0 instead of :04:02.0 as the source address for the host device. This doesn't change anything at the moment, but it will make a difference later on. --- tests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml | 2 +- tests/qemumemlockdata/qemumemlock-pc-hardlimit+

Re: [libvirt] [PATCH go-xml] Add support for Node Device with basic testing.

2017-06-02 Thread Daniel P. Berrange
On Wed, May 31, 2017 at 11:35:14AM -0400, Vladik Romanovsky wrote: > --- > node_device.go | 168 > > node_device_test.go | 128 +++ > 2 files changed, 296 insertions(+) > create mode 100644 node_device.

Re: [libvirt] [PATCH go-xml] Add support for domain input address

2017-06-02 Thread Daniel P. Berrange
On Thu, Jun 01, 2017 at 05:49:59PM +0800, zhenwei.pi wrote: > --- > domain.go | 5 +++-- > domain_test.go | 11 ++- > 2 files changed, 13 insertions(+), 3 deletions(-) Thanks, I've pushed this Regards, Daniel -- |: https://berrange.com -o-https://www.flickr.com/photos/db

Re: [libvirt] [PATCH] virsh: ignore readline -Wstrict-prototypes warning

2017-06-02 Thread Roman Bogorodskiy
Roman Bogorodskiy wrote: > Ján Tomko wrote: > > > On Fri, May 26, 2017 at 09:49:15PM +0400, Roman Bogorodskiy wrote: > > >When building with clang 4.0.0, virsh build fails like this: > > > > > >gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools' > > > CC virsh-virsh.o > >

[libvirt] [PATCH v4] virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND

2017-06-02 Thread Daniel Liu
The option allows someone to run domain-to-native on already existing domain without the need of supplying their XML. It is basically wrapper around 'virsh dumpxml | virsh domxml-to-native /dev/stdin'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=835476 Signed-off-by: Daniel Liu --- t

[libvirt] [PATCH v2] virsh: workaround readline prototypes warnings

2017-06-02 Thread Roman Bogorodskiy
When building with clang 4.0.0, virsh build fails like this: gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools' CC virsh-virsh.o In file included from virsh.c:45: In file included from /usr/local/include/readline/readline.h:31: /usr/local/include/readline/rltypedefs.h:35:22:

Re: [libvirt] [PATCH] qemu: Don't special case mdevs when assigning PCI addresses

2017-06-02 Thread Erik Skultety
On Fri, Jun 02, 2017 at 08:20:12AM +0200, Andrea Bolognani wrote: > On Thu, 2017-06-01 at 21:24 -0400, Laine Stump wrote: > > > @@ -645,9 +645,6 @@ > > > qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, > > >  return pcieFlags; > > >  } > > > > > > -i

Re: [libvirt] [PATCH 01/18] conf: introduce virDomainControllerDriverFormat

2017-06-02 Thread Pavel Hrdina
On Tue, May 30, 2017 at 02:50:24PM +0200, Ján Tomko wrote: > Split out formatting the subelement of > to make adding new options easier. > --- > src/conf/domain_conf.c | 55 > +- > 1 file changed, 32 insertions(+), 23 deletions(-) Reviewed-by: Pa

Re: [libvirt] [PATCH v2] daemon: Don't initialize SASL context if not necessary

2017-06-02 Thread Daniel P. Berrange
On Fri, Jun 02, 2017 at 02:53:28PM +0200, Peter Krempa wrote: > SASL context would be initialized even if the corresponding TCP or TLS > sockets are not enabled. > > fe772f24a68 attempted to fix the symptom by commenting out the settings, > but that did not fix the root cause. 3c647ee4bbb later re

[libvirt] [PATCH v2] daemon: Don't initialize SASL context if not necessary

2017-06-02 Thread Peter Krempa
SASL context would be initialized even if the corresponding TCP or TLS sockets are not enabled. fe772f24a68 attempted to fix the symptom by commenting out the settings, but that did not fix the root cause. 3c647ee4bbb later reverted those changes so that the more secure algorithm is used. Resolve

Re: [libvirt] [PATCH] daemon: Don't initialize SASL context if not necessary

2017-06-02 Thread Peter Krempa
On Fri, Jun 02, 2017 at 13:28:31 +0100, Daniel Berrange wrote: > On Fri, Jun 02, 2017 at 02:10:25PM +0200, Peter Krempa wrote: > > SASL context would be initialized even if the corresponding TCP or TLS > > sockets are not enabled. > > > > fe772f24a68 attempted to fix the symptom by commenting out

Re: [libvirt] [PATCH] daemon: Don't initialize SASL context if not necessary

2017-06-02 Thread Daniel P. Berrange
On Fri, Jun 02, 2017 at 02:10:25PM +0200, Peter Krempa wrote: > SASL context would be initialized even if the corresponding TCP or TLS > sockets are not enabled. > > fe772f24a68 attempted to fix the symptom by commenting out the settings, > but that did not fix the root cause. 3c647ee4bbb later re

[libvirt] [PATCH v2 3/8] util: Generate a common internal only error print

2017-06-02 Thread John Ferlan
If virObjectIsClass fails "internally" to virobject.c, create a macro to generate the VIR_WARN describing what the problem is. Also improve the checks and message a bit to indicate which was the failure - whether the obj was NULL or just not the right class Signed-off-by: John Ferlan --- src/uti

[libvirt] [PATCH] daemon: Don't initialize SASL context if not necessary

2017-06-02 Thread Peter Krempa
SASL context would be initialized even if the corresponding TCP or TLS sockets are not enabled. fe772f24a68 attempted to fix the symptom by commenting out the settings, but that did not fix the root cause. 3c647ee4bbb later reverted those changes so that the more secure algorithm is used. Resolve

Re: [libvirt] [V4 RESEND PATCH] Expose resource control capabilites on cache bank

2017-06-02 Thread Martin Kletzander
Sorry for the delays. Apart from some details (some even mentioned before) this looks quite alright. I'll fix up few things here and there not to bother you with another version and resend it with one fix that's also needed in my previous code. On Wed, May 31, 2017 at 09:24:37AM +0800, Eli Qiao

[libvirt] [PATCH 09/17] nwfilter: Consistently name virNWFilterPtr in driver

2017-06-02 Thread John Ferlan
Use @nwfilter always for the name Signed-off-by: John Ferlan --- src/nwfilter/nwfilter_driver.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index d527769..7db4f87 100644 --- a/src/nwf

[libvirt] [PATCH 07/17] nwfilter: Add @def into virNWFilterObjNew

2017-06-02 Thread John Ferlan
Modify the virNWFilterObjNew to take @def as a parameter and consume it. Signed-off-by: John Ferlan --- src/conf/virnwfilterobj.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index ac99f47..c86b1a9 100644

[libvirt] [PATCH 05/17] nwfilter: Move virNWFilterSaveConfig virnwfilterobj

2017-06-02 Thread John Ferlan
Move the function into nwfilterobj, rename it to virNWFilterObjSaveConfig, and alter the order of the arguments. Signed-off-by: John Ferlan --- src/conf/nwfilter_conf.c | 27 --- src/conf/nwfilter_conf.h | 4 src/conf/virnwfilterobj.c | 30 +

[libvirt] [PATCH 13/17] nwfilter: Introduce virNWFilterObjListFindInstantiateFilter

2017-06-02 Thread John Ferlan
Create a common API to handle the instantiation path filter lookup. Signed-off-by: John Ferlan --- src/conf/virnwfilterobj.c | 23 +++ src/conf/virnwfilterobj.h | 4 ++ src/libvirt_private.syms | 1 + src/nwfilter/nwfilter_gentech_driver.c | 119 +

[libvirt] [PATCH 04/17] nwfilter: Remove need for virNWFilterSaveXML

2017-06-02 Thread John Ferlan
Merge code into virNWFilterSaveConfig Signed-off-by: John Ferlan --- src/conf/nwfilter_conf.c | 30 +++--- src/conf/nwfilter_conf.h | 5 - 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 032700

[libvirt] [PATCH 10/17] nwfilter: Rename virNWFilterInstantiate

2017-06-02 Thread John Ferlan
Rename to virNWFilterDoInstantiate to better describe the action. Also fix the @vmuuid parameter to not have the ATTRIBUTE_UNUSED since it is used in the call to virNWFilterDHCPSnoopReq. Signed-off-by: John Ferlan --- src/nwfilter/nwfilter_gentech_driver.c | 46 +++--

[libvirt] [PATCH 06/17] nwfilter: Add configFile into virNWFilterObj

2017-06-02 Thread John Ferlan
When creating an object, save the configFile name in the object rather than needing to build it up each time for the SaveConfig. This involves adding a @configDir parameter to virNWFilterObjListAssignDef and removing the @configDir from virNWFilterObjSaveConfig. Signed-off-by: John Ferlan --- sr

[libvirt] [PATCH 11/17] nwfilter: Rename __virNWFilterInstantiateFilter

2017-06-02 Thread John Ferlan
Rename to virNWFilterInstantiateFilterUpdate and alter the callers to not have one parameter per line. Signed-off-by: John Ferlan --- src/nwfilter/nwfilter_gentech_driver.c | 62 +- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/src/nwfilter/nwfil

[libvirt] [PATCH 14/17] nwfilter: Add @refs logic to __virNWFilterObj

2017-06-02 Thread John Ferlan
"Simple" conversion to the virObjectLockable object isn't quite possible yet because the nwfilter lock requires usage of recursive locking due to algorithms handing filter ""'s and ""'s. The list search logic would also benefit from using hash tables for lookups. So this patch is step 1 in the proc

[libvirt] [PATCH 16/17] nwfilter: Remove recursive locking for nwfilter instantiation

2017-06-02 Thread John Ferlan
The current algorithm required usage of recursive locks because there was no other mechanism available to ensure that the object wasn't deleted whilst the instantiation was taking place. Now that we have object references, lets use those to ensure the object isn't deleted whilst we're working thro

[libvirt] [PATCH 17/17] nwfilter: Convert virNWFilterObj to use virObjectLockable

2017-06-02 Thread John Ferlan
Now that we have a bit more control, let's convert our object into a recursive lockable object and let that magic handle the create and lock/unlock. Additionally, we introduce virNWFilterObjEndAPI. Signed-off-by: John Ferlan --- src/conf/virnwfilterobj.c | 127 ++---

[libvirt] [PATCH 12/17] nwfilter: Rename _virNWFilterInstantiateFilter

2017-06-02 Thread John Ferlan
New API will be virNWFilterInstantiateFilterInternal as it's called from the virNWFilterInstantiateFilter and virNWFilterUpdateInstantiateFilter. Signed-off-by: John Ferlan --- src/nwfilter/nwfilter_gentech_driver.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletion

[libvirt] [PATCH 03/17] nwfilter: Fix possible locking problem in LoadConfig error path

2017-06-02 Thread John Ferlan
After returning from virNWFilterObjListAssignDef the @obj is locked; however, if virNWFilterSaveConfig fails to save the generated UUID the code jumped to error and returns NULL meaning the caller will not call virNWFilterObjUnlock on the object leaving the object locked on list and ripe for a dead

[libvirt] [PATCH 08/17] nwfilter: Clean up a couple nwfilter_driver error paths

2017-06-02 Thread John Ferlan
No need to goto cleanup and check "if (obj)" if we know (obj) isn't there, so just return immediately. Signed-off-by: John Ferlan --- src/nwfilter/nwfilter_driver.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/n

[libvirt] [PATCH 00/17] nwfilter adjustments for common object

2017-06-02 Thread John Ferlan
As noted in the recently posted virObject changes: https://www.redhat.com/archives/libvir-list/2017-June/msg00070.html I believe I've found a way to handle the recursive lock situation that made it "difficult" (at best) to convert the nwfilter to the common object model. It does involve a bit of

[libvirt] [PATCH 02/17] nwfilter: Fix possible corruption on failure path during LoadConfig

2017-06-02 Thread John Ferlan
If the virNWFilterSaveConfig in virNWFilterObjListLoadConfig, then jumping to the error label would free the @def owned by the object, but the object is still on the list. Fix this by following proper procedure to clear @def and create a new variable @objdef to handle the object's def after succes

[libvirt] [PATCH 15/17] nwfilter: Convert _virNWFilterObjList to be a virObjectLockable

2017-06-02 Thread John Ferlan
Perhaps a bit out of order from the normal convert driver object to virObjectLockable, then convert the driver object list. However, as it turns out nwfilter objects have been using a recursive mutex for which the common virObject code does not want to use. So, if we convert the nwfilter object li

[libvirt] [PATCH 01/17] nwfilter: Fix return value comparison for virNWFilterTriggerVMFilterRebuild

2017-06-02 Thread John Ferlan
Should compare < 0 to be correct. Signed-off-by: John Ferlan --- src/conf/virnwfilterobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index b5aaa6b..0027d45 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/vi

[libvirt] [PATCH v2 1/8] util: Formatting cleanups to virobject API

2017-06-02 Thread John Ferlan
Alter to use more recent formatting guidelines Signed-off-by: John Ferlan --- src/util/virobject.c | 64 ++-- src/util/virobject.h | 59 2 files changed, 82 insertions(+), 41 deletions(-) diff --git

[libvirt] [PATCH v2 5/8] util: Introduce virObjectPoolableHashElement

2017-06-02 Thread John Ferlan
Add a new virObjectLockable child which will be used to more generically describe driver objects. Eventually these objects will be placed into a more generic hash table object which will take care of object mgmt functions. Each virObjectPoolableHashElement will have a primaryKey (required) and a s

[libvirt] [PATCH v2 6/8] util: Add virObjectPoolableHashElementGet*Key

2017-06-02 Thread John Ferlan
Add a pair of accessor API's: virObjectPoolableHashElementGetPrimaryKey virObjectPoolableHashElementGetSecondaryKey which will return the requested key from the object to the caller. It is up to the caller to check the returned key and error if the return value is NULL. Signed-off-by: Joh

[libvirt] [PATCH v2 7/8] util: Introduce virObjectPoolableDef

2017-06-02 Thread John Ferlan
Add a new virObjectPoolableHashElement child which will be used to provide the basis for driver def/newDef elements. Each virObjectPoolableDef has: 1. A required @primaryKey to be used to uniquely identity the object by some string value. 2. An optional @secondaryKey to be used as a seco

[libvirt] [PATCH v2 2/8] util: Introduce virObjectGetLockableObj

2017-06-02 Thread John Ferlan
Split out the object fetch in virObject{Lock|Unlock} into a helper Signed-off-by: John Ferlan --- src/util/virobject.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/util/virobject.c b/src/util/virobject.c index 792685b..34805d3 100644 --

[libvirt] [PATCH v2 8/8] util: Add virObjectPoolableDef* accessor API's

2017-06-02 Thread John Ferlan
Add new API's for object management: virObjectPoolableDefGetDef - Just return the obj->def from the object. virObjectPoolableDefSetDef - If the new @def is non-NULL, replace the previous obj->def with the new @def argument calling the obj->defFreeFunc on the pr

[libvirt] [PATCH v2 0/8] virObject adjustments for common object

2017-06-02 Thread John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2017-May/msg01178.html rfc: https://www.redhat.com/archives/libvir-list/2017-April/msg00321.html Now that 3.5.0 is out, hopefully this can be considered early and more progress can be made this month. Differences to v1: - Remove the magic_marker,

[libvirt] [PATCH v2 4/8] util: Add safety net of checks to ensure valid object

2017-06-02 Thread John Ferlan
The virObject logic "assumes" that whatever is passed to its API's would be some sort of virObjectPtr; however, if it is not then some really bad things can happen. So far there's been only virObject{Ref|Unref}, virObject{Lock|Unlock}, and virObjectIsClass and the virObject and virObjectLockable c

[libvirt] [V3 PATCH] RFC: Reimplement cache allocation for a VM

2017-06-02 Thread Eli Qiao
From: Eli Qiao This is a RFC patch for the reimplement of `support cache tune(CAT) in libvirt`[1]. This patch defines some structs to represent data struct in linux resctrl fs which will be used later to do cache allocation. The patch expose a private interface `virResctrlFreeSchemata`, which w

Re: [libvirt] [PATCH v2] virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND

2017-06-02 Thread Martin Kletzander
On Fri, Jun 02, 2017 at 05:18:52AM -0400, Dan wrote: On Tue, May 30, 2017 at 08:45:37AM +0200, Peter Krempa wrote: On Mon, May 29, 2017 at 14:08:53 -0400, Daniel Liu wrote: > The option allows someone to run domain-to-native on already existing > domain without the need of supplying their XML.

Re: [libvirt] [PATCH v2] virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND

2017-06-02 Thread Dan
On Tue, May 30, 2017 at 08:45:37AM +0200, Peter Krempa wrote: > On Mon, May 29, 2017 at 14:08:53 -0400, Daniel Liu wrote: > > The option allows someone to run domain-to-native on already existing > > domain without the need of supplying their XML. It is basically > > wrapper around 'virsh dumpxm

Re: [libvirt] [PATCH] virsh: ignore readline -Wstrict-prototypes warning

2017-06-02 Thread Roman Bogorodskiy
Ján Tomko wrote: > On Fri, May 26, 2017 at 09:49:15PM +0400, Roman Bogorodskiy wrote: > >When building with clang 4.0.0, virsh build fails like this: > > > >gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools' > > CC virsh-virsh.o > >In file included from virsh.c:45: > >In fi

Re: [libvirt] [PATCH] util: removing dead code inside virstoragefile.

2017-06-02 Thread Peter Krempa
On Thu, Jun 01, 2017 at 22:56:09 -0300, Julio Faracco wrote: > The host address or the socket path have already been checked at the begining > of the function virStorageSourceParseNBDColonString(). So, when the parameter > is not a unix socket, there is no reason to check the address again becaus

Re: [libvirt] [PATCH] util: fixing wrong comparison inside virStoragePermsCopy().

2017-06-02 Thread Peter Krempa
On Thu, Jun 01, 2017 at 22:58:06 -0300, Julio Faracco wrote: > VIR_STRDUP returns -1 if the string copy was not successful. So, the current > comparison/logic is throwing an error when VIR_STRDUP() returns 1. Only when > source is NULL, it is considering as a success which is not right. > > Signed

[libvirt] [PATCH] Post-release version bump to 3.5.0

2017-06-02 Thread Peter Krempa
--- Pushed as trivial. configure.ac | 2 +- docs/news.xml | 8 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 246f4e077..1af5538ee 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl You should have received a copy of the

[libvirt] Release of libvirt-3.4.0

2017-06-02 Thread Daniel Veillard
It's out ! The release is tagged in git, the tree is open ! I pushed the signed tartball and rpms to the usual place: ftp://libvirt.org/libvirt/ I also rolled out the libvirt-python-3.4.0 release that you can find at ftp://libvirt.org/libvirt/python/ This is a feature and improvements