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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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 |

Re: [libvirt] [PATCH] test: Avoid use-after-free on virDomainSnapshotDelete

2019-03-22 Thread Eric Blake
On 3/22/19 10:19 AM, Michal Privoznik wrote: > On 3/17/19 5:13 AM, Eric Blake wrote: >> 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 >>

Re: [libvirt] [PATCH v3 01/36] network: restrict usage of port management APIs

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: The port allocation APIs are currently called unconditionally for all types of NIC, but (mostly) only do anything for NICs with type=network. The exception is the port allocate API which does some validation even for NICs with type!=network. Relying

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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é Kind of pointless to look at the

Re: [libvirt] [PATCH 17/16] snapshot: Store qemu snapshot state in bulk

2019-03-22 Thread Eric Blake
[keeping context, because of adding Dan in cc] On 3/22/19 9:35 AM, John Ferlan wrote: > > > On 3/20/19 5:32 PM, Eric Blake wrote: >> Rather than one file per snapshot, store all qemu snapshots in a >> single file, using the recently added bulk snapshot list >> operations. For now, this doesn't

[libvirt] [PATCH v2 16/29] conf: introduce virDomainStorageSourceParseBase

2019-03-22 Thread Peter Krempa
The helper converts the 'type', 'format' and index values to enum values/numbers and does validation. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 39 +++ src/conf/domain_conf.h | 5 + src/libvirt_private.syms | 1 + 3 files changed, 45

[libvirt] [PATCH v2 26/29] conf: Pass 'flags' to virDomainDiskSourceFormat in virDomainDiskDefFormatMirror

2019-03-22 Thread Peter Krempa
We have the proper flags available so we can pass them to the fomatter. The added bonus is that private data may be formatted into the status XML. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH v2 29/29] conf: Add 'index' attribute for

2019-03-22 Thread Peter Krempa
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 allocated data is present. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH v2 27/29] conf: Refactor virDomainDiskDefMirrorParse

2019-03-22 Thread Peter Krempa
Use virDomainStorageSourceParseBase and other tricks. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 52 +- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH v2 14/29] conf: Document virDomainDiskSourceFormat

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 1 file changed, 12 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index db02005f5b..fa50b6f000 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23716,6 +23716,18 @@

[libvirt] [PATCH v2 23/29] qemu: Use virDomainStorageSourceParseBase in qemuDomainObjPrivateXMLParseJobNBDSource

2019-03-22 Thread Peter Krempa
The slight possible regression in error message descriptivness doesn't matter much as the function parses private data which should not be touched by users in the first place. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 25 - 1 file changed, 4 insertions(+),

[libvirt] [PATCH v2 20/29] conf: Allow convenient lookup of in virDomainStorageSourceParse

2019-03-22 Thread Peter Krempa
If NULL is passed, the function will lookup in current context. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 +++- src/conf/domain_conf.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH v2 11/29] conf: Avoid temporary variable in virDomainDiskBackingStoreFormat

2019-03-22 Thread Peter Krempa
Modify the check that the format is in range to be standalone and use the convertor function directly. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH v2 19/29] conf: Modify arguments passed to virDomainDiskBackingStoreFormat

2019-03-22 Thread Peter Krempa
Pass in 'src' rather than the backing store of it. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8fa06aff03..5773d07474 100644 --- a/src/conf/domain_conf.c

[libvirt] [PATCH v2 04/29] conf: Export virDomainDiskSourceFormat

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index bf5625fbf4..c26c525d37 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -354,6 +354,7 @@

[libvirt] [PATCH v2 10/29] conf: Simplify control flow in virDomainDiskSourceFormat

2019-03-22 Thread Peter Krempa
Now that the cleanup is handled automatically it can be removed. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ec81d380d5..fa4454a6ca 100644 ---

[libvirt] [PATCH v2 17/29] conf: Use virDomainStorageSourceParseBase in virDomainDiskBackingStoreParse

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 37 ++--- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9b64e33ff5..15bb00e800 100644 --- a/src/conf/domain_conf.c +++

