Re: [libvirt PATCH v3 00/21] Add support for persistent mediated devices

2021-01-04 Thread Yan Fu
Tested with v6.10.0-283-g1948d4e61e. 1.Can define/start/destroy mdev device successfully; 2.'virsh nodedev-list' has no '--active' option, which is inconsistent with the description in the patch: # virsh nodedev-list --active error: command 'nodedev-list' doesn't support option --active 3.virsh

Re: [libvirt PATCH v2 3/5] vmx: Make virVMXParseFileName return an integer

2021-01-04 Thread Daniel Henrique Barboza
On 12/21/20 1:19 PM, Martin Kletzander wrote: And return the actual extracted value in a parameter. This way we can later return success even without any extracted value. Signed-off-by: Martin Kletzander --- src/esx/esx_driver.c | 31 ++-

Re: [PATCH v2] conf: Add support for keeping TPM emulator state

2021-01-04 Thread Daniel Henrique Barboza
On 1/3/21 11:31 PM, Eiichi Tsukata wrote: Currently, swtpm TPM state file is removed when a transient domain is powered off or undefined. When we store TPM state on a shared storage such as NFS and use transient domain, TPM states should be kept as it is. Add per-TPM emulator option

Re: [PATCH 6/7] util: Added a backing store NFS parser

2021-01-04 Thread Ryan Gahagan
On Mon, Jan 4, 2021 at 8:41 AM Peter Krempa wrote: > On Tue, Dec 29, 2020 at 15:21:28 -0600, Ryan Gahagan wrote: > > +src->nfs_uid = (uid_t) uidStore; > > +src->nfs_gid = (gid_t) gidStore; > > This function must not fill in runtime data, just configuration. I > presume you did this to

Re: [PATCH 3/7] docs: added rng schema and formatdomain for NFS

2021-01-04 Thread Ryan Gahagan
On Mon, Jan 4, 2021 at 8:24 AM Peter Krempa wrote: > On Tue, Dec 29, 2020 at 15:21:25 -0600, Ryan Gahagan wrote: > > + > > + > > + > > + > > + > > +nfs > > + > > + > > + > > + > > + > > This allows also 'port'

Re: To start multiple KVM guests from one qcow2 image with transient disk option

2021-01-04 Thread Masayoshi Mizuma
On Sat, Dec 19, 2020 at 11:30:39PM -0500, Masayoshi Mizuma wrote: > On Thu, Dec 17, 2020 at 10:39:36AM +0100, Peter Krempa wrote: > > On Mon, Dec 14, 2020 at 22:49:03 -0500, Masayoshi Mizuma wrote: > > > On Sat, Dec 12, 2020 at 11:57:15AM +0100, Peter Krempa wrote: > > > > On Fri, Dec 11, 2020 at

Re: [libvirt PATCH 0/2] rpm: minor swtpm fixes

2021-01-04 Thread Laine Stump
On 1/4/21 1:05 PM, Daniel P. Berrangé wrote: Originally reported at https://src.fedoraproject.org/rpms/libvirt/pull-request/9 Daniel P. Berrangé (2): rpm: ensure swtpm tools are installed with QEMU rpm: fix ownership of the swtpm log directory libvirt.spec.in | 5 - 1 file

Re: [PATCH 0/5] Fix qemuNodeGetSecurityModel() and some related cleanups

2021-01-04 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: While I'd love to give more context, I can't - I've found these on a stale branch. However, they are still valid and worth of merging. Michal Prívozník (5): qemu: Use virStrcpy in qemuNodeGetSecurityModel() qemu: Obtain @caps only after ACL check

[PATCH 5/5] use more virStrcpy() and virStrcpyStatic()

2021-01-04 Thread Michal Privoznik
There are a few places where we open code virStrcpy() or virStrcpyStatic(). Call respective functions instead. Signed-off-by: Michal Privoznik --- src/libvirt-lxc.c | 5 ++--- src/remote/remote_driver.c | 12 src/security/security_selinux.c | 3 +-- 3 files

[PATCH 3/5] qemu: Fix retval if ACL check fails in qemuNodeGetSecurityModel

2021-01-04 Thread Michal Privoznik
While previously we returned 0 this is not correct. We have to return a negative value to indicate error. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[PATCH 4/5] domain_conf: Parse full length of some attributes

