Re: [PATCH] qemu_monitor_json.h: Unify header formatting

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use the modern style and fix all offenders since new functions were already using the contemporary style. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.h | 957 --- 1 file changed, 551 insertions(+), 406 dele

Re: [libvirt PATCH 3/6] qemu: add monitor APIs for query-sev

2021-12-09 Thread Peter Krempa
On Thu, Dec 09, 2021 at 16:24:04 +, Daniel P. Berrangé wrote: > On Thu, Dec 09, 2021 at 09:36:03AM +0100, Peter Krempa wrote: > > On Wed, Dec 08, 2021 at 18:44:31 +, Daniel P. Berrangé wrote: > > > We're only returning the set of fields needed to perform an > > > attestation, per the SEV AP

[PATCH] qemu_monitor_json.h: Unify header formatting

2021-12-09 Thread Peter Krempa
Use the modern style and fix all offenders since new functions were already using the contemporary style. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.h | 957 --- 1 file changed, 551 insertions(+), 406 deletions(-) diff --git a/src/qemu/qemu_monito

Re: [libvirt PATCH 3/6] qemu: add monitor APIs for query-sev

2021-12-09 Thread Daniel P . Berrangé
On Thu, Dec 09, 2021 at 09:36:03AM +0100, Peter Krempa wrote: > On Wed, Dec 08, 2021 at 18:44:31 +, Daniel P. Berrangé wrote: > > We're only returning the set of fields needed to perform an > > attestation, per the SEV API docs. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > src/qemu/

[PATCH 3/3] network: Generate TFTP config regardless of DHCP

2021-12-09 Thread Michal Privoznik
We already allow users to provide TFTP root path in network XML and not specify any DHCP. This makes sense, because dnsmasq is not only DHCP server but also TFTP server and users might have a DHCP server configured on their own, outside of libvirt's control and want just the TFTP part. By moving T

[PATCH 2/3] network: Separate DHCP config generator into a function

2021-12-09 Thread Michal Privoznik
Generating configuration file for dnsmasq is done in networkDnsmasqConfContents() which is this big, self-contained function. Separate at least DHCP part into its own function for better readability. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 227 +++---

[PATCH 1/3] network: Initialize variables in networkDnsmasqConfContents()

2021-12-09 Thread Michal Privoznik
In networkDnsmasqConfContents() there's a for() loop which initializes some variables in its initialization block. This makes both the loop() statement and variable declaration block look needlessly ugly. Speaking of variable declaration, also move some variables which are used only within blocks i

[PATCH 0/3] network: Generate TFTP config regardless of DHCP

2021-12-09 Thread Michal Privoznik
See 3/3 for explanation. Michal Prívozník (3): network: Initialize variables in networkDnsmasqConfContents() network: Separate DHCP config generator into a function network: Generate TFTP config regardless of DHCP src/network/bridge_driver.c | 262 ++ .../

[PATCH] docs: Remove dependency on external resources

2021-12-09 Thread Andrea Bolognani
The internals/eventloop document uses two images for illustrative purposes, but unlike other graphics included in the documentation these are not part of libvirt.git but rather were added to libvirt-media.git with commit fae5622074cf5e18d190496f8a43260c614599b2 Author: Michal Privoznik Date

Re: [PATCH 00/24] chardev handling cleanups (chardev refactors part 2)

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: In this part I'm cleaning up the command line generators and unifying them. Until now there were multiple custom -chardev generators in places where it was simpler to use it than the common code. This series fixes the common code to have sane API and ref

[PATCH 2/2] Revert "qemu: Avoid crash in qemuStateShutdownPrepare() and qemuStateShutdownWait()"

2021-12-09 Thread Michal Privoznik
This reverts commit 69977ff10560a80bcf5bf93f1a3f819a2d1623ca. After previous commit it's no longer possible that QEMU driver is not initialized in qemuStateShutdownPrepare() nor qemuStateShutdownWait(). Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 6 -- 1 file changed, 6 del

[PATCH 1/2] remote_daemon: Set shutdown callbacks only after init is done

2021-12-09 Thread Michal Privoznik
The initialization of drivers happens in a separate thread. However, the main thread continues initialization and sets shutdown callbacks (virStateShutdownPrepare() and virStateShutdownWait()) even though the driver init thread is still running. This is dangerous because if the daemon decides to qu

