[libvirt] [PATCH 05/16] snapshot: Drop virDomainSnapshotDef.current

2019-03-19 Thread Eric Blake
The only use for the 'current' member of virDomainSnapshotDef was with the PARSE/FORMAT_INTERNAL flag for controlling an internal-use element marking whether a particular snapshot definition was current, and even then, only by the qemu driver on output, and by qemu and test driver on input. But

[libvirt] [PATCH 10/16] snapshot: Factor out virDomainMomentDef class

2019-03-19 Thread Eric Blake
Pull out the common parts of virDomainSnapshotDef that will be reused for virDomainCheckpointDef into a new base class. Adjust all callers that use the direct fields (some of it is churn that disappears when the next patch refactors virDomainSnapshotObj; oh well...). Signed-off-by: Eric Blake

[libvirt] [PATCH 08/16] snapshot: Access snapshot def directly when needed

2019-03-19 Thread Eric Blake
An upcoming patch will rework virDomainSnapshotObjList to be generic for both snapshots and checkpoints; reduce the churn by adding a new accessor virDomainSnapshotObjGetDef() which returns the snapshot-specific definition even when the list is rewritten to operate only on a base class, then using

[libvirt] [PATCH 16/16] backup: Introduce virDomainCheckpointPtr

2019-03-19 Thread Eric Blake
Prepare for introducing a bunch of new public APIs related to backup checkpoints by first introducing a new internal type and errors associated with that type. Checkpoints are modeled heavily after virDomainSnapshotPtr (both represent a point in time of the guest), although a snapshot exists with

[libvirt] [PATCH 03/16] snapshot: Create virDomainMoment base class

2019-03-19 Thread Eric Blake
Upcoming patches want to add virDomainCheckpoint that behaves very similarly to virDomainSnapshot; the easiest way to share common code is to give both classes a common base class. Thanks to the accessor functions in the previous patch, we have very few changes required outside of datatypes.[ch].

[libvirt] [PATCH 09/16] snapshot: Refactor list filtering

2019-03-19 Thread Eric Blake
Separate the algorithm for which list members to vist (which is generic and can be shared with checkpoints, provided that checkpoints pick the same bit values for some of its flags) from the decision on which members to return (which is specific to snapshots). The typedef for the callback

[libvirt] [PATCH 14/16] snapshot: Move snapshot list code into generic file

2019-03-19 Thread Eric Blake
Finish the code motion of generic moment list handling. Well, mostly - we need to convert to using virObject to get polymorphic cleanup functions (so for now there are still a few lingering ties specific to snapshots). In this case, I kept virDomainSnapshotObjList as a wrapper type around the new

[libvirt] [PATCH 12/16] snapshot: Rename virDomainSnapshotObjPtr

2019-03-19 Thread Eric Blake
Now that the core of SnapshotObj is agnostic to snapshots and can be shared with upcoming checkpoint code, it is time to rename the struct and the functions specific to list operations. A later patch will shuffle which file holds the common code. This is a fairly mechanical patch. Signed-off-by:

[libvirt] [PATCH 07/16] snapshot: Add accessors for updating snapshot list relations

2019-03-19 Thread Eric Blake
Rather than allowing a leaky abstraction where multiple drivers have to open-code operations that update the relations in a virDomainSnapshotObjList, it is better to add accessor functions so that updates to relations are maintained closer to the internals. The goal here is to avoid access to,

[libvirt] [PATCH 06/16] snapshot: Track current snapshot in virDomainSnapshotObjList

2019-03-19 Thread Eric Blake
It is easier to track the current snapshot as part of the list of snapshots. In particular, doing so lets us guarantee that the current snapshot is cleared if that snapshot is removed from the list (rather than depending on the caller to do so, and risking a use-after-free problem). This requires

[libvirt] [PATCH 15/16] snapshot: Tweaks to support new bulk dumpxml/import API