2021-01-04 Thread Michal Privoznik
In virSecurityLabelDefParseXML() we are parsing the element among with its attributes. Some of the attributes are limited in length (because of virNodeGetSecurityModel()), however some are not. And for the latter ones we don't need to use virXMLPropStringLimit() to parse them. Moreover, using

[PATCH 1/5] qemu: Use virStrcpy in qemuNodeGetSecurityModel()

2021-01-04 Thread Michal Privoznik
The code we have there to copy seclabel model or doi can be replaced by virStrcpy() calls which do exactly the same checks. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c

[PATCH 2/5] qemu: Obtain @caps only after ACL check in qemuNodeGetSecurityModel

2021-01-04 Thread Michal Privoznik
Even though we are getting driver capabilities with refresh=false (so that it is not expensive), we still should do ACL check first because there is no point in bothering with the capabilities if caller doesn't have permissions to call the API. Also, this way the comment makes more sense.

[PATCH 0/5] Fix qemuNodeGetSecurityModel() and some related cleanups

2021-01-04 Thread Michal Privoznik
While I'd love to give more context, I can't - I've found these on a stale branch. However, they are still valid and worth of merging. Michal Prívozník (5): qemu: Use virStrcpy in qemuNodeGetSecurityModel() qemu: Obtain @caps only after ACL check in qemuNodeGetSecurityModel qemu: Fix retval

[libvirt PATCH 2/2] rpm: fix ownership of the swtpm log directory

2021-01-04 Thread Daniel P . Berrangé
As soon as a guest using a device is launched, libvirt will change the ownership to 'tss' user and group, which will cause RPM verify to then fail. Signed-off-by: Daniel P. Berrangé --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in

[libvirt PATCH 0/2] rpm: minor swtpm fixes

2021-01-04 Thread Daniel P . Berrangé
Originally reported at https://src.fedoraproject.org/rpms/libvirt/pull-request/9 Daniel P. Berrangé (2): rpm: ensure swtpm tools are installed with QEMU rpm: fix ownership of the swtpm log directory libvirt.spec.in | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.29.2

[libvirt PATCH 1/2] rpm: ensure swtpm tools are installed with QEMU

2021-01-04 Thread Daniel P . Berrangé
These are needed for the devices to be usable. Signed-off-by: Daniel P. Berrangé --- libvirt.spec.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index f20a1c741b..2e026b0423 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -735,6 +735,9 @@

Re: [libvirt PATCH 13/17] util: extract virStorageFile code into storage_file

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:33 +0100, Pavel Hrdina wrote: > Up until now we had a runtime code and XML related code in the same > source file inside util directory. > > This patch takes the runtime part and extracts it into the new > storage_file directory. I like this idea but I'm not a fan

Re: [libvirt PATCH v3 03/21] nodedev: Add ability to filter by active state

2021-01-04 Thread Erik Skultety
On Thu, Dec 24, 2020 at 08:14:27AM -0600, Jonathon Jongsma wrote: > Add two flag values for virConnectListAllNodeDevices() so that we can > list only node devices that are active or inactive. > > Signed-off-by: Jonathon Jongsma > --- Reviewed-by: Erik Skultety

Re: [libvirt PATCH v3 02/21] nodedev: introduce concept of 'active' node devices

2021-01-04 Thread Erik Skultety
On Thu, Dec 24, 2020 at 08:14:26AM -0600, Jonathon Jongsma wrote: > we will be able to define mediated devices that can be started or > stopped, so we need to be able to indicate whether the device is active > or not, similar to other resources (storage pools, domains, etc.) > > Signed-off-by:

Re: [libvirt PATCH 11/17] virstoragefile: change virStorageSource->drv to void pointer

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:31 +0100, Pavel Hrdina wrote: > This will allow following patches to move virStorageSource into conf > directory and virStorageDriverData into a new storage_file directory. > > Signed-off-by: Pavel Hrdina > --- > src/storage/storage_file_fs.c | 21 +++-- >

Re: [libvirt PATCH 10/17] virstoragefile: move virStorageIsRelative into virfile

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:30 +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 2 +- > src/qemu/qemu_block.c | 2 +- > src/qemu/qemu_snapshot.c | 2 +- > src/util/virfile.c| 13 + > src/util/virfile.h| 2 ++ >

Re: [libvirt PATCH 09/17] virstoragefile: move virStorageIsFile into virfile

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:29 +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 2 +- > src/util/virfile.c| 21 + > src/util/virfile.h| 1 + > src/util/virstoragefile.c | 26 +++--- >

