Re: [libvirt PATCH 2/6] qemu_validate: move and refactor qemuValidateDomainDefVirtioFSSharedMemory

2021-02-02 Thread Peter Krempa
On Tue, Feb 02, 2021 at 16:04:08 +0100, Pavel Hrdina wrote: > Make the function reusable by other vhost-user based devices. Since reusability is the goal ... > > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_validate.c | 99 +--- > 1 file changed, 51

[PATCH] qemuDomainAttachRedirdevDevice: Remove need_release variable

2021-02-02 Thread Yi Li
Get rid of the 'need_release' variable. Signed-off-by: Yi Li --- src/qemu/qemu_hotplug.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 882e5d2384..e07dba3c5e 100644 --- a/src/qemu/qemu_hotplug.c +++

Re: [PATCH 00/10] Introduce virtio-mem model

2021-02-02 Thread Jing Qi
I did some test for virtio-mem with libvirt upstream version v7.0.0-153-g5ea3ecd07d & qemu-kvm-5.2.0-0.7.rc2.fc34.x86_64 S1. Start domain with memory device 1. Domain configuration- 10485760 1572864 1572864 ... ... 524288 0 2048

[PATCH v2 03/10] domain_driver.c: use g_auto* in virDomainDriverNodeDeviceReset()

2021-02-02 Thread Daniel Henrique Barboza
Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/domain_driver.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c index 0c86fd714f..82e5587a50

[PATCH v2 10/10] scripts/check-aclrules.py: check ACL for domain_driver.c ACL callers

2021-02-02 Thread Daniel Henrique Barboza
This script works under two specific conditions. For each opened file, search for all functions that has ACL calls and store them, and see if there is a vir*DriverPtr struct declared in it. For each implementation found, check if there is an ACL verification inside it, and error out if none was

[PATCH v2 08/10] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Daniel Henrique Barboza
libxlNodeDeviceDetachFlags() and qemuNodeDeviceDetachFlags() are mostly equal, aside from how the virHostdevmanager pointer is retrieved and the PCI stub driver used. Now that the PCI stub driver verification is done early in both functions, we can use the virDomainDriverNodeDeviceDetachFlags()

[PATCH v2 09/10] domain_driver.c: use g_auto* in virDomainDriverNodeDeviceDetachFlags()

2021-02-02 Thread Daniel Henrique Barboza
Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/domain_driver.c | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c index 6ee74d6dff..c08b7d46c5

[PATCH v2 07/10] qemu_driver.c: validate 'driverName' earlier in qemuNodeDeviceDetachFlags()

2021-02-02 Thread Daniel Henrique Barboza
The validation of 'driverName' does not depend on any other state and can be done right on the start of the function. We can fail earlier while avoiding a cleanup jump. Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 41

[PATCH v2 06/10] libxl_driver.c: validate 'driverName' earlier in libxlNodeDeviceDetachFlags()

2021-02-02 Thread Daniel Henrique Barboza
The validation of 'driverName' does not depend on any other state and can be done right on the start of the function. We can fail earlier while avoiding a cleanup jump. Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/libxl/libxl_driver.c | 14 +++--- 1 file

[PATCH v2 02/10] datatypes.h: register AUTOPTR_CLEANUP_FUNC for virNodeDevicePtr

2021-02-02 Thread Daniel Henrique Barboza
Next patch will use g_autoptr() with virNodeDevicePtr for cleanups. Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/datatypes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/datatypes.h b/src/datatypes.h index ade3779e43..7a88aba0df 100644 ---

[PATCH v2 05/10] domain_driver.c: use g_auto* in virDomainDriverNodeDeviceReAttach()

2021-02-02 Thread Daniel Henrique Barboza
Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/domain_driver.c | 32 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c index c559f94348..ea4c3c9466

[PATCH v2 00/10] reduce code duplication in NodeDevice driver

2021-02-02 Thread Daniel Henrique Barboza
changes from v1: - added Jano's R-b in patches 1-9 - Patch 08: * clarified why the 'Flags' suffix was kept in the helper name - (new) Patch 10: change check-aclrules to verify ACL checks in domain_driver.c v1 link: https://www.redhat.com/archives/libvir-list/2021-February/msg00065.html

[PATCH v2 01/10] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceReset() helper

