Re: [PATCH v6 2/4] conf: introduce support for acpi-bridge-hotplug feature

2021-10-07 Thread Laine Stump
On 10/5/21 1:51 AM, Ani Sinha wrote: This change introduces a new libvirt sub-element under that can be used to configure all pci related features. Currently the only sub-sub element supported by this sub-element is 'acpi-bridge-hotplug' as shown below: The above option is

Re: [PATCH v6 4/4] NEWS: add new acpi pci hotplug config option in the release note for next release

2021-10-07 Thread Laine Stump
On 10/5/21 1:51 AM, Ani Sinha wrote: Added the following new libvirt conf option to the release note to indicate their availability with the next release: Signed-off-by: Ani Sinha --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst

Re: [PATCH v6 3/4] qemu: command: add support for acpi-bridge-hotplug feature

2021-10-07 Thread Laine Stump
On 10/5/21 1:51 AM, Ani Sinha wrote: This change adds backend qemu command line support for new libvirt global feature 'acpi-bridge-hotplug'. This option can be used as following: The '' sub-element under '' is also newly introduced. 'acpi-bridge-hotplug' turns on the

Re: [PATCH v6 2/4] conf: introduce support for acpi-bridge-hotplug feature

2021-10-07 Thread Laine Stump
On 10/7/21 11:12 PM, Laine Stump wrote: @@ -27932,6 +27995,30 @@ virDomainDefFormatFeatures(virBuffer *buf, virDomainIBSTypeToString(def->features[i]));   break; +    case VIR_DOMAIN_FEATURE_PCI: +    if (def->features[i] !=

Re: [PATCH v6 2/4] conf: introduce support for acpi-bridge-hotplug feature

2021-10-07 Thread Laine Stump
On 10/5/21 1:51 AM, Ani Sinha wrote: This change introduces a new libvirt sub-element under that can be used to configure all pci related features. Currently the only sub-sub element supported by this sub-element is 'acpi-bridge-hotplug' as shown below: I guess this is as

Re: [PATCH v6 1/4] qemu: capablities: detect presence of acpi-pci-hotplug-with-bridge-support

2021-10-07 Thread Laine Stump
On 10/5/21 1:51 AM, Ani Sinha wrote: qemu added support for i440fx specific global boolean flag PIIX4_PM.acpi-pci-hotplug-with-bridge-support around version 2.1. This flag is enabled by default. When disabled, it turns off acpi pci hotplug for cold plugged pci bridges in i440fx machine types.

Re: [PATCH] lxc: controller: Fix container launch on cgroup v1

2021-10-07 Thread Jim Fehlig
On 10/7/21 09:08, Cole Robinson wrote: With cgroup v1 I'm seeing LXC container startup failures: $ sudo virt-install --connect lxc:/// --name test-container --memory 128 --boot init=/bin/sh Starting install... ERRORerror from service: GDBus.Error:org.freedesktop.machine1.NoMachineForPID:

Re: [PATCH v6 0/4] introduce support for acpi-bridge-hotplug feature

2021-10-07 Thread Ani Sinha
Also just for the statistics , it's been almost 2 months now since the effort on the two patches started. On Fri, Oct 8, 2021 at 4:46 AM Ani Sinha wrote: > Other than laine doesn't anyone have any feedback on this patch set? > Timely reviews help contributions. It's difficult to sit on a patch

Re: [PATCH v6 0/4] introduce support for acpi-bridge-hotplug feature

2021-10-07 Thread Ani Sinha
Other than laine doesn't anyone have any feedback on this patch set? Timely reviews help contributions. It's difficult to sit on a patch set and keep rebasing for ever. On Tue, Oct 5, 2021 at 11:21 AM Ani Sinha wrote: > changelog: > > v6: rebased to latest. capabilities have been renamed as per

[PATCH v1] tools: add virt-host-validate-ch for ch driver

2021-10-07 Thread Praveen K Paladugu
Signed-off-by: Wei-Chen Chen Signed-off-by: Praveen K Paladugu --- po/POTFILES.in| 1 + tools/meson.build | 5 +++ tools/virt-host-validate-ch.c | 85 +++ tools/virt-host-validate-ch.h | 24 ++ tools/virt-host-validate.c|

[PATCH v4 2/5] qemu: capablities: Detect presence of 'rbd-encryption' as QEMU_CAPS_RBD_ENCRYPTION

2021-10-07 Thread Or Ozeri
rbd encryption is new in qemu 6.1.0. This commit adds capability probing for it. Signed-off-by: Or Ozeri --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + 3 files changed,

Re: [PATCH 020/103] tests: qemuxml2argv: Test also the i6300esb watchdog

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Convert one of the tests to a different device. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/watchdog-device.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/watchdog-device.xml| 2 +- 2 files changed, 2 insertions(+), 2

Re: [PATCH 4/4] virt-aa-helper: test: add test for new option -P

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Ioanna Alifieraki wrote: Create a corrupt profile and expect to be removed after the test is run. Signed-off-by: Ioanna Alifieraki --- tests/meson.build | 1 + tests/virt-aa-helper-test | 29 + 2 files changed, 30 insertions(+)

Re: [PATCH 3/4] virt-aa-helper: Purge profile if corrupted

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Ioanna Alifieraki wrote: This commit aims to address the bug reported in [1] and [2]. If the profile is corrupted (0-size) the VM cannot be launched. To overcome this check if the profile exists and if it has 0 size remove it and create it again. [1]

Re: [PATCH 021/103] qemuxml2argvtest: Convert 'panic' test cases to DO_TEST_CAPS_LATEST

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- ...e.args => panic-double.x86_64-latest.args} | 16 tests/qemuxml2argvdata/panic-no-address.args | 33 - .../panic-no-address.x86_64-latest.args | 37 +++