Re: [libvirt PATCH 08/17] virstoragefile: move virStorageFileIsClusterFS into virfile

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:28 +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 2 +- > src/qemu/qemu_migration.c | 2 +- > src/util/virfile.c| 12 > src/util/virfile.h| 1 + > src/util/virstoragefile.c | 11

Re: [libvirt PATCH 07/17] virstoragefile: move virStorageFileResize into virfile

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:27 +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 2 +- > src/storage/storage_util.c | 2 +- > src/util/virfile.c | 47 ++ > src/util/virfile.h | 4 >

Re: [libvirt PATCH 06/17] virfile: refactor virFileNBDDeviceAssociate

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:26 +0100, Pavel Hrdina wrote: > The only reason why virstoragefile.h needs to be included in virfile.h > is that virFileNBDDeviceAssociate() takes virStorageFileFormat argument. > The function doesn't need the enum value as it converts the value to > string and uses

Re: [libvirt PATCH 05/17] util: move virStorageFileCheckCompat into conf

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:25 +0100, Pavel Hrdina wrote: > It is not used anywhere else. > > Signed-off-by: Pavel Hrdina > --- > src/conf/storage_conf.c | 23 ++- > src/util/virstoragefile.c | 24 > src/util/virstoragefile.h | 2 -- > 3 files

Re: [libvirt PATCH 04/17] util: move virStorageFileGetLVMKey to locking

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:24 +0100, Pavel Hrdina wrote: > The function doesn't take virStorageSource as argument and has nothing > in common with virStorageSource or storage file. > > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms| 1 - >

Re: [libvirt PATCH v3 01/21] tests: remove extra trailing semicolon

2021-01-04 Thread Erik Skultety
On Thu, Dec 24, 2020 at 08:14:25AM -0600, Jonathon Jongsma wrote: > The macro should not have a trailing semicolon so that when the macro is > used, the user can add a semicolon themselves. Well, it can, it has no effect. However, for consistency reasons, this is the prevailing form, so sure,

Re: [libvirt PATCH 03/17] util: move virQEMUBuildQemuImgKeySecretOpts into storage

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:23 +0100, Pavel Hrdina wrote: > Function virQEMUBuildQemuImgKeySecretOpts is not used anywhere else > so there is no need to have it in util. > > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 1 - > src/storage/storage_util.c | 74

Re: [libvirt PATCH 02/17] virstoragefile: remove unused virStorageFileChainCheckBroken

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:22 +0100, Pavel Hrdina wrote: > The last usage outside of tests was removed by commit > <780f8c94ca8b3dee7eb59c1bfbc32f672f965df8>. > > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms | 1 - > src/util/virstoragefile.c | 33

Re: [libvirt PATCH 01/17] util: remove unused virStorageGenerateQcowPassphrase

2021-01-04 Thread Peter Krempa
On Mon, Dec 14, 2020 at 16:55:21 +0100, Pavel Hrdina wrote: > The last user was removed by commit > <40f0e0348dfc84f28a500e262c4953b0d3b44fa0>. > > Signed-off-by: Pavel Hrdina > --- > src/libvirt_private.syms| 1 - > src/util/virstorageencryption.c | 34

Re: [PATCH 1/7] conf: Add NFS disk protocol

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:23 -0600, Ryan Gahagan wrote: > Per Issue 90, Libvirt does not support attaching an NFS disk even though > QEMU has added support for it. This series of patches seeks to implement > this support in Libvirt and begins by adding in flags for an NFS disk. > >

Re: [PATCH 7/7] tests: Added tests for NFS disk protocol

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:29 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > tests/qemuxml2argvdata/disk-network-nfs.args | 1 + > .../disk-network-nfs.x86_64-latest.args | 56 +++ > tests/qemuxml2argvdata/disk-network-nfs.xml | 48

Re: Release of libvirt-6.5.0

2021-01-04 Thread Andrea Bolognani
On Fri, 2020-07-03 at 09:56 +0200, Daniel Veillard wrote: > Half a day late, but I pushed the 6.5.0 release out, it is as usual > available as a signed tarball and source rpms from the server: > > https://libvirt.org/sources/ > > I also tagged and pushed the 6.5.0 python bindings that one can

Re: [PATCH 6/7] util: Added a backing store NFS parser

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:28 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/util/virstoragefile.c | 51 +++ > 1 file changed, 51 insertions(+) > > diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c > index