[PATCH 0/2] remote_daemon: Set shutdown callbacks only after init is done

2021-12-09 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): remote_daemon: Set shutdown callbacks only after init is done Revert "qemu: Avoid crash in qemuStateShutdownPrepare() and qemuStateShutdownWait()" src/qemu/qemu_driver.c | 6 -- src/remote/remote_daemon.c | 7 --- 2 files changed, 4 in

Re: [PATCH 12/24] qemuBuildConsoleCommandLine: Remove identical code

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Unify the cases for SCPL/SCLPLM/VIRTIO consoles as the code is *SCLP identical. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 28 1 file changed, 28 deletions(-) Reviewed-by: Ján Tomko Jano signature.a

Re: [PATCH 02/24] qemu: domain: Introduce helpers for initializing chardev backend of devices

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Introduce qemuDomainDeviceBackendChardevForeach(One) which calls the callback if either given device has a chardev backend or for all chardev backends of all devices. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 117

Re: [PATCH 36/36] virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 35/36] virt-host-validate-qemu: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tools/virt-host-validate-qemu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 01/24] virDomainDeviceInfoIterateFlags: Export the symbol

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 33/36] virLXCControllerSetup(Resource|Cgroup)Limits: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Remove the pointless cleanup sections. Signed-off-by: Peter Krempa --- src/lxc/lxc_controller.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signatur

Re: [PATCH 34/36] virt-host-validate-common: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tools/virt-host-validate-common.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 32/36] lxc_controller: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/lxc/lxc_controller.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 31/36] libxlDomainGetNumaParameters: Don't clear a freshly allocated bitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The bitmap is allocated just above the explicit clear, so it's already empty. Signed-off-by: Peter Krempa --- src/libxl/libxl_driver.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 28/36] test_driver: Use automatic memory freeing for temporary virBitmaps

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/test/test_driver.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 27/36] util: bitmap: Unify parsing of bitmaps

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: There were two separate instances of string->virBitmap code: virBitmapParseInternal and virBitmapParseUnlimited. By adding a flag to switch to expanding APIs we can merge the two implementations into one. Signed-off-by: Peter Krempa --- src/util/virbi

Re: [PATCH 30/36] libxl_driver: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/libxl/libxl_driver.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 29/36] lxcSetCpusetTune: Refactor memory clearing

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory clearing for virBitmap and remove a reuse of a temporary string. Signed-off-by: Peter Krempa --- src/lxc/lxc_native.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) Reviewed-by: Ján Tomko Jano sig

Re: [PATCH 26/36] virBitmapParseInternal: Allocate the bitmap in the caller

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: In order to prepare for reuse of the function, move the allocation of the bitmap to the caller. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) Reviewed-by: Ján To

Re: [PATCH 25/36] virBitmapParseSeparator: Remove separator parsing capability

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Since the feature is not needed remove it and remove the function to virBitmapParseInternal. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH 24/36] virBitmapSetBitExpand: Remove return value

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/conf/numa_conf.c| 3 +-- src/network/bridge_driver.c | 3 +-- src/util/virbitmap.c| 14 -- src/util/virbitmap.h| 4 +

Re: [PATCH 23/36] virBitmapClearBitExpand: Remove return value

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 9 ++--- src/util/virbitmap.h | 4 ++-- tests/virbitmaptest.c | 3 +-- 3 files changed, 5 insertions(+), 11 deletions(-) Review

Re: [PATCH 22/36] virBitmapUnion: Remove return value

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 6 +- src/util/virbitmap.h | 4 ++-- src/util/virnuma.c| 3 +-- tests/virbitmaptest.c | 3 +-- 4 files changed, 5 insertions(+)

Re: [PATCH 20/36] util: bitmap: Unexport 'virBitmapParseSeparator'

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The function isn't used besides tests. Since the separator parsing capability is trivial we can keep it in place and just unexport it for now. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virbitmap.c | 2 +- src/util/virbi