2021-02-02 Thread Daniel Henrique Barboza
libxlNodeDeviceReset() and qemuNodeDeviceReset() are mostly equal, differing only how the virHostdevManager pointer is retrieved. Put the common code into virDomainDriverNodeDeviceReset() to reduce code duplication. Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza ---

[PATCH v2 04/10] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceReAttach() helper

2021-02-02 Thread Daniel Henrique Barboza
libxlNodeDeviceReAttach() and qemuNodeDeviceReAttach() are mostly equal, differing only how the virHostdevManager pointer is retrieved. Put the common code into virDomainDriverNodeDeviceReAttach() to reduce code duplication. Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza ---

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

2021-02-02 Thread Jonathon Jongsma
On Tue, 2 Feb 2021 08:28:52 +0100 Erik Skultety wrote: > On Mon, Feb 01, 2021 at 04:38:56PM -0700, Alex Williamson wrote: > > On Mon, 1 Feb 2021 16:57:44 -0600 > > Jonathon Jongsma wrote: > > > > > On Mon, 1 Feb 2021 11:33:08 +0100 > > > Erik Skultety wrote: > > > > > > > On Mon, Feb 01,

[PATCH] build: fix specfile logic for disabling netcf

2021-02-02 Thread Laine Stump
I *thought* I had tested all the combinations of manually setting --without netcf, different versions of Fedora, etc, but apparently not. The check in libvirt.spec.in to see if the target was an older Fedora or older RHEL would alway resolve to true, because, e.g., if {?fedora} is undefined, then

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Daniel Henrique Barboza
On 2/2/21 1:35 PM, Daniel P. Berrangé wrote: The check-aclrules.py script has some logic which looks to see if the method contains a function call that resolves to another public API entrypoint, as a special case. So basically we'll need to process the hypervisor_driver.c file to extract a

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Daniel Henrique Barboza
On 2/2/21 1:35 PM, Daniel P. Berrangé wrote: On Tue, Feb 02, 2021 at 05:32:14PM +0100, Ján Tomko wrote: On a Tuesday in 2021, Daniel P. Berrangé wrote: On Tue, Feb 02, 2021 at 05:18:51PM +0100, Ján Tomko wrote: On a Monday in 2021, Daniel Henrique Barboza wrote:

[PATCH v2 23/27] cmdSecretGetValue: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tools/virsh-secret.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index de32f25d64..fcfbe5fe9e 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -302,7 +302,6 @@ static bool

[PATCH v2 10/27] libxlMakeNetworkDiskSrc: Avoid use of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Clear the secret right after use with virSecureErase. Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index cb1fd7df7d..694192e1c3 100644 ---

[PATCH v2 16/27] storageBackendCreateQemuImgSecretPath: Use virSecureErase instead of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Clear out the value using virSecureErase and free it with g_free so that VIR_DISPOSE_N can be phased out. Signed-off-by: Peter Krempa --- src/storage/storage_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c

[PATCH v2 07/27] util: Introduce virsecureerase module

2021-02-02 Thread Peter Krempa
The module will provide functions for disposing secrets stored in memory. Note that for now it's implemented using memset, which is not really secure. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 4 src/util/meson.build | 1 + src/util/virsecureerase.c | 44

[PATCH v2 22/27] virStorageBackendRBDOpenRADOSConn: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/storage/storage_backend_rbd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 1f83205dfa..007c53f7ac 100644 --- a/src/storage/storage_backend_rbd.c +++

[PATCH v2 27/27] util: alloc: Remove VIR_DISPOSE_STRING

2021-02-02 Thread Peter Krempa
Users were replaced with virSecureEraseString with explicit freeing of the memory. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/viralloc.c | 17 - src/util/viralloc.h | 14 -- 3 files changed, 32 deletions(-) diff --git

[PATCH v2 26/27] virnetlibsshsession: Replace VIR_DISPOSE_STRING with virSecureEraseString

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 73f5e998fc..76934c7c0b 100644 --- a/src/rpc/virnetlibsshsession.c +++

[PATCH v2 25/27] util: alloc: Remove VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
There are no users any more. The replacement is to use g_auto and virSecureEraseString explicitly. Signed-off-by: Peter Krempa --- src/util/viralloc.h | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index 0173107b87..f9387a00f9 100644 ---

[PATCH v2 24/27] virNetLibsshAuthenticatePassword: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 9671a0f98d..73f5e998fc 100644 --- a/src/rpc/virnetlibsshsession.c +++