2019-03-19 Thread Eric Blake
Change the return value of virDomainSnapshotObjLisParse() to return the number of snapshots imported, and allow a return of 0 (the original proposal of adding a flag to virDomainSnapshotCreateXML required returning an arbitrary non-NULL snapshot, but with a new API that returns a count, we are no

[libvirt] [PATCH 11/16] snapshot: Switch type of virDomainSnapshotObj.def

2019-03-19 Thread Eric Blake
Another step towards making the object list reusable for both snapshots and checkpoints: the list code only ever needs items that are in the common virDomainMomentDef base type. This undoes a lot of the churn in accessing common members added the earlier patch. Signed-off-by: Eric Blake ---

[libvirt] [PATCH 02/16] snapshot: Use accessors for virDomainSnapshot members

2019-03-19 Thread Eric Blake
Upcoming patches want to add virDomainCheckpoint that behaves very similarly to virDomainSnapshot; the easiest way to share common code is to give both classes a common base class. If this were C++, we'd just use public member inheritance; but since it is C, we instead have to touch EVERY use of

[libvirt] [PATCH 13/16] snapshot: Rename file for virDomainMomentObj

2019-03-19 Thread Eric Blake
Now that we have made virDomainMomentObj sufficiently generic to support both snapshots and checkpoints, it is time to rename the file that it lives in. The split between a generic object and a list of the generic objects doesn't buy us as much, so it will be easier to stick all the moment list

[libvirt] [PATCH 01/16] test: Avoid use-after-free on virDomainSnapshotDelete

2019-03-19 Thread Eric Blake
The following virsh command was triggering a use-after-free: $ virsh -c test:///default ' snapshot-create-as test s1 snapshot-create-as test s2 snapshot-delete --children-only test s1 snapshot-current --name test' Domain snapshot s1 created Domain snapshot s2 created Domain snapshot s1

[libvirt] [PATCH 00/16] snapshot refactoring (incremental backup saga)

2019-03-19 Thread Eric Blake
A couple of these have seen the list before, but most of them are new. The bulk of this series is about refactoring snapshot_conf.c into smaller pieces that I can then reuse for implementing checkpoints, without having to open-code the hierarchy algorithms a second time (one of John's complaints

[libvirt] [PATCH 04/16] vbox: Clean up some snapshot usage

2019-03-19 Thread Eric Blake
An upcoming patch will be reworking virDomainSnapshotDef to have a base class; minimize the churn by using a local variable to reduce the number of dereferences required when acessing the domain definition associated with the snapshot. Signed-off-by: Eric Blake --- src/vbox/vbox_common.c | 65

[libvirt] [PATCH] virStoragePoolDefFree: Free @def->refresh

2019-03-19 Thread Michal Privoznik
In 669018bc9cb I've introduced def->refresh which might be allocated by virStoragePoolDefRefreshParse() but is never freed. Signed-off-by: Michal Privoznik --- Pushed under trivial rule. src/conf/storage_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/storage_conf.c

[libvirt] [PATCH] virStoragePoolDefParseSource: Don't leak @port

2019-03-19 Thread Michal Privoznik
In a1c453dc088, during VIR_AUTOFREE() rewrite this wasn't done properly. @port might be leaked because it's allocated in a for() loop. Signed-off-by: Michal Privoznik --- Pushed under trivial rule. src/conf/storage_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [libvirt] [PATCH] nwfilter: Don't crash when trying to add an nwfilter that's already being removed

2019-03-19 Thread Daniel P . Berrangé
On Tue, Mar 19, 2019 at 05:30:03PM +0100, Ján Tomko wrote: > On Tue, Mar 19, 2019 at 05:09:33PM +0100, Michal Privoznik wrote: > > On 3/19/19 4:53 PM, Ján Tomko wrote: > > > On Mon, Mar 18, 2019 at 05:27:39PM +0100, Michal Privoznik wrote: > > > >

[libvirt] [PATCH] conf: Drop unused variable

2019-03-19 Thread Andrea Bolognani
The refresh_volume_allocation variable in virStoragePoolDefParseXML() has been unused since its introduction in commit 669018bc9cb1, and Clang rightfully complains about this fact. Signed-off-by: Andrea Bolognani --- Pushed under the build breaker rule. src/conf/storage_conf.c | 1 - 1 file

Re: [libvirt] [PATCH] nwfilter: Don't crash when trying to add an nwfilter that's already being removed

2019-03-19 Thread Ján Tomko
On Tue, Mar 19, 2019 at 05:09:33PM +0100, Michal Privoznik wrote: On 3/19/19 4:53 PM, Ján Tomko wrote: On Mon, Mar 18, 2019 at 05:27:39PM +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1686927 When trying to create a nwfilter binding via nwfilterBindingCreateXML()

Re: [libvirt] [PATCH] spec: Only call ldconfig on RHEL7

2019-03-19 Thread Andrea Bolognani
On Tue, 2019-03-19 at 12:10 -0400, Cole Robinson wrote: > On 3/19/19 11:59 AM, Andrea Bolognani wrote: > > What I was pointing out is that you're supposed to run ldconfig > > after (un)installing libraries: our libraries are shipped in the > > libvirt-libs package, but according to the spec file

Re: [libvirt] [PATCH] spec: Only call ldconfig on RHEL7

2019-03-19 Thread Cole Robinson
On 3/19/19 11:59 AM, Andrea Bolognani wrote: On Tue, 2019-03-19 at 10:49 -0400, Cole Robinson wrote: On 3/19/19 4:13 AM, Andrea Bolognani wrote: On Mon, 2019-03-18 at 15:35 -0400, Cole Robinson wrote: %post client +%if 0%{?rhel} == 7 /sbin/ldconfig +%endif %systemd_post

Re: [libvirt] [PATCH] nwfilter: Don't crash when trying to add an nwfilter that's already being removed

2019-03-19 Thread Michal Privoznik
On 3/19/19 4:53 PM, Ján Tomko wrote: On Mon, Mar 18, 2019 at 05:27:39PM +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1686927 When trying to create a nwfilter binding via nwfilterBindingCreateXML() we may encounter a crash. The sequence of functions called is as

[libvirt] [PATCH] rpm: fix upgrades when RBD is disabled in a new version

2019-03-19 Thread Daniel P . Berrangé
We previously had to disable RBD on 32-bit platforms since Ceph has dropped all support for 32-bit. Unfortunately anyone with the RPM libvirt-daemon-driver-storage-rbd installed on 32-bit now has a broken upgrade path. To fix this we must make libvirt-daemon-driver-storage-common have an

Re: [libvirt] [PATCH v3 1/3] rbd: do not attempt to use fast-diff if it's marked invalid

2019-03-19 Thread Michal Privoznik
On 3/19/19 2:42 PM, jdill...@redhat.com wrote: From: Jason Dillaman The librbd API will transparently revert to a slow disk usage calculation method if the fast-diff map is marked as invalid. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 41

Re: [libvirt] [PATCH v3 2/3] storage: optional 'refresh' elemement on pool

2019-03-19 Thread Michal Privoznik
On 3/19/19 2:42 PM, jdill...@redhat.com wrote: From: Jason Dillaman The new 'refresh' element can override the default refresh operations for a storage pool. The only currently supported override is to set the volume allocation size to the volume capacity. This can be specified by adding the

Re: [libvirt] [PATCH v3 0/3] rbd: improvements to actual disk-usage calculation

2019-03-19 Thread Michal Privoznik
On 3/19/19 2:42 PM, jdill...@redhat.com wrote: From: Jason Dillaman The RBD fast-diff feature can vastly reduce the amount of time needed to calculate actual disk usage of volumes, but it might still be a slow operation for large RBD pools or pools with large RBD images. Therefore, this

Re: [libvirt] [PATCH v3 3/3] rbd: optionally compute volume allocation from capacity

2019-03-19 Thread Michal Privoznik
On 3/19/19 2:42 PM, jdill...@redhat.com wrote: From: Jason Dillaman Use the new refresh volume allocation pool override to skip computing the actual volume usage if disabled. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [libvirt] [PATCH] spec: Only call ldconfig on RHEL7

2019-03-19 Thread Andrea Bolognani
On Tue, 2019-03-19 at 10:49 -0400, Cole Robinson wrote: > On 3/19/19 4:13 AM, Andrea Bolognani wrote: > > On Mon, 2019-03-18 at 15:35 -0400, Cole Robinson wrote: > > > %post client > > > > > > +%if 0%{?rhel} == 7 > > > /sbin/ldconfig > > > +%endif > > > %systemd_post

Re: [libvirt] [PATCH] nwfilter: Don't crash when trying to add an nwfilter that's already being removed

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 05:27:39PM +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1686927 When trying to create a nwfilter binding via nwfilterBindingCreateXML() we may encounter a crash. The sequence of functions called is as follows: 1) nwfilterBindingCreateXML()

[libvirt] [jenkins-ci PATCH] guests: Update test dependencies for osinfo-db

2019-03-19 Thread Fabiano Fidêncio
The new dependencies are: - python3 - python3-libxml2 - python3-pytest - python3-requests xmllint has been removed in favour of a own crafted test using python3-libmlx2 Signed-off-by: Fabiano Fidêncio --- guests/vars/projects/osinfo-db.yml | 5 - 1 file changed, 4 insertions(+), 1

Re: [libvirt] [PATCH 34/34] conf: Remove @seclabels from virDomainStorageSourceFormat

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:23PM +0100, Peter Krempa wrote: All callers now pass true so we can remove the argument. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: [libvirt] [PATCH 33/34] conf: Remove @seclabels from virDomainDiskSourceFormat

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:22PM +0100, Peter Krempa wrote: All callers pass in 'true' so we can remove the parameter. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 9 - src/conf/domain_conf.h | 1 - src/conf/snapshot_conf.c | 2 +- tests/virstoragetest.c | 2 +- 4 files

Re: [libvirt] [PATCH 32/34] conf: Format seclabels for

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:21PM +0100, Peter Krempa wrote: We parse the seclabels and use them internally so omitting them when formatting would be misleading. Additionally our schema actually allows them. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c

Re: [libvirt] [PATCH 31/34] conf: Add 'index' attribute for

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:20PM +0100, Peter Krempa wrote: Similarly to the disk source we need to keep the disk index (which is in the qemu driver used for identification of the source for block jobs) for the element so that when it's replaced as a disk source after pivoting all the

Re: [libvirt] [PATCH 21/21] tests: qemuxml2argv: add TEST_INTERNAL

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > +# define TEST_INTERNAL(_name, _suffix, ...) \ This macro should be called DO_TEST_INTERNAL() - you're still running the test from it, so the DO_ prefix is fully warranted. Reviewed-by: Andrea Bolognani -- Andrea Bolognani / Red

Re: [libvirt] [PATCH 20/21] tests: qemuxml2argv: move DO_CAPS_TEST* qemuCaps init

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > @@ -612,20 +614,25 @@ typedef enum { > ARG_MIGRATE_FD, > ARG_FLAGS, > ARG_PARSEFLAGS, > +ARG_CAPS_ARCH, > +ARG_CAPS_VER, I guess these could be simply ARG_ARCH and ARG_VER, but I don't have a terribly strong

Re: [libvirt] [PATCH 30/34] conf: Parse and format 'backingStore' for disk

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:19PM +0100, Peter Krempa wrote: When the block copy operation is started with a reused external file in incremental mode libvirt will need to open and insert the backing chain for that file into qemu (in -blockdev mode). This means that we'll need to track the

Re: [libvirt] [PATCH 19/21] tests: qemuxml2argv: move DO_TEST qemuCaps init

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > +if (gic && testQemuCapsSetGIC(info->qemuCaps, gic) < 0) > +goto cleanup; Please change the first part of the condition to 'gic != GIC_NONE' so that it doesn't implicitly rely on the actual value. Reviewed-by: Andrea

Re: [libvirt] [PATCH v2] numa: warn if numa 'mem' option or default RAM splitting between nodes is used.

2019-03-19 Thread Daniel P . Berrangé
On Tue, Mar 19, 2019 at 02:08:01PM +0100, Igor Mammedov wrote: > On Thu, 7 Mar 2019 10:07:05 + > Daniel P. Berrangé wrote: > > > On Wed, Mar 06, 2019 at 07:54:17PM +0100, Igor Mammedov wrote: > > > On Wed, 6 Mar 2019 18:16:08 + > > > Daniel P. Berrangé wrote: > > > > > > > On Wed,

Re: [libvirt] [PATCH] spec: Only call ldconfig on RHEL7

2019-03-19 Thread Cole Robinson
On 3/19/19 4:13 AM, Andrea Bolognani wrote: On Mon, 2019-03-18 at 15:35 -0400, Cole Robinson wrote: Since Fedora 28 (our minimum supported build), ldconfig is called automatically for us: https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets These changes appear to be

Re: [libvirt] [PATCH 29/34] conf: Parse in virDomainStorageSourceParseFull

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:18PM +0100, Peter Krempa wrote: Move parsing of into virDomainStorageSourceParseFull so that it can be reused easily. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 100 +-- src/conf/domain_conf.h | 3 +-

Re: [libvirt] [PATCH 28/34] conf: Use virDomainStorageSourceParseFull in virDomainDiskDefMirrorParse

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:17PM +0100, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital signature -- libvir-list

Re: [libvirt] [PATCH 18/21] tests: qemuxml2argv: add testInfoClear

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > This is closer to the pattern of qemuxml2xml tests, and will make > things easier if we extend testInfo to contain more freeable data > > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 11 --- > 1 file changed, 8

Re: [libvirt] [PATCH 17/21] tests: qemuxml2argv: build capsfile in DO_TEST_CAPS_INTERNAL

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > Rather than make callers do it. The operative info is just arch > and ver which we are passing in already. > > Fold in stripmachinealiases too since it is just dependent on > ver value > > Signed-off-by: Cole Robinson > --- >

Re: [libvirt] [PATCH 11/21] tests: qemuxml2argv: remove unused DO_TEST_CAPS* macros

2019-03-19 Thread Ján Tomko
On Tue, Mar 19, 2019 at 02:31:47PM +0100, Andrea Bolognani wrote: On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] -# define DO_TEST_CAPS(name, ver) \ -DO_TEST_CAPS_FULL(name, 0, 0, ver) I fail to see why this one existed in the first place - isn't it basically the same as

Re: [libvirt] [PATCH 16/21] tests: qemuxml2argv: centralize CAPS suffix building

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Andrea Bolognani -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing

Re: [libvirt] [Qemu-devel] [PATCH 1/2] numa: deprecate 'mem' parameter of '-numa node' option

2019-03-19 Thread Igor Mammedov
On Sun, 10 Mar 2019 11:14:08 +0100 Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Mon, Mar 04, 2019 at 12:45:14PM +0100, Markus Armbruster wrote: > >> Daniel P. Berrangé writes: > >> > >> > On Mon, Mar 04, 2019 at 08:13:53AM +0100, Markus Armbruster wrote: > >> >> If we

Re: [libvirt] [PATCH 15/21] tests: qemuxml2argv: remove full testInfo initialization

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > +# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \ > arch, capsfile, stripmachinealiases, ...) \ > do { \ > static struct testInfo info = { \ > -name, "." suffix, NULL, NULL,

Re: [libvirt] [PATCH 14/21] tests: qemuxml2argv: use varargs for CAPS flags

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > +# define DO_TEST_CAPS_INTERNAL(name, suffix, \ > + arch, capsfile, stripmachinealiases, ...) \ > do { \ > static struct testInfo info = { \ > -name, "." suffix, NULL, NULL, -1,\

[libvirt] [PATCH 1/3] DO NOT APPLY: Simple reproducer for virDomainObjListRemove

2019-03-19 Thread Michal Privoznik
This bug demonstrates itself for other objects too, but let's show it for domains. Assume that dummy.xml contains a valid domain definition. Then 1) virsh create dummy.xml && sleep 1 2) virsh destroy dummy & 3) virsh create ../dummy.xml Observe error: error: Failed to create domain from

[libvirt] [PATCH 3/3] virNWFilterBindingObjListAddLocked: Produce better error message than 'Duplicate key'

2019-03-19 Thread Michal Privoznik
If there are two concurrent threads, one of which is removing an nwfilter from the list and the other is trying to add it back they may serialize in the following order: 1) obj->removing is set and @obj is unlocked. 2) The tread that's trying to add the nwfilter onto the list locks the list