Re: [PATCH 21/36] virBitmapExpand: Remove return value

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: There's nothing that can fail in the function. Remove the return value and adjust callers. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 19/36] test_virCapabilitiesGetCpusForNodemask: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- tests/vircapstest.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH 18/36] virnumamock: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tests/virnumamock.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 17/36] virshParseCPUList: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) Reviewed-by: Ján Tomko Jano si

Re: [PATCH 16/36] virCgroupGetPercpuStats: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/util/vircgroup.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) Reviewed-by: Já

Re: [PATCH 15/36] virHostCPUParseNode: Use automatic memory freeing for virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 14/36] virHostCPUHasValidSubcoreConfiguration: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko J

Re: [PATCH 13/36] virHostCPUCountThreadSiblings: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 12/36] qemuSnapshotCreateInactiveExternal: Automatically free temporary variables

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Automatically free 'cmd' and 'created' by moving them to the appropriate scopes. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.as

Re: [PATCH 11/36] qemuProcessValidateHotpluggableVcpus: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH 10/36] qemuDomainSetVcpuInternal: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) Reviewed-by: Ján To

Re: [PATCH 09/36] qemuDomainSetVcpusInternal: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) Reviewed-by: Ján Tomk

Re: [PATCH 08/36] qemuDomainSelectHotplugVcpuEntities: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing for the 'ret' bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 07/36] qemu: driver: Automatically free temporary virBitmap-s

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 50 ++ 1 file changed, 16 insertions(+), 34 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 06/36] qemuDomainAssignMemorySlots: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Automatically free the 'slotmap' bitmap and get rid of the cleanup section. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain_address.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano signature.as

Re: [PATCH 05/36] virDomainDriverGetIOThreadsConfig: Automatically free virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use g_autoptr for the temp bitmap. To achieve this the variable must be moved down to the appropriate scope. Signed-off-by: Peter Krempa --- src/hypervisor/domain_driver.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) Reviewed-by: Ján

Re: [PATCH 04/36] virDomainNumatuneParseXML: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory clearing for the temporary strings and bitmap and remove the cleanup section. There are multiple temporary strings added so that we don't reuse one. The strings can be moved inside the 'if (node)' block Signed-off-by: Peter Krem

Re: [PATCH 03/36] virDomainSchedulerParse: Refactor cleanup

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Automatically free the 'ret' temporary bitmap and get rid of the cleanup section. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature

Re: [PATCH 02/36] conf: capabilities: Clean up freeing of virBitmap

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic freeing where possible and use g_clear_pointer instead of manual NULL-ing. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano sign

Re: [PATCH 01/36] virCapabilitiesInitCaches: Refactor freeing of temporary variables

2021-12-09 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Move the 'path' and 'type' variables down to the appropriate block and use automatic freeing for them as well as the temporary virBitmap. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 13 +++-- 1 file changed, 3 insertions(+), 10 del

[PATCH 24/24] qemu: command: Use 'qemuBuildChrChardevCommand' to build TPM backend

2021-12-09 Thread Peter Krempa
Since the backend of the TPM is a chardev we can use the common helper to instantiate it. This commit also ensures proper ordering so that the backend chardev is formatted before it's being referenced. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 25 +++---

[PATCH 09/24] qemuBuildChrChardevStr: Remove unused arguments and clean up callers

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 145 +++- src/qemu/qemu_command.h | 2 - src/qemu/qemu_process.c | 4 -- 3 files changed, 55 insertions(+), 96 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 91836

[PATCH 23/24] qemu: Implement chardev source setup for tpm

2021-12-09 Thread Peter Krempa
Add handling to qemuDomainDeviceBackendChardevForeachOne and callbacks so that we can later use 'qemuBuildChardevCommand' for TPM devices. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 14 +- src/qemu/qemu_process.c | 4 tests/qemuxml2argvtest.c | 4 3 files

[PATCH 17/24] qemu: Store TLS config options for chardevs in qemuDomainChrSourcePrivate

2021-12-09 Thread Peter Krempa
When setting up TLS options from config in qemuDomainPrepareChardevSourceOne we can also extract the x509 certificate path and default tlsVerify setting so that 'qemuBuildChardevCommand' doesn't need to access the config object any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c |

[PATCH 16/24] qemuBuildChardevCommand: Split creation of the command and setup of other objects