[PATCH v2 21/27] qemuBuildRBDSecinfoURI: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
In this instance attempting to be correct is really pointless since the secret is formatted into another string which is not erased securely and then put on the commandline. Keep the secure handling for correctness. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 4 +++- 1 file

[PATCH v2 20/27] libxlMakeNetworkDiskSrc: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 694192e1c3..de0fd66842 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -999,7 +999,7 @@

[PATCH v2 19/27] util: virsecureerase: Introduce virSecureEraseString

2021-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virsecureerase.c | 13 + src/util/virsecureerase.h | 3 +++ 3 files changed, 17 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 62a7b8f7b9..845e749bdf 100644 ---

[PATCH v2 18/27] util: viralloc: Remove VIR_DISPOSE(_N)

2021-02-02 Thread Peter Krempa
The macros are unused now and callers who care about clearing the memory they use should use memset() appropriately. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/viralloc.c | 39 ++- src/util/viralloc.h | 27

[PATCH v2 17/27] tests: viralloc: Remove testDispose case

2021-02-02 Thread Peter Krempa
The VIR_DISPOSE* APIs will be phased out. Additionally the test isn't really doing useful work in ensuring that the values are indeed cleared thus there's no point in keeping it around. Signed-off-by: Peter Krempa --- tests/viralloctest.c | 34 -- 1 file changed,

[PATCH v2 15/27] virCryptoEncryptDataAESgnutls: Use virSecureErase instead of memset

2021-02-02 Thread Peter Krempa
Clear the key and IV structs using virSecureErase. Signed-off-by: Peter Krempa --- src/util/vircrypto.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/vircrypto.c b/src/util/vircrypto.c index d2a42d83e2..78689721c3 100644 --- a/src/util/vircrypto.c +++

[PATCH v2 02/27] libxlMakeDomBuildInfo: Don't use VIR_DISPOSE_N for USB device list

2021-02-02 Thread Peter Krempa
The list isn't secret which would need being disposed of. Just expand the array and return failure when adding the NULL terminator similarly to how we expand the list for adding devices in a loop. Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH v2 14/27] virCryptoEncryptDataAESgnutls: Use virSecureErase instead of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Clear out the value using virSecureErase and free it with g_free so that VIR_DISPOSE_N can be phased out. Signed-off-by: Peter Krempa --- src/util/vircrypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/vircrypto.c b/src/util/vircrypto.c index

[PATCH v2 09/27] storage_backend_iscsi(_direct): Properly clear secrets

2021-02-02 Thread Peter Krempa
The code pretends that it cares about clearing the secret values, but passes the secret value to a realloc, which may copy the value somewhere else and doesn't sanitize the original location when it does so. Since we want to construct a string from the value, let's copy it to a new piece of

[PATCH v2 13/27] virStorageBackendRBDOpenRADOSConn: Use virSecureErase instead of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Switch the secret value to 'g_autofree' for handling of the memory and clear it out using virSecureErase. Signed-off-by: Peter Krempa --- src/storage/storage_backend_rbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/storage_backend_rbd.c

[PATCH v2 12/27] virsh: cmdSecretGetValue: Use virSecureErase instead of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Switch the secret value to 'g_autofree' for handling of the memory and clear it out using virSecureErase. Signed-off-by: Peter Krempa --- tools/virsh-secret.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index

[PATCH v2 11/27] qemu: domain: Use virSecureErase for clearing secrets instead of VIR_DISPOSE_N

2021-02-02 Thread Peter Krempa
Phase out use of VIR_DISPOSE_N from the qemu driver. Use memset in the appropriate cases. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[PATCH v2 06/27] virNetLibsshSessionAuthAddPrivKeyAuth: Refactor cleanup

2021-02-02 Thread Peter Krempa
Shuffle the code around to remove the need for temporary variables and labels for cleaning them. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c

[PATCH v2 04/27] cmdSecretSetValue: Make it obvious that --file, --base64 and --interactive are exlcusive

2021-02-02 Thread Peter Krempa
Convert the conditions to else if so that it's obvious that only one of the cases will ever be used. Signed-off-by: Peter Krempa --- tools/virsh-secret.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index

[PATCH v2 08/27] virsh: cmdSecretSetValue: Rework handling of the secret value

2021-02-02 Thread Peter Krempa
Use a single buffer for the secret to make it easier to follow it's lifecycle. For base64 decoding use a local temporary buffer which will be cleared right away. This also uses virSecureErase for clearing the bufer instead of VIR_DISPOSE_N which is being phased out. Signed-off-by: Peter Krempa