Re: [PATCH 019/103] tests: qemuxml2argv: Convert watchdog tests on x86_64 to DO_TEST_CAPS_LATEST

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/watchdog-device.args | 34 - .../watchdog-device.x86_64-latest.args| 38 +++ tests/qemuxml2argvdata/watchdog-dump.args | 34 -

[PATCH v4 0/5] Add support for librbd encryption

2021-10-07 Thread Or Ozeri
v4: - added disk post parse to image creation flow in qemublocktest (since more tests failed after adding engine validation) - removed symlink changes - added luks2 and engine documentation - switched to using enum engine instead of int - added validation for encryption engine and formats

[PATCH v4 5/5] conf: add luks2 encryption format

2021-10-07 Thread Or Ozeri
This commit extends libvirt XML configuration to support luks2 encryption format. This means that becomes valid. Currently librbd is the only engine that supports this new format. Signed-off-by: Or Ozeri --- docs/formatstorageencryption.html.in | 12 +++-

[PATCH v4 4/5] qemu: add librbd encryption engine

2021-10-07 Thread Or Ozeri
rbd encryption is new in qemu 6.1.0. This commit adds a new encryption engine property which allows the user to use this new encryption engine. Signed-off-by: Or Ozeri --- docs/formatstorageencryption.html.in | 7 +- docs/schemas/storagecommon.rng| 1 +

[PATCH v4 3/5] conf: add encryption engine property

2021-10-07 Thread Or Ozeri
This commit extends libvirt XML configuration to support a custom encryption engine. This means that becomes valid. The only engine for now is qemu. However, a new engine (librbd) will be added in an upcoming commit. If no engine is specified, qemu will be used (assuming qemu driver is used).

[PATCH v4 1/5] qemu: add disk post parse to qemublocktest

2021-10-07 Thread Or Ozeri
The post parse callback is part of the real (non-test) processing flow. This commit adds it (for disks) to the qemublocktest flow as well. Specifically, this will be needed for tests that use luks encryption, so that the default encryption engine (which is added in an upcoming commit) will be

Re: [PATCH 052/103] qemu: validate: Move validation of device rom

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Move the validation from 'qemuBuildRomStr' into the function which validates device info. It was originally named 'qemuValidateDomainDeviceDefAddress' but this commit renames it to 'qemuValidateDomainDeviceDefInfo'. Signed-off-by: Peter Krempa ---

Re: [PATCH 051/103] qemuValidateDomainDeviceDef: Avoid unneded variable and 'break' statements

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 72 ++-- 1 file changed, 24 insertions(+), 48 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 046/103] qemu: process: Make qemuProcessPrepareDomainDiskBootorder more universal

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Rename it to 'qemuProcessPrepareDeviceBootorder' and call it from 'qemuProcessPrepareDomain' rather than 'qemuProcessPrepareDomainStorage'. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH 045/103] conf: Introduce 'effectiveBootIndex' into 'virDomainDeviceInfo'

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: 'effectiveBootIndex' is a copy of 'bootIndex' if