[libvirt] [PATCH 2/3] virDomainObjListAddLocked: Produce better error message than 'Duplicate key'

2019-03-19 Thread Michal Privoznik
If there are two concurrent threads, one of which is removing a domain from the list and the other is trying to add it back they may serialize in the following order: 1) vm->removing is set and @vm is unlocked. 2) The tread that's trying to add the domain onto the list locks the list and tries

[libvirt] [PATCH 0/3] vir*ObjListAddLocked(): Produce better error message than 'Duplicate key'

2019-03-19 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): DO NOT APPLY: Simple reproducer for virDomainObjListRemove virDomainObjListAddLocked: Produce better error message than 'Duplicate key' virNWFilterBindingObjListAddLocked: Produce better error message than 'Duplicate key'

[libvirt] [PATCH v3 3/3] rbd: optionally compute volume allocation from capacity

2019-03-19 Thread jdillama
From: Jason Dillaman Use the new refresh volume allocation pool override to skip computing the actual volume usage if disabled. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH v3 2/3] storage: optional 'refresh' elemement on pool

2019-03-19 Thread jdillama
From: Jason Dillaman The new 'refresh' element can override the default refresh operations for a storage pool. The only currently supported override is to set the volume allocation size to the volume capacity. This can be specified by adding the following snippet: ... ... This is