[libvirt] [PATCH v2 25/29] conf: use virXMLFormatElement in virDomainDiskDefFormatMirror

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 852489e185..5c82ac0a18 100644 --- a/src/conf/domain_conf.c +++

[libvirt] [PATCH v2 21/29] qemu: Use VIR_AUTOFREE in qemuDomainObjPrivateXMLParseJobNBDSource

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3b0887a194..9323421e49 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2715,8 +2715,8 @@

[libvirt] [PATCH v2 28/29] conf: Parse and format 'backingStore' for disk

2019-03-22 Thread Peter Krempa
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 backing chain and metadata such as node names for the full chain of .

[libvirt] [PATCH v2 01/29] conf: Format seclabels for

2019-03-22 Thread Peter Krempa
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| 3 +-- tests/qemuxml2argvdata/disk-backing-chains.xml

[libvirt] [PATCH v2 00/29] conf: refactor virStorageSource parsing and formatting (blockdev-add saga)

2019-03-22 Thread Peter Krempa
Most patches were changed too substantially to warrant keeping the Rb's. Peter Krempa (29): conf: Format seclabels for conf: Remove @seclabels from virDomainStorageSourceFormat conf: Merge virDomainDiskSourceFormatInternal into virDomainDiskSourceFormat conf: Export

[libvirt] [PATCH v2 12/29] conf: Use virXMLFormatElement in virDomainDiskBackingStoreFormat

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5adca7c29c..89e2900df2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@

[libvirt] [PATCH v2 24/29] qemu: Parse NBD storage source private data by virDomainStorageSourceParse

2019-03-22 Thread Peter Krempa
Drop the local call in favor of passing in xmlopt. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0c06e3b23a..0be00f804e 100644 ---

[libvirt] [PATCH v2 13/29] conf: Merge virDomainStorageSourceFormat into virDomainDiskSourceFormat

2019-03-22 Thread Peter Krempa
There was only one caller, remove the unnecessary wrapper. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 60 -- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH v2 09/29] conf: Unexport virDomainStorageSourceFormat

2019-03-22 Thread Peter Krempa
It's not used outside of src/conf/domain_conf.c Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 5 - src/libvirt_private.syms | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

[libvirt] [PATCH v2 22/29] qemu: Remove cleanup in qemuDomainObjPrivateXMLParseJobNBDSource

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9323421e49..c7454ce821 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@

[libvirt] [PATCH v2 15/29] conf: Replace virDomainDiskSourceParse by virDomainStorageSourceParse

2019-03-22 Thread Peter Krempa
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 -- src/conf/domain_conf.h | 5 -

[libvirt] [PATCH v2 05/29] tests: qemuxml2xml: Use virdeterministichashmock.so

2019-03-22 Thread Peter Krempa
Block job related data will be stored in a has table and formatted into the status XML. Use the mock to guarantee stable tests. Signed-off-by: Peter Krempa --- tests/qemuxml2xmltest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2xmltest.c

[libvirt] [PATCH v2 07/29] tests: qemustatusxml2xml: Add separate output for migration-out-nbd-tls

2019-03-22 Thread Peter Krempa
Upcomming change will modify some aspects. To allow testing upgrade path add a separate output file so that we can see the conversion from old to new config. Signed-off-by: Peter Krempa --- .../migration-out-nbd-tls-out.xml | 484 +- 1 file changed, 483

[libvirt] [PATCH v2 18/29] conf: Document virDomainStorageSourceParse

2019-03-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 1 file changed, 12 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 15bb00e800..8fa06aff03 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9078,6 +9078,18 @@

[libvirt] [PATCH v2 08/29] qemu: domain: Modify to look like

2019-03-22 Thread Peter Krempa
When adding I've used a slightly unusual approach. To allow using the disk source XML parser and formatter convert to look like . This means that will be added as a subelement of rather than being formatted inline. Conversion from the old format in the parser is very simple as it involves

[libvirt] [PATCH v2 02/29] conf: Remove @seclabels from virDomainStorageSourceFormat