Re: [PATCH 5/7] qemu: Added NFS JSON props methods

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:27 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/qemu/qemu_block.c | 79 +- > src/qemu/qemu_domain.c | 47 + > 2 files changed, 125 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 4/7] conf: Added NFS XML format/parse methods

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:26 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/conf/domain_conf.c | 33 + > 1 file changed, 33 insertions(+) > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index b301ac0a08..565ca680c9

Re: [PATCH 3/7] docs: added rng schema and formatdomain for NFS

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:25 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > docs/formatdomain.rst | 11 +- > docs/schemas/domaincommon.rng | 38 +++ > 2 files changed, 48 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH] kbase: debuglogs: Fix typo in unprivileged libvirtd config path

2021-01-04 Thread Erik Skultety
On Mon, Jan 04, 2021 at 11:35:02AM +0100, Tomáš Janoušek wrote: > Signed-off-by: Tomáš Janoušek > > --- Reviewed-by: Erik Skultety Congratulations on your first libvirt contribution.

Re: [PATCH] qemu: Drop has_ccw_address from _qemuAgentDiskAddress

2021-01-04 Thread Erik Skultety
On Mon, Jan 04, 2021 at 09:54:08AM +0100, Michal Privoznik wrote: > In recent patches new mambers to _qemuAgentDiskAddress struct > were introduced to keep optional CCW address sent by the guest > agent. These two members are a struct to store CCW address into > and a boolean to keep track whether

Re: [PATCH 00/10] Fix NSS plugin and net-dhcp-get-leases wrt to infinite leases

2021-01-04 Thread Daniel P . Berrangé
On Fri, Dec 18, 2020 at 04:09:06PM +0100, Michal Privoznik wrote: > Some things are broken when using leases that don't expire. We don't > store "expiry-time" in corresponding $brname.status file which sets off > a spiral and we get errors from other places which expect it to be there > always.

Re: [PATCH 3/7] docs: added rng schema and formatdomain for NFS

2021-01-04 Thread Peter Krempa
On Mon, Jan 04, 2021 at 13:19:25 +, Daniel Berrange wrote: > On Tue, Dec 29, 2020 at 03:21:25PM -0600, Ryan Gahagan wrote: > > Signed-off-by: Ryan Gahagan > > --- > > docs/formatdomain.rst | 11 +- > > docs/schemas/domaincommon.rng | 38 +++ > >

Re: [PATCH 3/7] docs: added rng schema and formatdomain for NFS

2021-01-04 Thread Daniel P . Berrangé
On Tue, Dec 29, 2020 at 03:21:25PM -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > docs/formatdomain.rst | 11 +- > docs/schemas/domaincommon.rng | 38 +++ > 2 files changed, 48 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH] Fix wrong use of path variable

2021-01-04 Thread Peter Krempa
On Wed, Dec 30, 2020 at 18:39:35 +0800, liyalei wrote: > From: liyalei Please provide some more description in the commit message, such as describe the bug that this patch is fixing. Additionally the libvirt project requires [1] you to certify that you are in compliance of the 'Developer

[PATCH] Fix wrong use of path variable

2021-01-04 Thread liyalei
From: liyalei --- src/util/virnetdevopenvswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index d380b0cf22..7eabaa763d 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c

[PATCH] kbase: debuglogs: Fix typo in unprivileged libvirtd config path

2021-01-04 Thread Tomáš Janoušek
Signed-off-by: Tomáš Janoušek --- docs/kbase/debuglogs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kbase/debuglogs.rst b/docs/kbase/debuglogs.rst index f3937bc337..3fb06bedc3 100644 --- a/docs/kbase/debuglogs.rst +++ b/docs/kbase/debuglogs.rst @@ -68,7 +68,7 @@

Re: [PATCH 2/7] util: Added nfs params to virStorageSource

2021-01-04 Thread Peter Krempa
On Tue, Dec 29, 2020 at 15:21:24 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/util/virstoragefile.c | 8 > src/util/virstoragefile.h | 5 + > 2 files changed, 13 insertions(+) [...] > diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h >