[libvirt] [PATCH v3 1/3] rbd: do not attempt to use fast-diff if it's marked invalid

2019-03-19 Thread jdillama
From: Jason Dillaman The librbd API will transparently revert to a slow disk usage calculation method if the fast-diff map is marked as invalid. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 41 --- 1 file changed, 37 insertions(+), 4

[libvirt] [PATCH v3 0/3] rbd: improvements to actual disk-usage calculation

2019-03-19 Thread jdillama
From: Jason Dillaman The RBD fast-diff feature can vastly reduce the amount of time needed to calculate actual disk usage of volumes, but it might still be a slow operation for large RBD pools or pools with large RBD images. Therefore, this feature should be able to be optionally disabled if

Re: [libvirt] [PATCH 13/21] tests: qemuxml2argv: remove unused CAPS migrateFrom

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Andrea Bolognani -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list

Re: [libvirt] [PATCH 12/21] tests: qemuxml2argv: add a comment separating DO_TEST* macros

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c > index 130ab29d6e..b555166e82 100644 > ---

Re: [libvirt] [PATCH 11/21] tests: qemuxml2argv: remove unused DO_TEST_CAPS* macros

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > -# define DO_TEST_CAPS(name, ver) \ > -DO_TEST_CAPS_FULL(name, 0, 0, ver) I fail to see why this one existed in the first place - isn't it basically the same as DO_TEST_CAPS_VER()? Reviewed-by: Andrea Bolognani -- Andrea

