[libvirt] [PATCH v4 05/17] util: Introduce virObjectLookupHash{Add|Remove}

2017-08-18 Thread John Ferlan
Add a pair of API's to add/remove the LookupKeys object to/from the LookupHash object. The caller must check return status and handle failure properly for the Add. The Remove API callers are all void functions, so only report the problem and ignore the attempt to remove if for some reason the passe

[libvirt] [PATCH v4 08/17] util: Introduce virObjectLookupHashSearch[Locked]

2017-08-18 Thread John Ferlan
A common object API wrapper to use the virHashSearch API to search the LookupHash for specific data defined in the @opaque parameter. Once data is found, the search would end and the LookupKeys object that is represented is returned locked with it's reference count incremented. The virObjectLookup

[libvirt] [PATCH v4 17/17] network: Use virObjectLookup{Keys|Hash}

2017-08-18 Thread John Ferlan
Use the virObjectLookupKeys in _virNetworkObj and use the virObjectLookupHash in _virNetworkObjList. Convert the code to use the LookupHash object and APIs rather than the local code and usage of virHash* calls. Since the _virNetworkObjList only contains the @parent object the virClassNew must be

[libvirt] [PATCH v4 16/17] network: Fix virNetworkObjBridgeInUse return type

2017-08-18 Thread John Ferlan
Rather than an int, it returns a bool - so let's define it that way Signed-off-by: John Ferlan --- src/conf/virnetworkobj.c | 2 +- src/conf/virnetworkobj.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 2bd69dc..2

[libvirt] [PATCH v4 03/17] util: Introduce virObjectLookupHash

2017-08-18 Thread John Ferlan
Using the virObjectRWLockable class as the base with the concepts from virObjectLookupKeys of either 1 or 2 lookup keys possible, create the virObjectLookupHash to manage a common mechanism to store objects for driver/vir*obj.c via self locking hash tables using the RW locking APIs. Each hash tabl

[libvirt] [PATCH v4 04/17] util: Introduce virObjectLookupKeys*Active API's

2017-08-18 Thread John Ferlan
Add a 'bool active' field to the virObjectLookupKeys object and then virObjectLookupKeysIsActive and virObjectLookupKeysSetActive API's to manage it. Signed-off-by: John Ferlan --- src/libvirt_private.syms | 2 ++ src/util/virobject.c | 51 s

[libvirt] [PATCH v4 00/17] virObject adjustments for common object

2017-08-18 Thread John Ferlan
v3: https://www.redhat.com/archives/libvir-list/2017-June/msg00916.html Changes since v3 - honestly it's been too long to remember exactly what changes have taken place. This series provide the util/virobject changes and the implementation for nodedev, secret, interface, and network drivers/vir*ob

[libvirt] [PATCH v4 15/17] util: Introduce virObjectLookupHashPrune

2017-08-18 Thread John Ferlan
A convenience API that will utilize the virHashForEach API for the LookupHash in order to remove elements from the hash table(s) that match some requirement from the callback. NB: Once elements are removed from objsKey1 - if something goes wrong in objsKey2, the best that can be done is to issue a

[libvirt] [PATCH v4 14/17] test: Clean up test driver Interface interactions

2017-08-18 Thread John Ferlan
Now that we have self locking hash table for Interface object lookups, there's no need to take the test driver lock in order to "lock" between the various API's, so remove the Lock/Unlock logic accordingly. Add a virInterfaceObjListFree during testDriverFree for the backupIfaces "just in case". Al

[libvirt] [PATCH v4 01/17] util: Use VIR_ERROR instead of VIR_WARN

2017-08-18 Thread John Ferlan
Rather than use VIR_WARN, let's be a bit more forceful and direct using VIR_ERROR so that the "average consumer" may actually be more concerned that something is wrong even though we still continue to operate. Signed-off-by: John Ferlan --- src/util/virobject.c | 12 ++-- 1 file changed,

[libvirt] [PATCH v4 12/17] Revert "interface: Consume @def in virInterfaceObjNew"

2017-08-18 Thread John Ferlan
This reverts commit 92840eb3a7e47cdf761e52afccc41d2a35327fbd. More recent reviews/changes don't have the vir*ObjNew APIs consuming the @def, so remove from Interface as well. Changes needed to also deal with conflicts from commit id '46f5eca4'. Signed-off-by: John Ferlan --- src/conf/virinterfa

[libvirt] [PATCH v4 10/17] secret: Use virObjectLookup{Keys|Hash}