Re: [PATCH 042/103] qemuBuildVirtioDevStr: Format also virtioOptions

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Merge the code from qemuBuildVirtioOptionsStr so that we don't have to call two separate functions. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 39 ++- .../vhost-vsock-ccw-iommu.s390x-latest.args |

Re: [PATCH 044/103] qemuBuildDeviceVideoStr: Properly format virtio options for 'virtio-vga'

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: 'virtio-vga' is a virtio device but we didn't use the virtio formatter for it. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description:

Re: [PATCH 049/103] virDomainDeviceGetInfo: Make argument const

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/qemu/qemu_validate.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 050/103] qemuValidateDomainDeviceDef: Optimize virDomainDeviceInfo validation

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Commit ffda44030a2 added validation of the 'acpiIndex' field in virDomainDeviceInfo by calling 'virDomainDeviceInfoIterate' from 'qemuValidateDomainDef'. This is overly complicated we have 'qemuValidateDomainDeviceDef' which is already called for every

Re: [PATCH 048/103] qemu: Clean up after old-style passing of 'bootIndex' to network devices

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Remove the nw unused boot-index related attributes and the code which is *now assigning it. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 71 - src/qemu/qemu_command.h | 2 --

Re: [PATCH 043/103] qemuBuildVirtioOptionsStr: Remove empty function

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 27 --- 1 file changed, 27 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 041/103] qemuBuildVirtioDevStr: Remove 'baseName' argument

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The code doesn't need the name as it determines it internally. Remove the argument and fix all callers. In certain cases it lead to s/lead/led/ Lead and lead compounds can cause cancer, reproductive harm or birth defects in the state of California.

Re: [PATCH 047/103] qemu: Use 'effectiveBootIndex' to handle

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Fill in the effective boot index for network devices (or hostdev-backed network devices via 'qemuProcessPrepareDeviceBootorder'. This patch doesn't clean up the cruft to make it more obvious what's happening. Signed-off-by: Peter Krempa ---

Re: [PATCH 040/103] qemuBuildVirtioDevGetConfigDev: Provide more information

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Since we already have code for per-device behaviour we can also populate the device name and extract virtioOptions in the switch statement so that callers don't have to pass it in. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 107

Re: [PATCH 039/103] qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Add the bus suffix in a separate call. This will make it more obvious what's happening in the next commit. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH 038/103] qemuDeviceVideoGetModel: Move to the beginning

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The function is static and will be needed in the virtio device config helper. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 248 1 file changed, 124 insertions(+), 124 deletions(-) Reviewed-by:

Re: [PATCH 037/103] qemuDeviceVideoGetModel: Clarify 'virtio' argument

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'virito' argument was misleadingly implying that it's true for all *virtio virtio devices, but that's not the case. 'virtio-vga(-gl)' is a virtio device but doesn't accept the usual bus-dependant suffix. Add a comment for

Re: [PATCH 036/103] qemuBuildVirtioDevGetConfig: Split out per device type code

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Split out the function a bit more to separate the per-device code. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 151 +--- 1 file changed, 80 insertions(+), 71 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH 032/103] qemuBuildDeviceAddressPCIStr: Extract PCI bus name lookup

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Split up the bus lookup into a function called 'qemuBuildDeviceAddressPCIGetBus'. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 48 + 1 file changed, 30 insertions(+), 18 deletions(-) Reviewed-by:

Re: [PATCH 034/103] qemuBuildVirtioDevStr: Don't return early

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: To simplify upcoming refactors change the logic such that we don't return early for device types which can't be transitional. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 90 - 1 file changed, 45

Re: [PATCH 030/103] qemuBuildDeviceAddressSt: Split out formatting of PCI address

2021-10-07 Thread Ján Tomko
s/St/Str/ in the commit summary On a Thursday in 2021, Peter Krempa wrote: The PCI address case grew massive over time. Split it out into a new function qemuBuildDeviceAddressPCIStr. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 147 ++-- 1 file

Re: [PATCH 035/103] qemuBuildVirtioDevStr: Extract code for determining device model

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Extract the code into 'qemuBuildVirtioDevGetConfig' so that we can later reuse it when converting individual device code into the more modern JSON approach as the extracted code will be necessary either way. Signed-off-by: Peter Krempa ---