Re: [libvirt] [PATCH 10/21] tests: qemuxml2argv: remove DO_TEST_PARSE_FLAGS_ERROR

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > +DO_TEST_FULL("missing-machine", > + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, > + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, > + ARG_QEMU_CAPS, NONE);

Re: [libvirt] [PATCH 27/34] conf: Use virDomainStorageSourceParseFull to parse disk source in virDomainDiskDefParseXML

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:16PM +0100, Peter Krempa wrote: Use the new parser function for disk source. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: [libvirt] [PATCH 09/21] tests: qemuxml2argv: handle parseFlags with varargs

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > This allows us to drop parseFlags from DO_TEST_FULL > > Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 08/21] tests: qemuxml2argv: handle flags with varargs

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > This allows us to drop flags from DO_TEST_FULL > > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 37 ++--- > 1 file changed, 22 insertions(+), 15 deletions(-) Reviewed-by: Andrea

Re: [libvirt] [PATCH 26/34] conf: Use virDomainStorageSourceParseFull in virDomainDiskBackingStoreParse

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:15PM +0100, Peter Krempa wrote: Replace most of the function by using the existing parsing helper. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 53 +- 1 file changed, 11 insertions(+), 42 deletions(-)

Re: [libvirt] [PATCH 07/21] tests: qemuxml2argv: handle migrate* with varargs