2017-08-18 Thread John Ferlan
Use the virObjectLookupKeys in _virSecretObj and use the virObjectLookupHash in _virSecretObjList. Convert the code to use the LookupHash object and APIs rather than local code and usage of the virHash* calls. Since the _virSecretObjList only now contains the @parent object, the virClassNew must

[libvirt] [PATCH v4 11/17] util: Introduce virObjectLookupHashClone

2017-08-18 Thread John Ferlan
A convenience API that will utilize the virHashForEach API for the LookupHash in order to create a clone/copy. Primary consumer is the interface driver which has a desire to save off a copy of its only hash table in order to possible restore it if something goes wrong during processing. The callba

[libvirt] [PATCH v4 09/17] nodedev: Use virObjectLookup{Keys|Hash}

2017-08-18 Thread John Ferlan
Use the virObjectLookupKeys in _virNodeDeviceObj and use the virObjectLookupHash in _virNodeDeviceObjList. Convert the code to use the LookupHash object and APIs rather than code within this module that uses virHash* calls. Since the _virNodeDeviceObjList only now contains the @parent object, the

[libvirt] [PATCH v4 07/17] util: Introduce virObjectLookupHashForEach

2017-08-18 Thread John Ferlan
Introduce an API to use the virHashForEach API to go through each element of the LookupHash calling a callback with a LookupKey object entry from the LookupHash in order for it to be processed. Create a common structure _virObjectLookupHashForEachData to define the various pieces of data needed by

[libvirt] [PATCH v4 13/17] interface: Use virObjectLookup{Keys|Hash}

2017-08-18 Thread John Ferlan
Use the virObjectLookupKeys in _virInterfaceObj and use the virObjectLookupHash in _virInterfaceObjList. Convert the code to use the LookupHash object and APIs rather than the local forward linked list processing. Usage of HashLookup{Find|Search} API's is via a callback mechanism and returns a lo

[libvirt] [PATCH v4 06/17] util: Introduce virObjectLookupHashFind[Locked]

2017-08-18 Thread John Ferlan
These API's will use the virHashLookup in order to find the object in the hash table object by the specified @key. If two hash tables exist in the hash table object, then both will be searched for the key. Both API's will call an virObjectLookupHashFindInternal in order in handle the fetch. The vi

[libvirt] [PATCH v4 02/17] util: Introduce virObjectLookupKeys

2017-08-18 Thread John Ferlan
Add a new virObjectLockable child virObjectLookupKeys that can be used by various driver/vir*obj consumers as the means to define the lookup keys for an object. The API requires that at least the @key1 argument is provided as non-NULL thus ensuring that there's at least one key. The keys will be u

[libvirt] [PATCH 0/2] Yet another namespace fix, kinda

2017-08-18 Thread Martin Kletzander
Fixing easy problem (patch 1) lead me to finding out that there is yet another problem that needs fixing (patch 2). For more information read the code. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1443434 Martin Kletzander (2): qemu: Don't mangle the storage format for type='dir' q

[libvirt] [PATCH 2/2] qemu: Also treat directories properly when using namespaces

2017-08-18 Thread Martin Kletzander
Partially-resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1443434 Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 38 +- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 40

[libvirt] [PATCH 1/2] qemu: Don't mangle the storage format for type='dir'

2017-08-18 Thread Martin Kletzander
Partially-resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1443434 Signed-off-by: Martin Kletzander --- src/storage/storage_source.c | 5 .../qemuxml2argv-floppy-drive-noformat.args| 24 + .../qemuxml2argv-floppy-drive-noformat.xml

Re: [libvirt] [PATCH v2] Add support for virtio-net.tx_queue_size

2017-08-18 Thread Jan Scheurich
On Thu, Jul 27 at 14:05:09 +0200 Peter Krempa wrote: > On Thu, Jul 20, 2017 at 21:36:28 -0400, Laine Stump wrote: > > On 07/18/2017 07:12 AM, Michal Privoznik wrote: [...] > > >>> So only users that know how virtio works under the hood are > > >>> expected to also know what rx/tx queue size is a

[libvirt] [PATCH] conf: useserial: drop useless check for serial devices

2017-08-18 Thread Ján Tomko
Since its introduction in commit 874e65aa, if someone requests: we report an error if we cannot successfully count the number of serial devices via an XPath query. Instead of fixing the check (and moving it to the validation phase, to prevent existing domains from disappearing), drop it completel

Re: [libvirt] [PATCH] qemu: don't check whether offline migration is safe