Re: [PATCH 031/103] qemuBuildDeviceAddressPCIStr: Make error messages easier to find

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Per coding guidelines error messages should not be broken into lines and variables should be separated by apostrophes. https://libvirt.org/coding-style.html#error-message-format Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++--

[PATCH 0/4] virt-aa-helper: Add new option to remove corrupted

2021-10-07 Thread Ioanna Alifieraki
This patch-series aims to address the bug reported in [1] and [2]. Bug description : Some times libvirt fails to start a vm with the following error : libvirt: error : unable to set AppArmor profile 'libvirt-b05b297f-952f-42d6-b04e-f9a13767db54' for '/usr/bin/kvm-spice': No such file or

[PATCH 1/4] virt-aa-helper: Move create and remove profile into separate functions

2021-10-07 Thread Ioanna Alifieraki
Reorganise create and remove functionality into functions for later reuse in calls from multiple places. Signed-off-by: Ioanna Alifieraki --- src/security/virt-aa-helper.c | 55 ++- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git

Re: [PATCH 029/103] qemuBlockStorageSourceAttachRollback: Sanitize warning messages

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Mention the QMP command 'device_add' rather than 'qemuMonitorAddDevice' and remove the weird formatting. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano

[PATCH 4/4] virt-aa-helper: test: add test for new option -P

2021-10-07 Thread Ioanna Alifieraki
Create a corrupt profile and expect to be removed after the test is run. Signed-off-by: Ioanna Alifieraki --- tests/meson.build | 1 + tests/virt-aa-helper-test | 29 + 2 files changed, 30 insertions(+) diff --git a/tests/meson.build b/tests/meson.build

[PATCH 2/4] virt-aa-helper: Add new purge (-P) option

2021-10-07 Thread Ioanna Alifieraki
Currently there is no way to remove the profile file. This commit provides this functionality (required for next commit). Signed-off-by: Ioanna Alifieraki --- src/security/virt-aa-helper.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git

[PATCH 3/4] virt-aa-helper: Purge profile if corrupted

2021-10-07 Thread Ioanna Alifieraki
This commit aims to address the bug reported in [1] and [2]. If the profile is corrupted (0-size) the VM cannot be launched. To overcome this check if the profile exists and if it has 0 size remove it and create it again. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890084 [2]

Re: [PATCH 026/103] qemuMonitorJSONAddDeviceProps: Refactor cleanup

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use automatic memory freeing and remove 'ret' variable and 'cleanup' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 023/103] qemu: Move watchdog model validation into the validation code

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Report the error from 'qemuValidateDomainWatchdogDef' rather than 'qemuBuildWatchdogDevStr'. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 10 +++--- src/qemu/qemu_validate.c | 4 +++- 2 files changed, 6 insertions(+), 8 deletions(-)

Re: [PATCH 028/103] virQEMUBuildCommandLineJSONRecurse: Error out when array conversion function is not provided

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: For conversion of '-device' we'll try to avoid usage of arrays if possible, so for now if the array coversion function is not provided the convertor will error out. Signed-off-by: Peter Krempa --- src/util/virqemu.c | 8 +++- 1 file changed, 7

Re: [PATCH 024/103] qemuDomainHotplugAddVcpu: Refactor cleanup

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Use g_autoptr for 'vcpuprops' and remove the 'cleanup' label and 'ret' varlaible which is no longer needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-)

Re: [PATCH 025/103] qemu: Rename 'qemuMonitorAddDeviceArgs' to 'qemuMonitorAddDeviceProps'

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: We commonly use 'props' for the JSON object describing something. Rename the monitor device addition code. Additionally the common approach is to clear the pointer if it was consumed so the arguments are adjusted to do so. Signed-off-by: Peter Krempa

Re: [PATCH 027/103] virQEMUBuildCommandLineJSONIterate: Simplify logic

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: With automatic memory freeing we can simplify the function to avoid two almost-identical calls to virQEMUBuildCommandLineJSONRecurse. Signed-off-by: Peter Krempa --- src/util/virqemu.c | 18 ++ 1 file changed, 6 insertions(+), 12

Re: [PATCH 014/103] virQEMUBuildDriveCommandlineFromJSON: Open-code in callers

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Optimize the number of string copies by using the virBuffers in the callers directly. Simplest way to achieve this is to just open code the one function call 'virQEMUBuildDriveCommandlineFromJSON' was wrapping in the two callers. Signed-off-by: Peter