[PATCH v2 03/27] qemuDomainMasterKeyCreate: Don't use VIR_DISPOSE_N on failure

2021-02-02 Thread Peter Krempa
When virRandomBytes fails we don't get any random bytes and even if we did they don't have to be treated as secret as they weren't used in any way. Add a temporary variable with automatic freeing for the secret buffer and assign it only on success. Signed-off-by: Peter Krempa ---

[PATCH v2 05/27] virNetLibsshSessionAuthAddPrivKeyAuth: Don't unlock unlocked 'sess' on error

2021-02-02 Thread Peter Krempa
The check whether @keyfile is non-NULL is before locking @sess, but uses the 'error' label which unlocks '@sess'. While touching the error path, update the error message to be on one line. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 6 ++ 1 file changed, 2

[PATCH v2 01/27] hypervFreeInvokeParams: Don't use VIR_DISPOSE_N for freeing 'params'

2021-02-02 Thread Peter Krempa
The struct doesn't contain any secrets to clear before freeing and even if it did VIR_DISPOSE_N wouldn't help as the struct contains only pointers thus the actual memory pointing to isn't sanitized. Just free the params array pointer and then the struct itself. Signed-off-by: Peter Krempa ---

[PATCH v2 00/27] util: Remove VIR_DISPOSE(_N) and VIR_DISPOSE_STRING

2021-02-02 Thread Peter Krempa
Patches 1-6 are pure refactors, other patches then convert handling to the newly introduced functions. Unfortunately quite a lot of the supposedly "secure" handling of secrets isn't really secure as we e.g. copy the secret into another buffer which isn't cleared properly or format it directly

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Daniel P . Berrangé
On Tue, Feb 02, 2021 at 05:32:14PM +0100, Ján Tomko wrote: > On a Tuesday in 2021, Daniel P. Berrangé wrote: > > On Tue, Feb 02, 2021 at 05:18:51PM +0100, Ján Tomko wrote: > > > On a Monday in 2021, Daniel Henrique Barboza wrote: > > > > libxlNodeDeviceDetachFlags() and qemuNodeDeviceDetachFlags()

Re: [PATCH 0/9] reduce code duplication in NodeDevice driver

2021-02-02 Thread Ján Tomko
On a Monday in 2021, Daniel Henrique Barboza wrote: Hi, This series reduces code duplication between qemu_driver.c and libxl_driver.c by adding common code, related to NodeDevicePtr driver functions, into helper functions in domain_driver.c. No functional change was made. Daniel Henrique

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Ján Tomko
On a Tuesday in 2021, Daniel P. Berrangé wrote: On Tue, Feb 02, 2021 at 05:18:51PM +0100, Ján Tomko wrote: On a Monday in 2021, Daniel Henrique Barboza wrote: > libxlNodeDeviceDetachFlags() and qemuNodeDeviceDetachFlags() are mostly > equal, aside from how the virHostdevmanager pointer is

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Daniel P . Berrangé
On Tue, Feb 02, 2021 at 05:18:51PM +0100, Ján Tomko wrote: > On a Monday in 2021, Daniel Henrique Barboza wrote: > > libxlNodeDeviceDetachFlags() and qemuNodeDeviceDetachFlags() are mostly > > equal, aside from how the virHostdevmanager pointer is retrieved and > > the PCI stub driver used. > > >

Re: [PATCH 8/9] qemu, libxl, hypervisor: use virDomainDriverNodeDeviceDetachFlags() helper

2021-02-02 Thread Ján Tomko
On a Monday in 2021, Daniel Henrique Barboza wrote: libxlNodeDeviceDetachFlags() and qemuNodeDeviceDetachFlags() are mostly equal, aside from how the virHostdevmanager pointer is retrieved and the PCI stub driver used. Now that the PCI stub driver verification is done early in both functions,

Re: [libvirt PATCH 0/6] implement vhost-user-blk support

2021-02-02 Thread Ján Tomko
On a Tuesday in 2021, Pavel Hrdina wrote: Pavel Hrdina (6): qemu_alias: introduce qemuDomainGetVhostUserAlias helper qemu_validate: move and refactor qemuValidateDomainDefVirtioFSSharedMemory docs: introduces new vhostuser disk type conf: implement support for vhostuser disk