2017-08-18 Thread Pavel Hrdina
On Fri, Aug 18, 2017 at 12:52:50PM +0200, Martin Kletzander wrote: > On Thu, Aug 17, 2017 at 06:53:45PM +0200, Pavel Hrdina wrote: > > Offline migration transfers only the domain definition. > > > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449715 > > > > Signed-off-by: Pavel Hrdina

Re: [libvirt] [PATCH] virsh: Honour --readonly with cmdConnect and no name

2017-08-18 Thread Martin Kletzander
On Fri, Aug 18, 2017 at 04:40:04PM +0200, Martin Kletzander wrote: Signed-off-by: Martin Kletzander --- tools/virsh.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1436042 (already added into the commit locally) signat

[libvirt] [PATCH] virsh: Honour --readonly with cmdConnect and no name

2017-08-18 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- tools/virsh.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 94bb7ff6c93a..9883e87df2b5 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -218,7 +218,13 @@ virshReconnect(vshControl *ctl, cons

Re: [libvirt] [PATCH] qemu: Honour

2017-08-18 Thread Martin Kletzander
On Wed, Aug 16, 2017 at 03:55:19PM +0200, Michal Privoznik wrote: On 08/10/2017 04:02 PM, Martin Kletzander wrote: 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. T

Re: [libvirt] [PATCH] qemu: don't check whether offline migration is safe

2017-08-18 Thread Martin Kletzander
On Thu, Aug 17, 2017 at 06:53:45PM +0200, Pavel Hrdina wrote: Offline migration transfers only the domain definition. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449715 Signed-off-by: Pavel Hrdina --- src/qemu/qemu_migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [libvirt] [PATCH] docs: Improve PCI topology and hotplug guidelines

2017-08-18 Thread Erik Skultety
On Thu, Aug 17, 2017 at 02:24:14PM +0200, Andrea Bolognani wrote: > Address some minor flaws in the original document that > were pointed out during review. > > Signed-off-by: Andrea Bolognani > --- > docs/pci-hotplug.html.in | 46 -- > 1 file changed,

Re: [libvirt] [PATCH v2 0/3] conf: Use the correct limit for the number of PHBs

2017-08-18 Thread Ján Tomko
On Thu, Aug 17, 2017 at 05:44:20PM +0200, Andrea Bolognani wrote: Andrea Bolognani (3): tests: Improve target index validation coverage conf: Move target index validation conf: Use the correct limit for the number of PHBs src/conf/domain_conf.c | 40 +--

Re: [libvirt] [PATCH] qemu: don't check whether offline migration is safe

2017-08-18 Thread Erik Skultety
On Thu, Aug 17, 2017 at 06:53:45PM +0200, Pavel Hrdina wrote: > Offline migration transfers only the domain definition. > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449715 > > Signed-off-by: Pavel Hrdina ACK Erik -- libvir-list mailing list libvir-list@redhat.com https://www.redha

Re: [libvirt] [PATCH] util: string: Introduce virStringHasChars

2017-08-18 Thread Pavel Hrdina
On Fri, Aug 18, 2017 at 02:09:57PM +0200, Peter Krempa wrote: > The helper returns true if a string contains any of the given chars. > virStringHasControlChars can be reimplemented using that helper. > --- > > Pavel was loudly thinking about such function. It turns out that I have > it ready on on

[libvirt] [PATCH] util: string: Introduce virStringHasChars

2017-08-18 Thread Peter Krempa
The helper returns true if a string contains any of the given chars. virStringHasControlChars can be reimplemented using that helper. --- Pavel was loudly thinking about such function. It turns out that I have it ready on one of my branches. src/util/virstring.c | 23 +++ src

Re: [libvirt] [PATCH 00/12] qemu: don't lose VMs if emulator is not installed

2017-08-18 Thread Ján Tomko
On Wed, Aug 16, 2017 at 04:57:49PM +0200, Peter Krempa wrote: The post-parse callback grew into an abomination which requires qemuCaps to succeed. That won't work out well if for some reasons qemu is uninstalled. Restarting of libvirtd would result in all VMs being lost untill qemu is reinstalled

Re: [libvirt] [PATCH V2 2/2] Don't autogenerate seclabels of type 'none'

2017-08-18 Thread Erik Skultety
On Fri, Aug 18, 2017 at 12:18:20AM -0600, Jim Fehlig wrote: > On 08/17/2017 02:17 AM, Erik Skultety wrote: > > On Wed, Aug 16, 2017 at 05:54:08PM -0600, Jim Fehlig wrote: > > > When security drivers are active but confinement is not enabled, > > > there is no need to autogenerate elements when sta