Re: [PATCH 016/103] virCommandGetArgList: Remove 'nargs' argument

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The returned argument list is a NULL-terminated string list and the only caller doesn't use the count. Remove the argument. Signed-off-by: Peter Krempa --- src/util/vircommand.c| 4 +--- src/util/vircommand.h| 2 +- tests/qemuxml2argvtest.c | 3

Re: [PATCH 022/103] qemuxml2xmltest: Remove 'panic-isa' case

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The same test in regards to the 'panic' device is the 'panic-double' case, thus panic-isa can be removed. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/panic-isa.xml | 33 tests/qemuxml2xmltest.c | 1

Re: [PATCH 006/103] qemuBuildObjectCommandlineFromJSON: Format directly into the virCommand

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: All callers basically end up dumping the buffer into a string and then adding '-object' 'props' arguments to virCommand. Simplify all callers by doing this in the function itself. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 119

Re: [PATCH 005/103] qemuBuildInputDevStr: Don't mix generators for -object and -device

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Input devices of VIR_DOMAIN_INPUT_TYPE_EVDEV type are instantiated via an '-object' rather than a '-device'. Mixing them in one function is a bad idea as the caller then needs to use the string correctly which is not the case in

Re: [PATCH 004/103] qemuBuildMemoryCellBackendStr: Return JSON props instead of a buffer

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Rename the function to 'qemuBuildMemoryCellBackendProps' and return the properties before conversion to commandline arguments. This requires changes in the caller. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 39

Re: [PATCH 001/103] virJSONValueObjectAddVArgs: Add 'k' convertor for formatting non-negative integers

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: In many cases we use a signed value, but use the sign to note that it was not assigned. For converting to JSON objects it will be handy to have possibility to do this automatically. Signed-off-by: Peter Krempa --- src/util/virjson.c | 7 ++- 1 file

[PATCH 088/103] qemuBuildUSBControllerDevStr: Split out validation of USB controller

2021-10-07 Thread Peter Krempa
Move the validation code into a separate function. For now the validation is still kept in the commandline format step as simply just moving it to the validator causes failures in the test suite, which will need to be investigated deeper. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c

[PATCH 081/103] qemuBuildInterfaceCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
virtio-net-pci specific properties and their types according to QEMU: tx= ioeventfd= - on/off (default: true) event_idx= - on/off (default: true) csum=- on/off (default: true) gso= - on/off (default: true) host_tso4= - on/off (default: true)

[PATCH 095/103] qemuBuildVHostUserFsCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The 'vhost-user-fs-pci' has following properties we control: chardev= - ID of a chardev to use as a backend queue-size=- (default: 128) tag= bootindex= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 43 -

[PATCH 085/103] qemuBuildControllerDevStr: Split out formatting of PCI controller

2021-10-07 Thread Peter Krempa
Move the code into a new function called qemuBuildControllerPCIDevStr so that the code is self contained and the original function easier to follow. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 157 ++-- 1 file changed, 87 insertions(+), 70

[PATCH 103/103] qemu: command: Remove unused 'qemuBuildDeviceAddressStr'

2021-10-07 Thread Peter Krempa
All users were converted to the JSON counterpart. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 99 + 1 file changed, 1 insertion(+), 98 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 53f38ff306..bfba69a974

[PATCH 064/103] qemuBuildHostdevMediatedDevProps: Move 'ramfb' and 'bootindex' before the address

2021-10-07 Thread Peter Krempa
Simplify the generator by moving few properties earlier. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++-- .../hostdev-mdev-display-ramfb.x86_64-latest.args | 2 +- .../hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args | 2 +- 3

[PATCH 083/103] qemu: command: Remove unused qemuBuildRomStr

2021-10-07 Thread Peter Krempa
Now that all users were converted to qemuBuildRomProps we can remove the old code and un-mark qemuBuildRomProps as unused. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git

[PATCH 101/103] qemuBuildHubCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The 'usb-hub' device doesn't have any special properties. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index

[PATCH 076/103] qemu: capabilities: Retire QEMU_CAPS_VIRTIO_IOEVENTFD

2021-10-07 Thread Peter Krempa
It's not used since last commit. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 - tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml |

[PATCH 086/103] qemuBuildControllerSCSIDevStr: Format via JSON properties