2021-12-09 Thread Peter Krempa
Completely seprate the creation of the commandline string from the setup of other objects instantiated on the commandline. 'qemuBuildChardevCommand' will aggregate the setup of individual parameters such as -add-fd and setup of TLS and the -chardev parameter itself while the code formatting the co

[PATCH 14/24] qemuBuildChardevCommand: Move earlier

2021-12-09 Thread Peter Krempa
Make it accessible sooner inside qemu_command.c Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 442 1 file changed, 221 insertions(+), 221 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f6aab6a52c..874f875c5a

[PATCH 13/24] qemuBuildChrChardevStr: Directly generate command line

2021-12-09 Thread Peter Krempa
'qemuBuildChrChardevStr' used a hybrid approach where some arguments were directly added to '@cmd' while the commandline itself was returned as a string. This patch renames qemuBuildChrChardevStr to qemuBuildChardevCommand and adds the argument directly to @cmd inside the function. Signed-off-by:

[PATCH 07/24] qemu: Store chardev 'wait' flag in chardev source private data

2021-12-09 Thread Peter Krempa
We have just one case when we wish to wait for incomming connections for a listening socket and that is for vhost-user network devices. Passing this via a flag to qemuBuildChrChardevStr is unwieldy. Add a field to qemuDomainChrSourcePrivate and populate it for our special case inside of qemuDomain

[PATCH 05/24] qemu: command: remove the unused 'chardevStdioLogd' argument/variable

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 55 ++--- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 814b003e49..b637cd2bf5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qem

[PATCH 10/24] qemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions for all character device tests

2021-12-09 Thread Peter Krempa
Now that the test cases won't cause host modification we can add the contemporary versions. Signed-off-by: Peter Krempa --- .../console-compat-auto.x86_64-latest.args| 39 + .../console-compat-chardev.x86_64-latest.args | 39 + .../console-compat.x86_64-latest

[PATCH 06/24] qemu: domain: Refactor chardev definition preparing

2021-12-09 Thread Peter Krempa
Use the qemuDomainDeviceBackendChardevForeach helper to iterate all eligible structs and convert the setup of the TLS defaults from the config. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 103 +++- src/qemu/qemu_domain.h | 13 ++--- src/qemu/qe

[PATCH 02/24] qemu: domain: Introduce helpers for initializing chardev backend of devices

2021-12-09 Thread Peter Krempa
Introduce qemuDomainDeviceBackendChardevForeach(One) which calls the callback if either given device has a chardev backend or for all chardev backends of all devices. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 117 + src/qemu/qemu_domain.h |

[PATCH 04/24] qemu: command: Remove unused QEMU_BUILD_CHARDEV_FILE_LOGD and QEMU_BUILD_CHARDEV_UNIX_FD_PASS

2021-12-09 Thread Peter Krempa
'qemuBuildChrChardevStr' doesn't use these flags any more. Stop passing them. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 64 +++-- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c

[PATCH 03/24] qemu: Move creation and opening of chardev backend FDs to host prepare step

2021-12-09 Thread Peter Krempa
The opening of files for FD passing for a chardev backend was historically done in the function which is formatting the commandline. This has multiple problems. Firstly the function takes a lot of parameters which need to be passed through the commandline formatters. This made the 'qemuBuildChrCha

[PATCH 01/24] virDomainDeviceInfoIterateFlags: Export the symbol

2021-12-09 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 7be5b51100..cb3ee324cc 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -359,6 +359,7 @@ virDomainDeviceDef

[PATCH 00/24] chardev handling cleanups (chardev refactors part 2)

2021-12-09 Thread Peter Krempa
In this part I'm cleaning up the command line generators and unifying them. Until now there were multiple custom -chardev generators in places where it was simpler to use it than the common code. This series fixes the common code to have sane API and refactors virtiofs, vhost-user-blk vhost-user-gp

[PATCH 22/24] qemu: Use qemuBuildChrChardevCommand for vhost-user-gpu backend chardev

2021-12-09 Thread Peter Krempa
Now that the API for qemuBuildChrChardevCommand is sane enough, we can use it to centralize formatting of '-chardev' generally. The 'virDomainVideoDef' doesn't use 'virDomainChrSourceDef' internally so we create it for this occasion manually. Signed-off-by: Peter Krempa --- src/qemu/qemu_comman