[PATCH 19/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListDel()

2021-01-04 Thread Daniel Henrique Barboza
This change will allow us to remove PCI devices from a list without the need of a PCI Device object, which will be need in the next patch. Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 7 --- src/util/virpci.c | 6 +++--- src/util/virpci.h | 2

[PATCH 14/20] virhostdev.c: add virHostdevIsPCIDevice() helper

2021-01-04 Thread Daniel Henrique Barboza
Add a helper to quickly determine if a hostdev is a PCI device, instead of doing a tedius 'if' check with hostdev mode and subsys type. Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 12 +--- src/hypervisor/virhostdev.h | 2 ++ src/libvirt_private.syms| 1

[PATCH 16/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListFindIndex()

2021-01-04 Thread Daniel Henrique Barboza
We're going to need a way to remove a PCI Device from a list without having a valid virPCIDevicePtr, because the device is missing from the host. This means that virPCIDevicesListDel() must operate with a PCI Device address instead. Turns out that virPCIDevicesListDel() and its related functions

[PATCH 18/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListSteal()

2021-01-04 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 8 +--- src/util/virpci.c | 6 +++--- src/util/virpci.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index

[PATCH 20/20] virhostdev.c: remove missing PCI devs from hostdev manager

2021-01-04 Thread Daniel Henrique Barboza
virHostdevReAttachPCIDevices() is called when we want to re-attach a list of hostdevs back to the host, either on the shutdown path or via a 'virsh detach-device' call. This function always count on the existence of the device in the host to work, but this can lead to problems. For example, a

[PATCH 17/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListFind()

2021-01-04 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 12 src/util/virpci.c | 16 src/util/virpci.h | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/hypervisor/virhostdev.c

[PATCH 10/20] libvirt-nodedev.c: remove return value from virNodeDeviceFree()

2021-01-04 Thread Daniel Henrique Barboza
The function returns -1 on error, but no caller is actually checking the return value. Making it 'void' makes more sense with its current use. Signed-off-by: Daniel Henrique Barboza --- include/libvirt/libvirt-nodedev.h | 2 +- src/libvirt-nodedev.c | 15 +++ 2 files

[PATCH 12/20] libxl_driver.c: modernize libxlNodeDeviceReAttach()

2021-01-04 Thread Daniel Henrique Barboza
Use g_auto* wherever we can and remove the 'cleanup' label. Signed-off-by: Daniel Henrique Barboza --- src/libxl/libxl_driver.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index

[PATCH 11/20] qemu_driver.c: modernize qemuNodeDeviceReAttach()

2021-01-04 Thread Daniel Henrique Barboza
Add virObjectUnref an autoptr cleanup func for virNodeDevice, then remove all unref and free calls from qemuNodeDeviceReAttach(). Signed-off-by: Daniel Henrique Barboza --- src/datatypes.h| 2 ++ src/qemu/qemu_driver.c | 32 2 files changed, 14

[PATCH 15/20] qemu_cgroup.c: skip absent PCI devices in qemuTeardownHostdevCgroup()

2021-01-04 Thread Daniel Henrique Barboza
There is no need to bother with cgroup tearing down for absent PCI devices, given that their entries in the sysfs are already gone. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_cgroup.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_cgroup.c

[PATCH 13/20] virsh-domain.c: modernize cmdDetachDevice()

2021-01-04 Thread Daniel Henrique Barboza
Use g_auto* pointers to avoid the need of a cleanup label. The type of the pointer 'virDomainPtr dom' was changed to its alias 'virshDomainPtr' to allow the use of g_autoptr(). Signed-off-by: Daniel Henrique Barboza --- tools/virsh-domain.c | 18 ++ 1 file changed, 6

[PATCH 09/20] dac, selinux: skip setting/restoring label for absent PCI devices

2021-01-04 Thread Daniel Henrique Barboza
If the underlying PCI device of a hostdev does not exist in the host (e.g. a SR-IOV VF that was removed while the domain was running), skip security label handling for it. This will avoid errors that happens during qemuProcessStop() time, where a VF that was being used by the domain is not

[PATCH 08/20] security_dac.c: modernize hostdev label set/restore functions

2021-01-04 Thread Daniel Henrique Barboza
Use g_auto* cleanup to avoid free() calls. Signed-off-by: Daniel Henrique Barboza --- src/security/security_dac.c | 49 +++-- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index

[PATCH 07/20] security_selinux.c: modernize set/restore hostdev subsys label functions

2021-01-04 Thread Daniel Henrique Barboza
Use g_auto* cleanup to avoid free() calls. Signed-off-by: Daniel Henrique Barboza --- src/security/security_selinux.c | 54 ++--- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index

[PATCH 06/20] virhostdev.c: virHostdevGetPCIHostDevice() now reports missing device

2021-01-04 Thread Daniel Henrique Barboza
Gitlab issue #72 [1] reports that removing SR-IOVs VFs before removing the devices from the running domains can have strange consequences. QEMU might be able to hotunplug the device inside the guest, but Libvirt will not be aware of that, and then the guest is now inconsistent with the domain

[PATCH 05/20] virpci: introduce virPCIDeviceExists()

2021-01-04 Thread Daniel Henrique Barboza
We're going to add logic to handle the case where a previously existing PCI device does not longer exist in the host. The logic was copied from virPCIDeviceNew(), which verifies if a PCI device exists in the host, returning NULL and throwing an error if it doesn't. The NULL is used for other

[PATCH 02/20] qemu, lxc: move NodeDeviceGetPCIInfo() function to domain_driver.c

2021-01-04 Thread Daniel Henrique Barboza
libxlNodeDeviceGetPCIInfo() and qemuNodeDeviceGetPCIInfo() are equal. Let's move the logic to a new virDomainDriverNodeDeviceGetPCIInfo() info to be used by libxl_driver.c and qemu_driver.c. Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/domain_driver.c | 33

[PATCH 04/20] virpci.c: simplify virPCIDeviceNew() signature

2021-01-04 Thread Daniel Henrique Barboza
The current virPCIDeviceNew() signature, receiving 4 uints in sequence (domain, bus, slot, function), is not neat. We already have a way to represent a PCI address in virPCIDeviceAddress that is used in the code. Aside from the test files, most of virPCIDeviceNew() callers have access to a

[PATCH 03/20] domain_driver.c: use PCI address with virDomainDriverNodeDeviceGetPCIInfo()

2021-01-04 Thread Daniel Henrique Barboza
Instead of receiving 4 uints in order and write domain/bus/slot/function, receive a virPCIDeviceAddressPtr instead and write into it. This change will allow us to simplify the API for virPCIDeviceNew() in the next patch. Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/domain_driver.c

[PATCH 01/20] virpci, domain_audit: use virPCIDeviceAddressAsString()

2021-01-04 Thread Daniel Henrique Barboza
There is no need to open code the PCI address string format when we have a function that does exactly that. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_audit.c | 6 +- src/util/virpci.c | 6 ++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git

[PATCH 00/20] handle AWOL SR-IOV VF hostdevs during domain lifetime

2021-01-04 Thread Daniel Henrique Barboza
Hi, This series is an attempt to fix https://gitlab.com/libvirt/libvirt/-/issues/72. The root issue is that, for obvious reasons, virPCIDeviceNew() requires the device to exist in the host (i.e. the config file must be present in sysfs). The unexpected absence of the device (e.g. removing the

Re: live migration is not using secondary interface

2021-01-04 Thread Daniel P . Berrangé
On Sat, Dec 19, 2020 at 12:05:51AM +0100, Martin Kletzander wrote: > One thing to add, though. If you would rather configure the destination in a > way that its hostname resolves to the IP you would prefer for the migration it > might be enough to make this work the simple way around. If you

Re: Ping: [PATCH] Qemu: migration: Not bind RAM info with active migration status

2021-01-04 Thread Daniel P . Berrangé
On Fri, Dec 18, 2020 at 04:38:22PM +0800, Keqian Zhu wrote: > Hi Daniel and Jiri, > > On 2020/12/8 18:31, Jiri Denemark wrote: > > On Tue, Dec 08, 2020 at 09:27:39 +, Daniel P. Berrangé wrote: > >> On Tue, Dec 08, 2020 at 10:06:25AM +0800, zhukeqian wrote: > >>> > >>> On 2020/12/7 18:38,

[libvirt PATCH 2/9] cpu-cpuid: Remove xmltodict usage in parseMap

2021-01-04 Thread Tim Wiederhake
'xmltodict' is a Python module that is not installed by default. Replace it, so the dependencies of cpu-gather.py do not change when both scripts are merged. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 39 -- 1 file changed, 13

[libvirt PATCH 9/9] cpu-gather: Merge cpu-cpuid.py

2021-01-04 Thread Tim Wiederhake
Old usage: cpu-cpuid.py diff FILE... New usage: cpu-gather.py diff FILE... Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 152 tests/cputestdata/cpu-gather.py | 137 +++- 2 files changed, 134 insertions(+), 155

[libvirt PATCH 5/9] cpu-cpuid: Merge checkFeature functions

2021-01-04 Thread Tim Wiederhake
Prepare to deduplicate the list of relevant registers for cpuid and msr information. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 60 ++ 1 file changed, 18 insertions(+), 42 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py

[libvirt PATCH 8/9] cpu-gather: Factor out call to cpu-cpuid.py

2021-01-04 Thread Tim Wiederhake
This is a preparatory step to merge cpu-cpuid.py. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-gather.py | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather.py index 5ca19e5f2b..a4a4050e42

[libvirt PATCH 4/9] cpu-cpuid: Merge addFeature functions

2021-01-04 Thread Tim Wiederhake
Prepare to deduplicate the list of relevant registers for cpuid and msr information. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 48 -- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py

[libvirt PATCH 7/9] cpu-gather: Use actions instead of flags for action argument

2021-01-04 Thread Tim Wiederhake
This allows for the functionality of cpu-cpuid.py script to be integrated more naturally in a later patch. Changes the way this script should be called: cpu-gather.py -> cpu-gather.py cpu-gather.py --gather -> cpu-gather.py gather cpu-gather.py --parse

[libvirt PATCH 6/9] cpu-cpuid: Deduplicate register list

2021-01-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 57 -- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index e90165e563..3e852d5d55 100755 ---

[libvirt PATCH 3/9] cpu-cpuid: Remove xmltodict usage in parseCPU

2021-01-04 Thread Tim Wiederhake
'xmltodict' is a Python module that is not installed by default. Replace it, so the dependencies of cpu-gather.py do not change when both scripts are merged. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 35 +++--- 1 file changed, 11

[libvirt PATCH 0/9] Merge scripts in tests/cputestdata

2021-01-04 Thread Tim Wiederhake
This series merges the functionality of cpu-cpuid.py into cpu-gather.py and completes the transition. For background, see https://www.redhat.com/archives/libvir-list/2020-December/msg00706.html Tim Wiederhake (9): cpu-cpuid: Use argparse to parse arguments cpu-cpuid: Remove xmltodict usage

[libvirt PATCH 1/9] cpu-cpuid: Use argparse to parse arguments

2021-01-04 Thread Tim Wiederhake
Using 'argparse' for argument handling simplifies merging this script with cpu-gather.py in a later patch. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-cpuid.py | 78 +++--- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git

Re: [PATCH 7/7] tests: Added tests for NFS disk protocol

2021-01-04 Thread Peter Krempa
On Mon, Jan 04, 2021 at 15:53:08 +0800, Han Han wrote: > On Wed, Dec 30, 2020 at 5:23 AM Ryan Gahagan wrote: > > > Signed-off-by: Ryan Gahagan > > --- [...] > > function='0x0'/> > > + > > + > > + > > + > > + > > + > > + > > + > > + > > +

[PATCH] qemu: Drop has_ccw_address from _qemuAgentDiskAddress

2021-01-04 Thread Michal Privoznik
In recent patches new mambers to _qemuAgentDiskAddress struct were introduced to keep optional CCW address sent by the guest agent. These two members are a struct to store CCW address into and a boolean to keep track whether the CCW address is valid. Well, we can hold the same information with a

Re: [RFC PATCH 0/3] Fix "virsh domfsinfo" on s390x (again)

2021-01-04 Thread Michal Privoznik
On 1/2/21 6:53 AM, Thomas Huth wrote: On 10/12/2020 11.41, Michal Privoznik wrote: I'll keep these in a local branch and push after QEMU patch. The QEMU patch has now been merged:  https://git.qemu.org/?p=qemu.git;a=commitdiff;h=5b723a5d8df44b69 Could you now push your rebased version, or

Re: [PATCH libvirt v1] tests: add capabilities for QEMU 5.2.0 on s390x

2021-01-04 Thread Andrea Bolognani
On Mon, 2020-12-28 at 12:41 +0100, Shalini Chellathurai Saroja wrote: > On 12/17/20 12:19 PM, Andrea Bolognani wrote: > > On Wed, 2020-12-16 at 10:10 +0100, Shalini Chellathurai Saroja wrote: > > > +++ b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml > > > @@ -0,0 +1,3300 @@ > > > + > > > +

Re: [PATCH 1/7] conf: Add NFS disk protocol

2021-01-04 Thread Han Han
Generally, for the patch series, it is better to be sent with a cover letter to describe the content and the background of the patch series. Since this is your second version of the nfs disk, please mention the patch version in the prefix of titles, like: [PATCH v2 1/7]... That could be done for