2021-10-07 Thread Peter Krempa
Internally format the SCSI controller properties into JSON, but convert it back to a string so that we for now change just the SCSI controller. The change in tests is expected as the 'reg' field for a spapr-vio address is expected to be a number: $ qemu-system-ppc64 -device spapr-vscsi,help

[PATCH 074/103] qemuBuildSCSIHostdevDevProps: Reorder 'drive', 'id' and 'bootindex' after address

2021-10-07 Thread Peter Krempa
Simplify the generator by shuffling around few fields. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c| 10 +++--- .../hostdev-scsi-lsi.x86_64-4.1.0.args | 12 ++-- .../hostdev-scsi-lsi.x86_64-latest.args| 12 ++--

[PATCH 062/103] qemuBuildRNGCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The 'virtio-rng' has the following property types according to QEMU: rng=> max-bytes= - (default: 9223372036854775807) period=- (default: 65536) Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 46 +++-- src/qemu/qemu_command.h |

[PATCH 061/103] qemuBuildMemballoonCommandLine: Reorder properties

2021-10-07 Thread Peter Krempa
Move the 'deflate-on-oom' and 'free-page-reporting' before the address to simplify the genrator code. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++-- tests/qemuxml2argvdata/balloon-ccw-deflate.args | 2 +-

[PATCH 068/103] qemuCommandAddExtDevice: Generate via JSON

2021-10-07 Thread Peter Krempa
Generate the 'zpci' device via JSON. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 81 +++-- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_hotplug.c | 27 +- 3 files changed, 49 insertions(+), 62 deletions(-) diff --git

[PATCH 057/103] qemuBuildWatchdogCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The watchdog doesn't have any special properties. Convert the command line generator and hotplug code. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 31 +++ src/qemu/qemu_command.h | 6 +++--- src/qemu/qemu_hotplug.c | 6 +++--- 3 files changed, 21

[PATCH 053/103] qemu: command: Introduce JSON variant of qemuBuildVirtioDevStr

2021-10-07 Thread Peter Krempa
Add a JSON variant of the generator of properties for virtio devices. For convenience both the old and new are for now marked as unused, which will be removed once the conversion is complete. The formatted properties have following types according to QEMU. 'virtio-blk-pci' was used as an example:

Re: [PATCH 002/103] virJSONValueObjectAddVArgs: Add check for presence of the ':' separator

2021-10-07 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Enforce that the ':' separator between the key and value is always present. Signed-off-by: Peter Krempa --- src/util/virjson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP

[PATCH 044/103] qemuBuildDeviceVideoStr: Properly format virtio options for 'virtio-vga'

2021-10-07 Thread Peter Krempa
'virtio-vga' is a virtio device but we didn't use the virtio formatter for it. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index daaccff9b6..dc3320ba9a 100644 ---

[PATCH 039/103] qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix

2021-10-07 Thread Peter Krempa
Add the bus suffix in a separate call. This will make it more obvious what's happening in the next commit. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index

[PATCH 082/103] qemuBuildNicDevProps: Move formatting of bootindex

2021-10-07 Thread Peter Krempa
Move the bootindex before the address so that the code is simpler. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 +- tests/qemuxml2argvdata/aarch64-video-virtio-gpu-pci.args| 2 +- tests/qemuxml2argvdata/boot-complex.args

[PATCH 092/103] qemuBuildHostdevCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
Build the properties of 'vhost-scsi' device via JSON. In comparison to previous similar refactors this also modifies the hotplug code to attach the vhost fd handle explicitly rather than using 'qemuMonitorAddDeviceWithFd'. The 'vhost-scsi' device doesn't have any special (non-string) properties.

[PATCH 056/103] qemuBuildPanicCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
Format a JSON object with the device properties and then use qemuBuildDeviceCommandlineFromJSON to convert it to the standard commandline for now. The 'ioport' property of 'pvpanic' is a number in QEMU: ioport=- (default: 1285) Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c

[PATCH 098/103] qemu: Command remove unused 'qemuBuildVirtioDevStr'

2021-10-07 Thread Peter Krempa
All virtio devices were converted to the new JSON formatter so we can remove the old one. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 65 + 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/src/qemu/qemu_command.c

[PATCH 071/103] qemuBuildDeviceAddressProps: Format also 'drive' addresses

2021-10-07 Thread Peter Krempa
Introduce infrastructure to format 'drive' addresses via the standard helper rather than hand-rolled generators used inline. The code needs to know the disk bus to format the correct address which is passed in via an internal field in virDomainDeviceDriveAddress. The field types according to