Re: [libvirt PATCH 1/6] qemu_alias: introduce qemuDomainGetVhostUserAlias helper

2021-02-02 Thread Ján Tomko
On a Tuesday in 2021, Pavel Hrdina wrote: Signed-off-by: Pavel Hrdina --- src/qemu/qemu_alias.c | 6 ++ src/qemu/qemu_alias.h | 2 ++ src/qemu/qemu_command.c | 8 +--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index

[libvirt PATCH 4/6] conf: implement support for vhostuser disk

2021-02-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- We need to find a better way to validate different combinations of XML elements and attributes. src/conf/domain_conf.c| 85 src/conf/domain_validate.c| 187 ++ src/conf/storage_source_conf.c

[libvirt PATCH 3/6] docs: introduces new vhostuser disk type

2021-02-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- docs/formatdomain.rst | 32 ++-- docs/schemas/domaincommon.rng | 19 +++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git

[libvirt PATCH 5/6] qemu_capabilities: introduce vhost-user-blk capability

2021-02-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +

[libvirt PATCH 6/6] qemu: implement vhost-user-blk support

2021-02-02 Thread Pavel Hrdina
Implements QEMU support for vhost-user-blk together with live hotplug/unplug. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_block.c | 16 src/qemu/qemu_block.h | 5 + src/qemu/qemu_command.c | 91 +--

[libvirt PATCH 0/6] implement vhost-user-blk support

2021-02-02 Thread Pavel Hrdina
Pavel Hrdina (6): qemu_alias: introduce qemuDomainGetVhostUserAlias helper qemu_validate: move and refactor qemuValidateDomainDefVirtioFSSharedMemory docs: introduces new vhostuser disk type conf: implement support for vhostuser disk qemu_capabilities: introduce vhost-user-blk

[libvirt PATCH 1/6] qemu_alias: introduce qemuDomainGetVhostUserAlias helper

2021-02-02 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/qemu/qemu_alias.c | 6 ++ src/qemu/qemu_alias.h | 2 ++ src/qemu/qemu_command.c | 8 +--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index b3492d6e85..57b56b9ded 100644 ---

[libvirt PATCH 2/6] qemu_validate: move and refactor qemuValidateDomainDefVirtioFSSharedMemory

2021-02-02 Thread Pavel Hrdina
Make the function reusable by other vhost-user based devices. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_validate.c | 99 +--- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index

Re: [PATCH] docs/interop/qmp-spec: Document the request queue limit

2021-02-02 Thread Markus Armbruster
Queued.

[PATCH] conf: add realtime parameter for rtc

2021-02-02 Thread gongwei
Pass the parameter clock rt to qemu to ensure that the virtual machine is not synchronized with the host time Signed-off-by: gongwei --- docs/formatdomain.rst | 2 +- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c |

Re: [libvirt PATCH v2 16/20] commandhelper: Use automatic memory management in parseArguments

2021-02-02 Thread Tim Wiederhake
On Tue, 2021-02-02 at 14:59 +0100, Peter Krempa wrote: > On Mon, Feb 01, 2021 at 12:28:00 +0100, Tim Wiederhake wrote: > > Signed-off-by: Tim Wiederhake > > --- > > tests/commandhelper.c | 42 ++- > > --- > > 1 file changed, 22 insertions(+), 20 deletions(-) >

Re: [libvirt PATCH v2 16/20] commandhelper: Use automatic memory management in parseArguments

2021-02-02 Thread Peter Krempa
On Mon, Feb 01, 2021 at 12:28:00 +0100, Tim Wiederhake wrote: > Signed-off-by: Tim Wiederhake > --- > tests/commandhelper.c | 42 ++ > 1 file changed, 22 insertions(+), 20 deletions(-) > > diff --git a/tests/commandhelper.c b/tests/commandhelper.c > index

Re: [PATCH 00/10] Introduce virtio-mem model

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:21 +0100, Michal Privoznik wrote: > Technically, this is another version of: > > https://www.redhat.com/archives/libvir-list/2020-December/msg00199.html > > But since virtio-pmem part is pushed now, I've reworked virtio-mem a bit > and sending it as a new series. >

Re: [PATCH 09/10] virsh: Introduce update-memory command

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:31 +0100, Michal Privoznik wrote: > New 'update-memory' command is introduced which aims on making it > user friendly to change device. So far I just need to > change so I'm introducing --requested-size only; but > the idea is that this is extensible for other cases