2019-03-19 Thread Andrea Bolognani
On Tue, 2019-03-19 at 14:10 +0100, Andrea Bolognani wrote: > On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > > This allows us to drop migrateFrom and migrateFd from DO_TEST_FULL > > > > Signed-off-by: Cole Robinson > > --- > > tests/qemuxml2argvtest.c | 46

Re: [libvirt] [PATCH 07/21] tests: qemuxml2argv: handle migrate* with varargs

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: > This allows us to drop migrateFrom and migrateFd from DO_TEST_FULL > > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 46 ++-- > 1 file changed, 30 insertions(+), 16 deletions(-)

Re: [libvirt] [PATCH 07/21] tests: qemuxml2argv: handle migrate* with varargs

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:44 -0400, Cole Robinson wrote: [...] > -DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, > +DO_TEST_FULL("restore-v2", 0, 0, > + ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, > ARG_QEMU_CAPS, NONE); > -

Re: [libvirt] [PATCH v2] numa: warn if numa 'mem' option or default RAM splitting between nodes is used.

2019-03-19 Thread Igor Mammedov
On Thu, 7 Mar 2019 10:07:05 + Daniel P. Berrangé wrote: > On Wed, Mar 06, 2019 at 07:54:17PM +0100, Igor Mammedov wrote: > > On Wed, 6 Mar 2019 18:16:08 + > > Daniel P. Berrangé wrote: > > > > > On Wed, Mar 06, 2019 at 06:33:25PM +0100, Igor Mammedov wrote: > > > > Amend -numa

Re: [libvirt] [PATCH 25/34] conf: Replace virDomainDiskSourceParse by virDomainStorageSourceParse

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:14PM +0100, Peter Krempa wrote: virDomainDiskSourceParse was now just a thin wrapper without any extra value. Replace all usage of it by the function it calls and remove the function. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 22

Re: [libvirt] [PATCH 06/21] tests: qemuxml2argv: handle gic with vaargs

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:43 -0400, Cole Robinson wrote: > Subject: [libvirt] [PATCH 06/21] tests: qemuxml2argv: handle gic with > vaargs > > This allows us to drop stub gic values from DO_TEST_FULL calls s/vaargs/varargs/ s/gic/GIC/ Reviewed-by: Andrea Bolognani -- Andrea Bolognani /