2019-03-22 Thread Peter Krempa
All callers including transitive callers through virDomainDiskSourceFormatInternal always pass true. Remove the argument. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 15 ++- src/conf/domain_conf.h | 3 +-- src/qemu/qemu_domain.c | 2 +- 3 files changed, 8

[libvirt] [PATCH v2 06/29] tests: qemustatusxml2xml: Add another disk to migration-out-nbd-tls case

2019-03-22 Thread Peter Krempa
Upcomming change will modify some aspects. To allow testing upgrade path add another disk. Signed-off-by: Peter Krempa --- .../migration-out-nbd-tls-in.xml | 19 +++ 1 file changed, 19 insertions(+) diff --git

[libvirt] [PATCH v2 03/29] conf: Merge virDomainDiskSourceFormatInternal into virDomainDiskSourceFormat

2019-03-22 Thread Peter Krempa
Remove the wrapper and fix callers. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 35 +++ src/conf/domain_conf.h | 1 + src/conf/snapshot_conf.c | 2 +- tests/qemublocktest.c| 2 +- tests/virstoragetest.c | 2 +- 5 files changed, 15

Re: [libvirt] [PATCH 14.5/16] snapshot: Make virDomainMomentObjListGetNames more generic

2019-03-22 Thread Eric Blake
On 3/22/19 9:00 AM, John Ferlan wrote: > > > On 3/22/19 12:25 AM, Eric Blake wrote: >> Rather than hard-coding the snapshot filter bit values into the >> generic code, add another layer of indirection: callers must map which >> of their public filter bits correspond to supported moment bits,

Re: [libvirt] [PATCH v3 18/36] network: convert networkAllocateActualDevice to virNetworkPortDef

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Convert the virDomainNetDef object into a virNetworkPortDef object at the start of networkAllocateActualDevice. This largely decouples the method impl from the domain object type. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c

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

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 01:11:34PM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > Helper APIs are needed to > > > > - Populate basic virNetworkPortDef from virDomainNetDef > > - Set a virDomainActualNetDef from virNetworkPortDef > > - Populate a full

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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é ---

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

2019-03-22 Thread Laine Stump
On 3/22/19 11:43 AM, Daniel P. Berrangé wrote: On Fri, Mar 22, 2019 at 11:28:17AM -0400, Laine Stump wrote: On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Introduce a virNetworkPortDefPtr struct to represent the data associated with a virtual network port. Add APIs for parsing/formatting XML

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

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 11:28:17AM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > Introduce a virNetworkPortDefPtr struct to represent the data associated > > with a virtual network port. Add APIs for parsing/formatting XML docs > > with the data. > > > >

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

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 11:32:53AM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > The networkPlugBandwidth & networkUnplugBandwidth methods currently take > > a virDomainNetDefPtr. To remove the dependency on the domain config > > struct, pass individual parameters

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

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 11:28:17AM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > Introduce a virNetworkPortDefPtr struct to represent the data associated > > with a virtual network port. Add APIs for parsing/formatting XML docs > > with the data. > > > >

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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

Re: [libvirt] [PATCH v3 15/36] network: make networkLogAllocation independent of domain conf

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Stop passing a virDomainNetDefPtr parameter to networkLogAllocation, instead just pass in the MAC address. The actual device type is also not required, since virNetworkForwardIfDefPtr has a type field that can be used instad. Signed-off-by: Daniel

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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é Reviewed-by: Laine Stump

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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 |

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

2019-03-22 Thread Laine Stump
On 3/22/19 11:11 AM, Daniel P. Berrangé wrote: On Fri, Mar 22, 2019 at 11:03:59AM -0400, Laine Stump wrote: On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: The virNetDevBandwidthParse method uses the interface type to decide whether to allow use of the "floor" parameter. Using the interface type

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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é Reviewed-by: Laine

Re: [libvirt] [PATCH] test: Avoid use-after-free on virDomainSnapshotDelete

2019-03-22 Thread Michal Privoznik
On 3/17/19 5:13 AM, Eric Blake wrote: 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