Re: [PATCH 08/10] qemu: Recalculate balloon on MEMORY_DEVICE_SIZE_CHANGE event and reconnect

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:30 +0100, Michal Privoznik wrote: > Just like we are recalculating the amount of guest memory on > BALLOON_CHANGE and on reconnect to the monitor, we should include > the actual size of virtio-mem too. > > Signed-off-by: Michal Privoznik > --- >

Re: [PATCH 07/10] qemu: Refresh the actual size of virtio-mem on monitor reconnect

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:29 +0100, Michal Privoznik wrote: > If the QEMU driver restarts it loses the track of the actual size > of virtio-mem (because it's runtime type of information and thus > not stored in XML) and therefore, we have to refresh it when > reconnecting to the domain

Re: [PATCH 06/10] qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event

2021-02-02 Thread David Hildenbrand
[...] A side note, do we get this event e.g. on VM reset? If no we need to wire up the reset of 'actual' size in such case as it would wrongly suggest that the VM is using it and it may not even get to loading the driver. QEMU fires the event whenever the value changes - including during

Re: [PATCH 06/10] qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:28 +0100, Michal Privoznik wrote: > As advertised in previous commit, this event is delivered to us > when virtio-mem module changes the allocation inside the guest. > It comes with one attribute - size - which holds the new size of > the virtio-mem (well, allocated

Re: [PATCH 05/10] qemu: Wire up live update

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:27 +0100, Michal Privoznik wrote: > As advertised in one of previous commits, we want' to be able to > change 'requested-size' attribute of virtio-mem on the fly. This > commit does exactly that. Changing anything else is checked for > and forbidden. > > Once guest

Re: [PATCH 02/10] qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:24 +0100, Michal Privoznik wrote: > This commit introduces a new capability that reflects virtio-mem-pci > device support in QEMU: > > QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI, /* -device virtio-mem-pci */ > > The virtio-mem-pci device was introduced in QEMU 5.1. > >

Re: [PATCH 03/10] conf: Introduce virtio-mem model

2021-02-02 Thread Peter Krempa
On Fri, Jan 22, 2021 at 13:50:25 +0100, Michal Privoznik wrote: > The virtio-mem is paravirtualized mechanism of adding/removing > memory to/from a VM. A virtio-mem-pci device is split into blocks > of equal size which are then exposed (all or only a requested > portion of them) to the guest

Re: [PATCH 8/8] conf: replace VIR_FREE() with g_free() in vir*Free() functions

2021-02-02 Thread Daniel P . Berrangé
On Tue, Feb 02, 2021 at 12:25:40AM -0500, Laine Stump wrote: > On 2/1/21 5:23 AM, Daniel P. Berrangé wrote: > > On Mon, Feb 01, 2021 at 11:20:04AM +0100, Peter Krempa wrote: > > > On Mon, Feb 01, 2021 at 10:09:25 +, Daniel Berrange wrote: > > > > On Mon, Feb 01, 2021 at 11:05:15AM +0100, Peter

Re: [PATCH v2 00/13] Hyper-V serial ports, NICs, and screeshots

2021-02-02 Thread Michal Privoznik
On 2/2/21 1:48 AM, Matt Coleman wrote: This patchset makes the following changes to the Hyper-V driver: * enable XML parsing and creation of serial ports and NICs * implement several networking APIs * implement screenshots Changes since v1: * simplified hypervDomainDefParseSerial based on

Re: [PATCH v2 01/13] hyperv: XML parsing of serial ports

2021-02-02 Thread Michal Privoznik
On 2/2/21 1:48 AM, Matt Coleman wrote: Co-authored-by: Sri Ramanujam Signed-off-by: Matt Coleman --- src/hyperv/hyperv_driver.c| 61 +++ src/hyperv/hyperv_wmi.c | 10 + src/hyperv/hyperv_wmi.h | 4 ++

Re: [PATCH] virsh: Simplify @flags handing in cmdSetmem() and cmdSetmaxmem()

2021-02-02 Thread Michal Privoznik
On 2/1/21 12:29 PM, Daniel Henrique Barboza wrote: On 1/22/21 9:28 AM, Michal Privoznik wrote: What code tries to achieve is that if no flags were provided to either 'setmem' or 'setmaxmem' commands then the old (no flags) API is called to be able to communicate with older daemons. Well, the