Re: [libvirt] [PATCH 24/34] conf: snapshot: Use virDomainStorageSourceParseFull for snapshots

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:13PM +0100, Peter Krempa wrote: Use the new parser instead of virDomainDiskSourceParse. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 38 +++--- 1 file changed, 11 insertions(+), 27 deletions(-) Reviewed-by: Ján Tomko

Re: [libvirt] [PATCH 23/34] tests: qemublock: Use new source formatter and parser in testBackingXMLjsonXML

2019-03-19 Thread Ján Tomko
On Mon, Mar 18, 2019 at 04:55:12PM +0100, Peter Krempa wrote: This is part of the effort to minimize use of virDomainDiskSourceParse. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 130 -- 1 file changed, 61 insertions(+), 69 deletions(-)

Re: [libvirt] [PATCH 05/21] tests: qemuxml2argv: break apart testInitQEMUCaps

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:43 -0400, Cole Robinson wrote: > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 23 +++ > 1 file changed, 3 insertions(+), 20 deletions(-) Reviewed-by: Andrea Bolognani -- Andrea Bolognani / Red Hat / Virtualization --

Re: [libvirt] [PATCH 04/21] tests: qemuxml2argv: push ARG_QEMU_CAPS to callers

2019-03-19 Thread Andrea Bolognani
On Thu, 2019-03-14 at 10:43 -0400, Cole Robinson wrote: > This is necessary before we can start adding more optional parameter > implementations to DO_TEST_FULL > > Signed-off-by: Cole Robinson > --- > tests/qemuxml2argvtest.c | 38 +- > 1 file changed, 25

[libvirt] [PATCH v3 35/36] conf: record a portid against the domain conf

2019-03-19 Thread Daniel P . Berrangé
The portid will be the UUID of the virNetworkPort object associated with the network interface when a guest is running. Signed-off-by: Daniel P. Berrangé --- docs/formatdomain.html.in | 8 +++ docs/schemas/domaincommon.rng | 5 +

[libvirt] [PATCH v3 33/36] lxc, libxl: notify network driver of NICs during reconnect

2019-03-19 Thread Daniel P . Berrangé
When starting up it is important to notify the network driver of any NICs which are used by running guests so that it can account for any resources they are using. Signed-off-by: Daniel P. Berrangé --- src/libxl/libxl_driver.c | 30 ++ src/lxc/lxc_process.c| 30

[libvirt] [PATCH v3 30/36] virsh: add support for network port APIs

2019-03-19 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- tools/virsh-completer.c | 50 + tools/virsh-completer.h | 4 + tools/virsh-network.c | 399 +++- tools/virsh-network.h | 5 + 4 files changed, 457 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH v3 34/36] lxc, libxl: save domain status after reconnect

2019-03-19 Thread Daniel P . Berrangé
The various steps involved in reconnecting to a domain may cause updates to the virDomainObj struct that need to be reflected in the saved status file. Signed-off-by: Daniel P. Berrangé --- src/libxl/libxl_driver.c | 3 +++ src/lxc/lxc_process.c| 5 + 2 files changed, 8 insertions(+)

[libvirt] [PATCH v3 32/36] network: add implementation of network port APIs

2019-03-19 Thread Daniel P . Berrangé
This initial implementation just wires up the APIs and does tracking of the port XML definitions. It is not yet integrated into the resource allocation logic. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 400 1 file changed, 400

[libvirt] [PATCH v3 36/36] conf: switch over to use network port APIs for virt drivers

2019-03-19 Thread Daniel P . Berrangé
Change the domain conf so invoke the new network port public APIs instead of the network callbacks. Signed-off-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 262 src/conf/domain_conf.h | 26 src/libvirt_private.syms| 1 -

[libvirt] [PATCH v3 31/36] conf: support recording ports against virNetworkObjPtr

2019-03-19 Thread Daniel P . Berrangé
The virNetworkObjPtr state will need to maintain a record of all virNetworkPortDefPtr objects associated with the network. Record these in a hash and add APIs for manipulating them. Signed-off-by: Daniel P. Berrangé --- src/conf/virnetworkobj.c | 303 +++

[libvirt] [PATCH v3 11/36] network: unconditionally merge port profiles

2019-03-19 Thread Daniel P . Berrangé
All but one of the network types supports port profiles. Rather than duplicating the code to merge profiles 3 times, do it once and then later report an error if used from the wrong place. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 54

[libvirt] [PATCH v3 29/36] remote: add support for new network port APIs

2019-03-19 Thread Daniel P . Berrangé
Define the wire protocol for the virNetworkPort APIs and enable the client/server RPC dispatch. Signed-off-by: Daniel P. Berrangé --- src/remote/remote_daemon_dispatch.c | 73 src/remote/remote_driver.c | 69 src/remote/remote_protocol.x| 124