[PATCH 21/24] qemu: Use qemuBuildChrChardevCommand for virtiofs backend chardev

2021-12-09 Thread Peter Krempa
Now that the API for qemuBuildChrChardevCommand is sane enough, we can use it to centralize formatting of '-chardev' generally. The 'virDomainFSDef' doesn't use 'virDomainChrSourceDef' internally so we create it for this occasion manually. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c

[PATCH 20/24] qemu: Use qemuBuildChrChardevCommand for vhost-user disk backend

2021-12-09 Thread Peter Krempa
Now that the API for qemuBuildChrChardevCommand is sane enough, we can use it to centralize formatting of '-chardev' generally. For virtiofs we don't have a centrally stored chardev source so we allocate one inline for temporary use. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 1

[PATCH 19/24] qemu: Implement chardev source setup for disk

2021-12-09 Thread Peter Krempa
Add handling to qemuDomainDeviceBackendChardevForeachOne and callbacks so that we can later use 'qemuBuildChardevCommand' for vhost-user disks instead of a custom formatter. Since we don't pass the FD for the vhost-user connection to qemu all of the setup can be skipped. Signed-off-by: Peter Krem

[PATCH 18/24] qemuBuildChardevCommand: Remove unused 'cfg' parameter

2021-12-09 Thread Peter Krempa
Now that the parameter is unused we can remove it as well as from each caller that doesn't need it any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 47 +++-- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/src/qemu/qemu_comma

[PATCH 15/24] qemuBuildChardevCommand: Don't prefix alias

2021-12-09 Thread Peter Krempa
Make the callers construct the alias for the chardev so that the function can be used also for code paths which use a different convention. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 42 +++-- 1 file changed, 24 insertions(+), 18 deletions(-) d

[PATCH 12/24] qemuBuildConsoleCommandLine: Remove identical code

2021-12-09 Thread Peter Krempa
Unify the cases for SCPL/SCLPLM/VIRTIO consoles as the code is identical. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 28 1 file changed, 28 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5c2b8d65fd..fb4535e889 100644

[PATCH 11/24] qemuxml2argvtest: Add _LATEST version for 'name-escape' case

2021-12-09 Thread Peter Krempa
It was impossible to use _LATEST when commit d7c814f7f75 was modernizing the cases as improper separation in the code caused that files were created in the host during the testsuite run. Now that the host manipulation when instantiating chardevs is separated we can add the missing version. Signed

[PATCH 08/24] qemuBuildChrChardevStr: Remove 'cdevflags' argument

2021-12-09 Thread Peter Krempa
The argument and corresponding enum are not used any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 45 ++--- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0baf3acde6..9

[PATCH 33/36] virLXCControllerSetup(Resource|Cgroup)Limits: Refactor cleanup

2021-12-09 Thread Peter Krempa
Remove the pointless cleanup sections. Signed-off-by: Peter Krempa --- src/lxc/lxc_controller.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index ae1f090077..c577d6a427 100644 --- a/src/lxc/l

[PATCH 34/36] virt-host-validate-common: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tools/virt-host-validate-common.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index aba1bdf6cf..647ed7b48b 100644 --- a/tools/virt-host-validate-common.c +++ b/to

[PATCH 36/36] virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 83e3a5d0f1..54e2462a95 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -582,8 +582,8 @@ virHostCPUG

[PATCH 35/36] virt-host-validate-qemu: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tools/virt-host-validate-qemu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c index d225a7e5c8..46ff1d2494 100644 --- a/tools/virt-host-validate-qemu.c +++ b/tools/virt-host-

[PATCH 30/36] libxl_driver: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libxl/libxl_driver.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 0b14b5093e..ef31f2cdcf 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2416,7 +2416

[PATCH 32/36] lxc_controller: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/lxc/lxc_controller.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 039efcd7c7..ae1f090077 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -731,

[PATCH 31/36] libxlDomainGetNumaParameters: Don't clear a freshly allocated bitmap