Re: [libvirt] [PATCH 0/2] tests: qemuxml2argv updates and tweaks

2019-03-22 Thread Michal Privoznik
On 3/21/19 12:28 PM, Andrea Bolognani wrote: Andrea Bolognani (2): tests: Update aarch64-virt-graphics for virtio-blk tests: Add s390x-ccw-graphics test case .../aarch64-virt-graphics.aarch64-latest.args | 9 ++-- .../aarch64-virt-graphics.xml | 3 +-

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

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 11:03:59AM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > 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

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

2019-03-22 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: 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

Re: [libvirt] [PATCH v3 10/36] network: move fixup for domain actual net def out of network driver

2019-03-22 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 10:33:30PM -0400, Laine Stump wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > The hypervisor drivers are soon going to communicate with the network > > driver via public APIs only. As such the network driver will not ever > > see the domain actual network def.

Re: [libvirt] [PATCH v3 06/36] util: add helper method for re-attaching a tap device to a bridge

2019-03-22 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 09:14:13PM -0400, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > Signed-off-by: Daniel P. Berrangé > > --- > > src/libvirt_private.syms | 1 + > > src/util/virnetdevtap.c | 69 > >

Re: [libvirt] [PATCH v3 05/36] network: use 'bridge' as actual type instead of 'network'

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 10:30:08AM -0400, Cole Robinson wrote: > On 3/21/19 10:16 PM, Laine Stump wrote: > > On 3/21/19 9:07 PM, Cole Robinson wrote: > >> On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > >>> Ports allocated on virtual networks with type=nat|route|open all get > >>> given an actual

Re: [libvirt] [PATCH v3 05/36] network: use 'bridge' as actual type instead of 'network'

2019-03-22 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 09:07:36PM -0400, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > Ports allocated on virtual networks with type=nat|route|open all get > > given an actual type of 'network'. > > > > Only ports in networks with type=bridge use an actual type of

Re: [libvirt] [PATCH v3 04/36] network: add missing bandwidth limits for bridge forward type

2019-03-22 Thread Daniel P . Berrangé
On Fri, Mar 22, 2019 at 10:39:40AM -0400, Cole Robinson wrote: > On 3/22/19 5:04 AM, Michal Privoznik wrote: > > On 3/22/19 3:02 AM, Laine Stump wrote: > >> On 3/21/19 9:52 PM, Laine Stump wrote: > >>> On 3/21/19 8:58 PM, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: >

Re: [libvirt] [PATCH 18/16] snapshot: Consolidate writing snapshot state to disk

2019-03-22 Thread John Ferlan
On 3/20/19 5:32 PM, Eric Blake wrote: > Remove a now-unused parameter from qemuDomainSnapshotWriteMetadata(). > Then, instead of calling it after every individual change to a given > snapshot, call it only once at the end of the API function that > resulted in any overall changes. > >

Re: [libvirt] [PATCH v3 02/36] network: pass a virNetworkPtr to port management APIs

2019-03-22 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 08:49:38PM -0400, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > The APIs for allocating/notifying/removing network ports just take > > an internal domain interface struct right now. As a step towards > > turning these into public facing APIs, add

Re: [libvirt] [PATCH v3 01/36] network: restrict usage of port management APIs

2019-03-22 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 08:27:20PM -0400, Cole Robinson wrote: > Okay so I needed to do some studying to understand what's going on in > the first part of this series. Just gonna type some notes here: > > virDomainActualNetDef tracks all the data we need to convert a > virNetworkPtr content to a

Re: [libvirt] [PATCH 20/21] qemu_hotplug: consolidate all common detach code in qemuDomainDetachDeviceLive

2019-03-22 Thread Laine Stump
On 3/22/19 10:14 AM, Peter Krempa wrote: On Fri, Mar 22, 2019 at 10:08:17 -0400, Laine Stump wrote: On 3/22/19 8:32 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:29:00 -0400, Laine Stump wrote: Now that all the qemuDomainDetachPrep*() functions look nearly identical at the end, we can