[libvirt] [PATCH v3 21/36] network: convert hook script to take a network port XML

2019-03-19 Thread Daniel P . Berrangé
When (un)plugging an interface into a network, the 'plugged' and 'unplugged' operations are invoked in the hook script. The data provided to the script contains the network XML, the domain XML and the domain interface XML. When we strictly split the drivers up this will no longer be possible and

[libvirt] [PATCH v3 26/36] network: introduce networkUpdatePortBandwidth

2019-03-19 Thread Daniel P . Berrangé
Separate network port bandwidth update code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 115 1 file changed, 65 insertions(+), 50 deletions(-) diff --git

[libvirt] [PATCH v3 12/36] conf: don't pass interface type into virNetDevBandwidthParse

2019-03-19 Thread Daniel P . Berrangé
The virNetDevBandwidthParse method uses the interface type to decide whether to allow use of the "floor" parameter. Using the interface type is not convenient as callers may not have that available, but still wish to allow use of "floor". Switch to an explicit boolean to control its usage.

[libvirt] [PATCH v3 13/36] conf: introduce virNetworkPortDefPtr struct and XML support

2019-03-19 Thread Daniel P . Berrangé
Introduce a virNetworkPortDefPtr struct to represent the data associated with a virtual network port. Add APIs for parsing/formatting XML docs with the data. Signed-off-by: Daniel P. Berrangé --- src/conf/Makefile.inc.am | 2 + src/conf/virnetworkportdef.c

[libvirt] [PATCH v3 23/36] network: introduce networkAllocatePort

2019-03-19 Thread Daniel P . Berrangé
Separate network port allocation code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 143 +++- 1 file changed, 77 insertions(+), 66 deletions(-) diff --git a/src/network/bridge_driver.c

[libvirt] [PATCH v3 16/36] util: add API for copying virtual port profile data

2019-03-19 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 + src/util/virnetdevvportprofile.c | 16 src/util/virnetdevvportprofile.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index

[libvirt] [PATCH v3 14/36] network: stop passing virDomainNetDefPtr into bandwidth functions

2019-03-19 Thread Daniel P . Berrangé
The networkPlugBandwidth & networkUnplugBandwidth methods currently take a virDomainNetDefPtr. To remove the dependency on the domain config struct, pass individual parameters instead. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 94 -

[libvirt] [PATCH v3 22/36] network: remove the virDomainNetBandwidthChangeAllowed callback

2019-03-19 Thread Daniel P . Berrangé
The current qemu driver code for changing bandwidth on a NIC first asks the network driver if the change is supported, then changes the bandwidth on the VIF, and then tells the network driver to update the bandwidth on the bridge. This is potentially racing if a parallel API call causes the

[libvirt] [PATCH v3 19/36] network: convert networkNotifyActualDevice to virNetworkPortDef

2019-03-19 Thread Daniel P . Berrangé
Convert the virDomainNetDef object into a virNetworkPortDef object at the start of networkNotifyActualDevice. This largely decouples the method impl from the domain object type. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 91 ++--- 1 file

[libvirt] [PATCH v3 28/36] access: add permissions for network port objects

2019-03-19 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/access/genpolkit.pl| 2 +- src/access/viraccessdriver.h | 6 src/access/viraccessdrivernop.c| 11 src/access/viraccessdriverpolkit.c | 26 ++ src/access/viraccessdriverstack.c | 25 +

[libvirt] [PATCH v3 17/36] conf: add APIs to convert virDomainNetDef to virNetworkPortDef

2019-03-19 Thread Daniel P . Berrangé
Helper APIs are needed to - Populate basic virNetworkPortDef from virDomainNetDef - Set a virDomainActualNetDef from virNetworkPortDef - Populate a full virNetworkPortDef from virDomainActualNetDef Signed-off-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 272

[libvirt] [PATCH v3 25/36] network: introduce networkReleasePort

2019-03-19 Thread Daniel P . Berrangé
Separate network port deletion code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 91 - 1 file changed, 59 insertions(+), 32 deletions(-) diff --git a/src/network/bridge_driver.c

[libvirt] [PATCH v3 20/36] network: convert networkReleaseActualDevice to virNetworkPortDef

2019-03-19 Thread Daniel P . Berrangé
Convert the virDomainNetDef object into a virNetworkPortDef object at the start of networkReleaseActualDevice. This largely decouples the method impl from the domain object type. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 137 +++- 1 file

  1   2   >