2021-12-09 Thread Peter Krempa
The bitmap is allocated just above the explicit clear, so it's already empty. Signed-off-by: Peter Krempa --- src/libxl/libxl_driver.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index ef31f2cdcf..bc8598ea96 100644 --- a/src/libxl/libxl_

[PATCH 29/36] lxcSetCpusetTune: Refactor memory clearing

2021-12-09 Thread Peter Krempa
Use automatic memory clearing for virBitmap and remove a reuse of a temporary string. Signed-off-by: Peter Krempa --- src/lxc/lxc_native.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 972e9cdc15..e9b58

[PATCH 28/36] test_driver: Use automatic memory freeing for temporary virBitmaps

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/test/test_driver.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 7ad6e15402..995e63b004 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2826,7 +2

[PATCH 27/36] util: bitmap: Unify parsing of bitmaps

2021-12-09 Thread Peter Krempa
There were two separate instances of string->virBitmap code: virBitmapParseInternal and virBitmapParseUnlimited. By adding a flag to switch to expanding APIs we can merge the two implementations into one. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 115 ++-

[PATCH 26/36] virBitmapParseInternal: Allocate the bitmap in the caller

2021-12-09 Thread Peter Krempa
In order to prepare for reuse of the function, move the allocation of the bitmap to the caller. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 1

[PATCH 25/36] virBitmapParseSeparator: Remove separator parsing capability

2021-12-09 Thread Peter Krempa
Since the feature is not needed remove it and remove the function to virBitmapParseInternal. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index a3f674

[PATCH 13/36] virHostCPUCountThreadSiblings: Refactor cleanup

2021-12-09 Thread Peter Krempa
Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 67b6910626..

[PATCH 24/36] virBitmapSetBitExpand: Remove return value

2021-12-09 Thread Peter Krempa
The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/conf/numa_conf.c| 3 +-- src/network/bridge_driver.c | 3 +-- src/util/virbitmap.c| 14 -- src/util/virbitmap.h| 4 ++-- src/util/virhostcpu.c | 6 ++-

[PATCH 23/36] virBitmapClearBitExpand: Remove return value

2021-12-09 Thread Peter Krempa
The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 9 ++--- src/util/virbitmap.h | 4 ++-- tests/virbitmaptest.c | 3 +-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virb

[PATCH 12/36] qemuSnapshotCreateInactiveExternal: Automatically free temporary variables

2021-12-09 Thread Peter Krempa
Automatically free 'cmd' and 'created' by moving them to the appropriate scopes. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 1a32b15f51..9a5d3e

[PATCH 21/36] virBitmapExpand: Remove return value

2021-12-09 Thread Peter Krempa
There's nothing that can fail in the function. Remove the return value and adjust callers. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 5f14f1e5e0..2

[PATCH 20/36] util: bitmap: Unexport 'virBitmapParseSeparator'

2021-12-09 Thread Peter Krempa
The function isn't used besides tests. Since the separator parsing capability is trivial we can keep it in place and just unexport it for now. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virbitmap.c | 2 +- src/util/virbitmap.h | 5 - tests/virbitmaptest.

[PATCH 22/36] virBitmapUnion: Remove return value

2021-12-09 Thread Peter Krempa
The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 6 +- src/util/virbitmap.h | 4 ++-- src/util/virnuma.c| 3 +-- tests/virbitmaptest.c | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/util

[PATCH 18/36] virnumamock: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/virnumamock.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/virnumamock.c b/tests/virnumamock.c index 19c26d1e37..7f2653cb53 100644 --- a/tests/virnumamock.c +++ b/tests/virnumamock.c @@ -63,29 +63,23 @@ virNumaIsAv

[PATCH 19/36] test_virCapabilitiesGetCpusForNodemask: Refactor cleanup

2021-12-09 Thread Peter Krempa
Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- tests/vircapstest.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/vircapstest.c b/tests/vircapstest.c index d1b503384

[PATCH 15/36] virHostCPUParseNode: Use automatic memory freeing for virBitmap

2021-12-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virhostcpu.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index a8d8b34a39..1920184f61 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -300,10 +300,10 @@ v

[PATCH 16/36] virCgroupGetPercpuStats: Refactor cleanup

2021-12-09 Thread Peter Krempa
Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa --- src/util/vircgroup.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c ind

  1   2   >