Re: [libvirt] [PATCH v3 04/36] network: add missing bandwidth limits for bridge forward type

2019-03-22 Thread Cole Robinson
On 3/22/19 5:04 AM, Michal Privoznik wrote: > On 3/22/19 3:02 AM, Laine Stump wrote: >> On 3/21/19 9:52 PM, Laine Stump wrote: >>> On 3/21/19 8:58 PM, Cole Robinson wrote: On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > In the case of a network with forward=bridge, which has a bridge

Re: [libvirt] [PATCH 17/16] snapshot: Store qemu snapshot state in bulk

2019-03-22 Thread John Ferlan
On 3/20/19 5:32 PM, Eric Blake wrote: > Rather than one file per snapshot, store all qemu snapshots in a > single file, using the recently added bulk snapshot list > operations. For now, this doesn't change how often libvirt writes a > snapshot file, but it does open the door for the next patch

Re: [libvirt] [PATCH v3 05/36] network: use 'bridge' as actual type instead of 'network'

2019-03-22 Thread Cole Robinson
On 3/21/19 10:16 PM, Laine Stump wrote: > On 3/21/19 9:07 PM, Cole Robinson wrote: >> On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: >>> Ports allocated on virtual networks with type=nat|route|open all get >>> given an actual type of 'network'. >>> >>> Only ports in networks with type=bridge use an

[libvirt] Bite sized task: #pragma once

2019-03-22 Thread Daniel P . Berrangé
A heads up that I added a trivial bite sized task to convert header files to use #pragma once https://wiki.libvirt.org/page/BiteSizedTasks#Switch_headers_to_use_.23pragma_once Regards, Daniel -- |: https://berrange.com -o-https://www.flickr.com/photos/dberrange :| |:

Re: [libvirt] [PATCH 21/21] qemu_hotplug: delay sending DEVICE_REMOVED event until after *all* teardown

2019-03-22 Thread Laine Stump
On 3/22/19 8:51 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:29:01 -0400, Laine Stump wrote: The VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event is sent after qemu has responded to a device_del command with a DEVICE_DELETED event. Before queuing the event, *some* of the final teardown of the

Re: [libvirt] [PATCH 20/21] qemu_hotplug: consolidate all common detach code in qemuDomainDetachDeviceLive

2019-03-22 Thread Peter Krempa
On Fri, Mar 22, 2019 at 10:08:17 -0400, Laine Stump wrote: > On 3/22/19 8:32 AM, Peter Krempa wrote: > > On Thu, Mar 21, 2019 at 18:29:00 -0400, Laine Stump wrote: > > > Now that all the qemuDomainDetachPrep*() functions look nearly > > > identical at the end, we can put one copy of that identical

Re: [libvirt] [PATCH 20/21] qemu_hotplug: consolidate all common detach code in qemuDomainDetachDeviceLive

2019-03-22 Thread Laine Stump
On 3/22/19 8:32 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:29:00 -0400, Laine Stump wrote: Now that all the qemuDomainDetachPrep*() functions look nearly identical at the end, we can put one copy of that identical code in qemuDomainDetachDeviceLive() at the point after the individual

Re: [libvirt] [PATCH 19/21] qemu_hotplug: new function qemuDomainRemoveAuditDevice()

2019-03-22 Thread Laine Stump
On 3/22/19 8:24 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:59 -0400, Laine Stump wrote: This function can be called with a virDomainDevicePtr and whether or not the removal was successful, and it will call the appropriate virDomainAudit*() function with the appropriate args for

Re: [libvirt] [PATCH 14.5/16] snapshot: Make virDomainMomentObjListGetNames more generic