[PATCH 058/103] qemuBuildMemoryDeviceCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
This includes the 'pc-dimm', 'nvdimm', 'virtio-pmem-pci' and 'virtio-mem-pci' devices. The value types according to QEMU are: 'pc-dimm' node= - (default: 0) memdev=> 'nvdimm' label-size= memdev=> node= - (default: 0) unarmed= - (default: false) uuid=

[PATCH 100/103] qemuBuildSoundCommandLine: Generate codecs via JSON

2021-10-07 Thread Peter Krempa
The codec devices have the following properties we control: cad= - (default: 4294967295) audiodev= - ID of an audiodev to use as a backend Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 64 ++--- 1 file changed, 28

[PATCH 093/103] qemuBuildVsockCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
Build the properties of 'vhost-vsock' device via JSON. In comparison to previous similar refactors this also modifies the hotplug code to attach the vhost fd handle explicitly rather than using 'qemuMonitorAddDeviceWithFd'. The properties of vhost-vsock have the following types according to QEMU:

[PATCH 099/103] qemuBuildSoundCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The sound devices have only the 'audiodev' property which is a string. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index

[PATCH 043/103] qemuBuildVirtioOptionsStr: Remove empty function

2021-10-07 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 27 --- 1 file changed, 27 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 60404b6dd8..daaccff9b6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1042,13

[PATCH 026/103] qemuMonitorJSONAddDeviceProps: Refactor cleanup

2021-10-07 Thread Peter Krempa
Use automatic memory freeing and remove 'ret' variable and 'cleanup' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index

[PATCH 024/103] qemuDomainHotplugAddVcpu: Refactor cleanup

2021-10-07 Thread Peter Krempa
Use g_autoptr for 'vcpuprops' and remove the 'cleanup' label and 'ret' varlaible which is no longer needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[PATCH 090/103] qemuBuildControllersByTypeCommandLine: Generate via JSON

2021-10-07 Thread Peter Krempa
The handlers for PCI, SCSI and USB controllers already use JSON internally. This patch converts 'virtio-serial', 'ccid' and 'sata' to do the same and passes out the JSON directly so that it can be used in monitor code to avoid conversion. >From the controllers converted in this patch only

[PATCH 089/103] qemuBuildUSBControllerDevStr: Format via JSON properties.

2021-10-07 Thread Peter Krempa
Internally format the PCI controller properties into JSON, but convert it back to a string as preparation for upcoming refactors. The following types are declared for the properties we use by QEMU: 'nec-usb-xhci' p2=- (default: 4) p3=- (default: 4) 'ich9-usb-uhci6'

[PATCH 063/103] qemuBuildHostdevCommandLine: Build mediated device commandline via JSON

2021-10-07 Thread Peter Krempa
The 'vfio-pci-nohotplug' device has the following property types according to QEMU: display=- on/off/auto (default: "off") sysfsdev= ramfb= bootindex= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 48 ++--- src/qemu/qemu_command.h |

[PATCH 048/103] qemu: Clean up after old-style passing of 'bootIndex' to network devices

2021-10-07 Thread Peter Krempa
Remove the nw unused boot-index related attributes and the code which is assigning it. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 71 - src/qemu/qemu_command.h | 2 -- src/qemu/qemu_hotplug.c | 5 ++- 3 files changed, 16 insertions(+), 62

[PATCH 070/103] qemuBuildPCIHostdevDevProps: Move 'failover_pair_id' property before address

2021-10-07 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c| 6 +- tests/qemuxml2argvdata/net-virtio-teaming-hostdev.args | 4 ++-- tests/qemuxml2argvdata/net-virtio-teaming.args | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git

[PATCH 072/103] qemu: validate: Move disk address validation code

2021-10-07 Thread Peter Krempa
Move the code from 'qemuValidateDomainDeviceDefDiskFrontend' into 'qemuValidateDomainDeviceDefAddressDrive' which is called from 'qemuValidateDomainDeviceDefAddress' so that we have all address validation code together. This also allows us to remove the inline validation inside

[PATCH 010/103] testCompareXMLToArgvValidateSchema: Base -netdev validation on JSON

2021-10-07 Thread Peter Krempa
Base the validation on presence of JSON as we do with other validated commands. This will prepare the code for a refactor so that it's the same for all validated commands. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff

  1   2   >