2019-03-22 Thread John Ferlan
On 3/22/19 12:25 AM, Eric Blake wrote: > Rather than hard-coding the snapshot filter bit values into the > generic code, add another layer of indirection: callers must map which > of their public filter bits correspond to supported moment bits, then > pass two separate flags (the ones

Re: [libvirt] [PATCH 18/21] qemu_hotplug: standardize the names/args/calling of qemuDomainDetach*()

2019-03-22 Thread Laine Stump
On 3/22/19 8:10 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:58 -0400, Laine Stump wrote: Most of these functions will soon contain only some setup for detaching the device, not the detach code proper (since that code is identical for these devices). Their device specific functions are

Re: [libvirt] [PATCH 17/21] qemu_hotplug: rename dev to match in qemuDomainDetachDeviceLive

2019-03-22 Thread Laine Stump
On 3/22/19 7:50 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:57 -0400, Laine Stump wrote: I'm about to add a second virDomainDeviceDef to this function that will point to the actual device in the domain object. while this is just a partially filled-in example of what to look for.

Re: [libvirt] [PATCH 13/21] qemu_hotplug: move qemuDomainDetachDeviceLive() to qemu_hotplug.c

2019-03-22 Thread Peter Krempa
On Fri, Mar 22, 2019 at 09:36:31 -0400, Laine Stump wrote: > On 3/22/19 7:36 AM, Peter Krempa wrote: > > On Thu, Mar 21, 2019 at 18:28:53 -0400, Laine Stump wrote: > > > This function is going to take on some of the functionality of its > > > subordinate functions, which all live in

Re: [libvirt] [PATCH 15/21] qemu_hotplug: pull qemuDomainUpdateDeviceList out of qemuDomainDetachDeviceLive

2019-03-22 Thread Laine Stump
On 3/22/19 7:41 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:55 -0400, Laine Stump wrote: qemuDomainDetachDeviceLive() is called from two places in qemu_driver.c. Move the call to qemuDomainUpdateDeviceList() from the end of that function, which is now in qemu_hotplug.c, to the two

Re: [libvirt] [PATCH 14/21] qemu_hotplug: remove extra function in middle of DetachController call chain

2019-03-22 Thread Laine Stump
On 3/22/19 7:39 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:54 -0400, Laine Stump wrote: qemuDomainDetachDeviceControllerLive() just checks if the controller type is SCSI, and then either returns failure, or calls qemuDomainDetachControllerDevice(). Instead, lets just check for type

Re: [libvirt] [PATCH 13/21] qemu_hotplug: move qemuDomainDetachDeviceLive() to qemu_hotplug.c

2019-03-22 Thread Laine Stump
On 3/22/19 7:36 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:53 -0400, Laine Stump wrote: This function is going to take on some of the functionality of its subordinate functions, which all live in qemu_hotplug.c. Signed-off-by: Laine Stump --- src/qemu/qemu_driver.c | 95

Re: [libvirt] [PATCH 11/21] qemu_hotplug: move (almost) all qemuDomainDetach*() functions together

2019-03-22 Thread Laine Stump
On 3/22/19 7:30 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:51 -0400, Laine Stump wrote: There were two outliers at the end of the file beyond the Vcpu functions. Signed-off-by: Laine Stump --- src/qemu/qemu_hotplug.c | 174 1 file

Re: [libvirt] [PATCH 09/21] qemu_hotplug: merge qemuDomainDetachThisHostDevice into qemuDomainDetachHostDevice

2019-03-22 Thread Laine Stump
On 3/22/19 5:32 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:49 -0400, Laine Stump wrote: It's now only called from one place, and combining the two functions highlights the similarity with Detach functions for other device types. Signed-off-by: Laine Stump ---

Re: [libvirt] [PATCH 07/21] qemu_hotplug: refactor qemuDomainDetachDiskLive and qemuDomainDetachDiskDevice

2019-03-22 Thread Laine Stump
On 3/22/19 5:07 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:47 -0400, Laine Stump wrote: qemuDomainDetachDiskDevice() is only called from one place. Moving the contents of the function to that place makes qemuDomainDetachDiskLive() more similar to the other Detach functions called by

Re: [libvirt] [PATCH 05/21] qemu_hotplug: eliminate multiple identical qemuDomainDetachHost*Device() functions

2019-03-22 Thread Laine Stump
On 3/22/19 8:28 AM, Ján Tomko wrote: On Thu, Mar 21, 2019 at 06:28:45PM -0400, Laine Stump wrote: There are separate Detach functions for PCI, USB, SCSI, Vhost, and Mediated hostdevs, but the functions are all 100% the same code, except that the PCI function checks for the guest side of the

Re: [libvirt] [PATCH 05/21] qemu_hotplug: eliminate multiple identical qemuDomainDetachHost*Device() functions

2019-03-22 Thread Laine Stump
On 3/22/19 4:27 AM, Peter Krempa wrote: On Thu, Mar 21, 2019 at 18:28:45 -0400, Laine Stump wrote: There are separate Detach functions for PCI, USB, SCSI, Vhost, and Mediated hostdevs, but the functions are all 100% the same code, except that the PCI function checks for the guest side of the

Re: [libvirt] [Qemu-devel] [PULL v3 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-22 Thread Philippe Mathieu-Daudé
Le jeu. 21 mars 2019 13:39, Laszlo Ersek a écrit : > On 03/21/19 01:53, Laszlo Ersek wrote: > > Hi Paolo, > > > > (+libvir-list) > > > > I'd like to report a regression introduced by this patch set: > > > > On 03/07/19 21:58, Paolo Bonzini wrote: > >> The following changes since commit > >>

Re: [libvirt] [PATCH 01/21] qemu_hotplug: remove erroneous call to qemuDomainDetachExtensionDevice()

2019-03-22 Thread Boris Fiuczynski
I agree. This must have slipped in during the countless iterations. Thanks for catching it. Reviewed-by: Boris Fiuczynski On 3/21/19 11:28 PM, Laine Stump wrote: qemuDomainDetachControllerDevice() calls qemuDomainDetachExtensionDevice() when the *controller* type is PCI. This is incorrect in

Re: [libvirt] [PATCH 21/21] qemu_hotplug: delay sending DEVICE_REMOVED event until after *all* teardown

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:29:01 -0400, Laine Stump wrote: > The VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event is sent after qemu has > responded to a device_del command with a DEVICE_DELETED event. Before > queuing the event, *some* of the final teardown of the device's > trappings in libvirt is done,

Re: [libvirt] [PATCH 20/21] qemu_hotplug: consolidate all common detach code in qemuDomainDetachDeviceLive

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:29:00 -0400, Laine Stump wrote: > Now that all the qemuDomainDetachPrep*() functions look nearly > identical at the end, we can put one copy of that identical code in > qemuDomainDetachDeviceLive() at the point after the individual prep > functions have been called, and

Re: [libvirt] [PATCH 02/21] qemu_hotplug: remove another erroneous qemuDomainDetachExtensionDevice() call

2019-03-22 Thread Boris Fiuczynski
I agree. Reviewed-by: Boris Fiuczynski On 3/21/19 11:28 PM, Laine Stump wrote: qemuDomainRemoveRNGDevice() calls qemuDomainDetachExtensionDevice(). According to commit 1d1e264f1 that added this code, it should not be necessary to explicitly remove the zPCI extension device for a PCI device

Re: [libvirt] [PATCH 05/21] qemu_hotplug: eliminate multiple identical qemuDomainDetachHost*Device() functions

2019-03-22 Thread Ján Tomko
On Thu, Mar 21, 2019 at 06:28:45PM -0400, Laine Stump wrote: There are separate Detach functions for PCI, USB, SCSI, Vhost, and Mediated hostdevs, but the functions are all 100% the same code, except that the PCI function checks for the guest side of the device being a PCI Multifunction device,

Re: [libvirt] [PATCH 19/21] qemu_hotplug: new function qemuDomainRemoveAuditDevice()

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:59 -0400, Laine Stump wrote: > This function can be called with a virDomainDevicePtr and whether or > not the removal was successful, and it will call the appropriate > virDomainAudit*() function with the appropriate args for whatever type > of device it's given (or

[libvirt] [PATCH] tests: Don't use canonical paths in virstoragetest

2019-03-22 Thread Andrea Bolognani
The layout of my home directory is somewhat peculiar: I store all git repositories in ~/src/upstream, but since I spend almost all of my time hacking on libvirt, I also have a convenience symlink ~/src/libvirt -> ~/src/upstream/libvirt that I use to access that specific git repository. The above

Re: [libvirt] [PATCH 18/21] qemu_hotplug: standardize the names/args/calling of qemuDomainDetach*()

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:58 -0400, Laine Stump wrote: > Most of these functions will soon contain only some setup for > detaching the device, not the detach code proper (since that code is > identical for these devices). Their device specific functions are all > being renamed to

Re: [libvirt] [PATCH 03/21] qemu_hotplug: remove unnecessary check for valid PCI address

2019-03-22 Thread Ján Tomko
On Thu, Mar 21, 2019 at 06:28:43PM -0400, Laine Stump wrote: When support for hotplug/unplug of SCSI controllers was added way back in December 2009 (commit da9d937b), unplug was handled by calling the now-extinct function qemuMonitorRemovePCIDevice(), which required a PCI address as an

Re: [libvirt] [PATCH 02/21] qemu_hotplug: remove another erroneous qemuDomainDetachExtensionDevice() call

2019-03-22 Thread Ján Tomko
On Thu, Mar 21, 2019 at 06:28:42PM -0400, Laine Stump wrote: qemuDomainRemoveRNGDevice() calls qemuDomainDetachExtensionDevice(). According to commit 1d1e264f1 that added this code, it should not be necessary to explicitly remove the zPCI extension device for a PCI device during unplug, because

Re: [libvirt] [PATCH 01/21] qemu_hotplug: remove erroneous call to qemuDomainDetachExtensionDevice()

2019-03-22 Thread Ján Tomko
On Thu, Mar 21, 2019 at 06:28:41PM -0400, Laine Stump wrote: qemuDomainDetachControllerDevice() calls qemuDomainDetachExtensionDevice() when the *controller* type is PCI. This is incorrect in multiple ways: * Any code that tears down a device should be in the qemuDomainRemove*Device() function

Re: [libvirt] [PATCH 17/21] qemu_hotplug: rename dev to match in qemuDomainDetachDeviceLive

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:57 -0400, Laine Stump wrote: > I'm about to add a second virDomainDeviceDef to this function that > will point to the actual device in the domain object. while this is > just a partially filled-in example of what to look for. Naming it > match will make the code

Re: [libvirt] [PATCH] virDomainMomentAssignDef: Don't dereference a NULL pointer

2019-03-22 Thread Eric Blake
On 3/22/19 4:42 AM, Michal Privoznik wrote: > This functions tries to add a domain moment (love the name!) onto > a list of domain moments. Firstly, it checks if another moment > with the same name already exists. Then, it creates an empty > moment (without initializing its definition) and tries

Re: [libvirt] [PATCH 16/21] test: replace calls to individual detach functions with one call to main detach

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:56 -0400, Laine Stump wrote: > The individual qemuDomainDetach*Device() functions will soon be "less > functional", since some of the code that is duplicated in 10 of the 12 > detach functions is going to be moved into the common > qemuDomainDetachDeviceLive(), which

Re: [libvirt] [PATCH 15/21] qemu_hotplug: pull qemuDomainUpdateDeviceList out of qemuDomainDetachDeviceLive

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:55 -0400, Laine Stump wrote: > qemuDomainDetachDeviceLive() is called from two places in > qemu_driver.c. Move the call to qemuDomainUpdateDeviceList() from the > end of that function, which is now in qemu_hotplug.c, to the two > places that call

Re: [libvirt] [PATCH 14/21] qemu_hotplug: remove extra function in middle of DetachController call chain

2019-03-22 Thread Peter Krempa
On Thu, Mar 21, 2019 at 18:28:54 -0400, Laine Stump wrote: > qemuDomainDetachDeviceControllerLive() just checks if the controller > type is SCSI, and then either returns failure, or calls > qemuDomainDetachControllerDevice(). > > Instead, lets just check for type != SCSI at the top of the latter

  1   2   >