Re: [PATCH 0/7] qemu: Rework qemuBuildDeviceVideoStr() slightly

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 17:04:53 +0200, Michal Privoznik wrote: > The most important patch is 7/7, IMO. The rest is just prep work. > > Michal Prívozník (7): > qemuDomainSupportsVideoVga: Fix const correctness > qemuBuildDeviceVideoStr: Separate out video module selection > qemuDeviceVideoGe

Re: [PATCH 7/7] qemuBuildDeviceVideoStr: Don't overwrite @model

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 17:05:00 +0200, Michal Privoznik wrote: > Now we have everything prepared so that @model doesn't have to be > rewritten. The correct model can be chosen right from the > beginning. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_command.c | 27 --

Re: [PATCH 5/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideoSecondary) to explicit switch()

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 17:04:58 +0200, Michal Privoznik wrote: > This may look like a step backwards, but it isn't. The point is > that in near future the chosen model will depend on more than > just video type. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_command.c | 41 ++

Re: [PATCH 4/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideo) to explicit switch()

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 17:04:57 +0200, Michal Privoznik wrote: > This may look like a step backwards, but it isn't. The point is > that in near future the chosen model will depend on more than > just video type. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_command.c | 56 ++

[PATCH 1/7] qemuDomainSupportsVideoVga: Fix const correctness

2021-06-11 Thread Michal Privoznik
This function doesn't modify passed video definition. Make the argument const. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domain.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7f

[PATCH 2/7] qemuBuildDeviceVideoStr: Separate out video module selection

2021-06-11 Thread Michal Privoznik
The code that decides video card model is going to be reworked and expanded. Separate it out into a function. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c

[PATCH 7/7] qemuBuildDeviceVideoStr: Don't overwrite @model

2021-06-11 Thread Michal Privoznik
Now we have everything prepared so that @model doesn't have to be rewritten. The correct model can be chosen right from the beginning. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src

[PATCH 6/7] qemuBuildDeviceVideoStr: Move logic wrapping qemuBuildVirtioDevStr() into qemuDeviceVideoGetModel()

2021-06-11 Thread Michal Privoznik
We want to call qemuBuildVirtioDevStr() from qemuBuildDeviceVideoStr() but only for some models (currently "virtio-gpu" and "vhost-user-gpu"), not all of them. Move this logic into qemuDeviceVideoGetModel() because this logic will be refined. Signed-off-by: Michal Privoznik --- src/qemu/qemu_com

[PATCH 5/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideoSecondary) to explicit switch()

2021-06-11 Thread Michal Privoznik
This may look like a step backwards, but it isn't. The point is that in near future the chosen model will depend on more than just video type. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 41 + 1 file changed, 21 insertions(+), 20 deletion

[PATCH 4/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideo) to explicit switch()

2021-06-11 Thread Michal Privoznik
This may look like a step backwards, but it isn't. The point is that in near future the chosen model will depend on more than just video type. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 56 + 1 file changed, 34 insertions(+), 22 deletion

[PATCH 3/7] qemuDeviceVideoGetModel: Deduplicate a check

2021-06-11 Thread Michal Privoznik
There is the same check written twice (whether given video card is primary one and whether it supports VGA mode). Write it just once and store it in a boolean variable. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[PATCH 0/7] qemu: Rework qemuBuildDeviceVideoStr() slightly

2021-06-11 Thread Michal Privoznik
The most important patch is 7/7, IMO. The rest is just prep work. Michal Prívozník (7): qemuDomainSupportsVideoVga: Fix const correctness qemuBuildDeviceVideoStr: Separate out video module selection qemuDeviceVideoGetModel: Deduplicate a check qemu_command: Switch from VIR_ENUM_IMPL(qemuDe

[PATCH 15/22] qemu: Always reject 'virtio-s390' addresses

2021-06-11 Thread Peter Krempa
QEMU_CAPS_VIRTIO_S390 can never be asserted any more, add an explicit check that will reject the 'virtio-s390' address type and remove the code which would auto-fill them. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain_address.c | 5 - src/qemu/qemu_validate.c | 6 +- 2 files

[PATCH 05/22] tests: qemuxml2argv: Modernize 'console-sclp' test

2021-06-11 Thread Peter Krempa
The 's390-virtio' machine was removed from qemu in the 2.6 release. Modernize the test for sclp console since there isn't any other test for it. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/console-sclp.args | 28 --- .../console-sclp.s390x-latest.args| 36

[PATCH 07/22] tests: qemuxml2argv: Modernize 's390-allow-bogus-usb-none' test

2021-06-11 Thread Peter Krempa
The 's390-virtio' machine was removed from qemu in the 2.6 release. Use the more modern s390-ccw-virtio machine type and use VIR_TEST_CAPS_ARCH_LATEST to invoke it. Signed-off-by: Peter Krempa --- .../s390-allow-bogus-usb-none.args| 31 --- ...390-allow-bogus-usb-none.s39

[PATCH 19/22] qemu: Drop handling of devices with VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390

2021-06-11 Thread Peter Krempa
We don't support any qemu which would support the 'virtio-s390' addressing, thus we can drop all code related to it. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c| 6 +- src/qemu/qemu_domain_address.c | 5 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a

[PATCH 22/22] qemu: validate: Don't check bus type in qemuValidateDomainDeviceDefDiskIOThreads

2021-06-11 Thread Peter Krempa
IOThreads are supported with all 3 currently supported buses which can have virtio devices (PCI, CCW, MMIO) , so there's no need for this check. Additionally this check was buggy in the current location as on e.g. hotplug cases the address may not yet be assigned for the disk and thus a bogus erro

[PATCH 12/22] qemu: capabilities: Remove probing of 'virtio-*-s390' devices

2021-06-11 Thread Peter Krempa
QEMU commit 7b3fdbd9a826791bd98e649cf44c0a6129a44179 released in 2.6 dropped the legacy s390 virtio machine and it's devices. Remove our probing based on the devices. The probing of properties of the appropriate devices will be removed subsequently. Signed-off-by: Peter Krempa --- src/qemu/qemu

[PATCH 17/22] qemuxml2*test: Remove QEMU_CAPS_VIRTIO_S390 flag

2021-06-11 Thread Peter Krempa
The flag isn't used by the code in any way so it can be dropped from the legacy test cases. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 92 ++-- tests/qemuxml2xmltest.c | 24 --- 2 files changed, 41 insertions(+), 75 deletions(-) diff

[PATCH 10/22] qemu: domain: Remove hack for 's390-virtio' machine

2021-06-11 Thread Peter Krempa
qemuDomainDefAddDefaultDevices skipped adding the memballoon for the 's390-virtio' machine type, but since it was removed in qemu 2.6 we can remove the hack now. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 4 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b

[PATCH 08/22] tests: qemuxml2xml: Modernize 's390-defaultconsole' case

2021-06-11 Thread Peter Krempa
Don't use the 's390-virtio' machine which was removed in qemu 2.6 and use real capabilities for the test. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/s390-defaultconsole.xml| 2 +- ...efaultconsole.xml => s390-defaultconsole.s390x-latest.xml} | 4 +++- tests/qemuxml2xm

[PATCH 06/22] tests: qemuxml2argv: Remove redundant tests for the obsolete 'virtio-390' machine

2021-06-11 Thread Peter Krempa
Remove the console, disk, and network test for the legacy s390 machine which was removed in qemu 2.6. All of these have 'ccw' equivalents. Signed-off-by: Peter Krempa --- .../qemuxml2argvdata/console-virtio-s390.args | 29 --- .../qemuxml2argvdata/console-virtio-s390.xml | 24 --

[PATCH 02/22] qemuxml2arvtest: Ensure newline at the end of generated .args files

2021-06-11 Thread Peter Krempa
The switch to internal linebreaking of arguments caused a problem when generating .args files with VIR_TEST_REGENERATE_OUTPUT as the last argument isn't terminated with a newline. Switch to using virCommandToStringBuf and append a newline. Fixes: 0046e0b1c26c8e0167de4a35be2902b9327b0c51 Signed-of

[PATCH 14/22] qemuxml2argvtest: Use other bus capability for 'non-x86_64-timer-error' case

2021-06-11 Thread Peter Krempa
Give the test QEMU_CAPS_CCW instead of QEMU_CAPS_VIRTIO_S390 since the latter can never be asserted any more. This preserves what the tests wants to check so that QEMU_CAPS_VIRTIO_S390 can be removed. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 3 +-- 1 file changed, 1 insertion(+

[PATCH 20/22] qemuValidateDomainDeviceDefAddress: Add validation of CCW address

2021-06-11 Thread Peter Krempa
Base the check on the logic from qemuDomainCheckCCWS390AddressSupport, which will be removed later. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 20 ++-- tests/qemuxml2argvtest.c | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_

[PATCH 18/22] qemu: capabilities: Retire QEMU_CAPS_VIRTIO_S390

2021-06-11 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 94f2fad05a..27af11d0b8 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@

[PATCH 11/22] tests: Remove 's390-virtio' machine caps faking

2021-06-11 Thread Peter Krempa
The machine type was removed in qemu 2.6 and no tests now depend on it. Remove the faking of the machine type support and the capabilities test for it. Signed-off-by: Peter Krempa --- tests/testutilsqemu.c | 2 +- tests/vircapstest.c | 4 2 files changed, 1 insertion(+), 5 deletions(-) d

[PATCH 16/22] qemu: Remove last uses of QEMU_CAPS_VIRTIO_S390

2021-06-11 Thread Peter Krempa
Modify the code in the last two instances in the code to behave as if the flag is not asserted. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 10 -- src/qemu/qemu_hotplug.c | 4 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src

[PATCH 21/22] qemuDomainCheckCCWS390AddressSupport: Remove duplicated checker

2021-06-11 Thread Peter Krempa
For validation of explicitly configured addresses we already ported the same style of checks to qemuValidateDomainDeviceDefAddress and implicit address assignment should do the right thing in the first place, thus the function is redundant and can be removed. Signed-off-by: Peter Krempa --- src/

[PATCH 04/22] tests: qemuxml2argv: Modernize 'watchdog-diag288' test

2021-06-11 Thread Peter Krempa
The 's390-virtio' machine was removed from qemu in the 2.6 release. Modernize the test for diag288 since there isn't any other test for it. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/watchdog-diag288.args | 28 --- .../watchdog-diag288.s390x-latest.args| 36 +

[PATCH 09/22] tests: qemuxml2argv: Modernize 's390-allow-bogus-usb-controller' test

2021-06-11 Thread Peter Krempa
The 's390-virtio' machine was removed from qemu in the 2.6 release. Use the more modern s390-ccw-virtio machine type and use VIR_TEST_CAPS_ARCH_LATEST to invoke it. Signed-off-by: Peter Krempa --- .../s390-allow-bogus-usb-controller.args | 31 --- ...low-bogus-usb-controller.s39

[PATCH 01/22] util: command: Introduce virCommandToStringBuf

2021-06-11 Thread Peter Krempa
The new version allows passing a virBuffer to format the string into. This will be helpful in solving a memory lean in wrong usage of virCommandToString and also in tests where we need to add a newline after the command in certain cases. Signed-off-by: Peter Krempa --- src/libvirt_private.syms |

[PATCH 03/22] bhyveConnectDomainXMLToNative: Fix memory leak in incorrect virCommandToString usage

2021-06-11 Thread Peter Krempa
virCommandToString returns an allocated buffer, so using it directly as argument of virBufferAdd which doesn't consume the string causes it to be leaked. Switch to virBufferToStringBuf since we are already using a buffer. Signed-off-by: Peter Krempa --- src/bhyve/bhyve_driver.c | 4 ++-- 1 file

[PATCH 00/22] Fix hotplug of disks with iothreads and s390 cruft cleanup

2021-06-11 Thread Peter Krempa
This series consists of 3 parts: Part 1, patches 1-3: These are fixes to the virCommand->string conversion, namely two bugs: - VIR_TEST_REGENERATE_OUTPUT would produce new files with missing end newline - memleak in bhyves xml->native conversion Part 2, patches 4 - 21: Removal

Re: [libvirt PATCH 5/5] tests: add launch-security-sev test with latest capabilities

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 15:24:13 +0200, Pavel Hrdina wrote: > QEMU 6.0.0 introduced `confidential-guest-support` -machine option as > a replacement for `memory-encryption`. In order to test it use latest > capabilities as well. > > Signed-off-by: Pavel Hrdina > --- > .../launch-security-sev.x86_

Re: [libvirt PATCH 4/5] tests: use newer machine in qemuxml2argv launch-security-sev

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 15:24:12 +0200, Pavel Hrdina wrote: > The pc-1.0 machine type was deprecated in QEMU 6.0.0. In our tests we > use 2.12.0 and 6.1.0 replies so switch to pc-i440fx-2.12 type. > > Signed-off-by: Pavel Hrdina > --- > tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.ar

Re: [libvirt PATCH 2/5] qemu_command: use confidential-guest-support if available

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 15:24:10 +0200, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_command.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Reviewed-by: Peter Krempa

Re: [libvirt PATCH 1/5] qemu_capabilities: detect if confidential-guest-support is available

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 15:24:09 +0200, Pavel Hrdina wrote: > In libvirt we already use `query-command-line-options` QMP command but > that is useless as it doesn't provide correct data for `-machine` > option. So we need a new and better way to get that data. > > We already use `qom-list-properti

Re: [libvirt PATCH 3/5] tests: add AMD SEV bits into qemu-6.1.0 replies

2021-06-11 Thread Peter Krempa
On Fri, Jun 11, 2021 at 15:24:11 +0200, Pavel Hrdina wrote: > Currently we only have AMD SEV bits in qemu-2.12.0 replies which is way > too old to test new features that require AMD SEV as well. > > Signed-off-by: Pavel Hrdina > --- > tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 5 +++

[libvirt PATCH 4/5] tests: use newer machine in qemuxml2argv launch-security-sev

2021-06-11 Thread Pavel Hrdina
The pc-1.0 machine type was deprecated in QEMU 6.0.0. In our tests we use 2.12.0 and 6.1.0 replies so switch to pc-i440fx-2.12 type. Signed-off-by: Pavel Hrdina --- tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.args | 2 +- tests/qemuxml2argvdata/launch-security-sev.xml

[libvirt PATCH 2/5] qemu_command: use confidential-guest-support if available

2021-06-11 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/qemu/qemu_command.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4b676fe8fc..1e75828bfc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6935,8 +6935,1

[libvirt PATCH 3/5] tests: add AMD SEV bits into qemu-6.1.0 replies

2021-06-11 Thread Pavel Hrdina
Currently we only have AMD SEV bits in qemu-2.12.0 replies which is way too old to test new features that require AMD SEV as well. Signed-off-by: Pavel Hrdina --- tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 5 - tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 5 - tes

[libvirt PATCH 5/5] tests: add launch-security-sev test with latest capabilities

2021-06-11 Thread Pavel Hrdina
QEMU 6.0.0 introduced `confidential-guest-support` -machine option as a replacement for `memory-encryption`. In order to test it use latest capabilities as well. Signed-off-by: Pavel Hrdina --- .../launch-security-sev.x86_64-latest.args| 36 +++ tests/qemuxml2argvtest.c

[libvirt PATCH 0/5] use confidential-guest-support if available

2021-06-11 Thread Pavel Hrdina
Pavel Hrdina (5): qemu_capabilities: detect if confidential-guest-support is available qemu_command: use confidential-guest-support if available tests: add AMD SEV bits into qemu-6.1.0 replies tests: use newer machine in qemuxml2argv launch-security-sev tests: add launch-security-sev test

Migration capabilities is not reset after the libvirtd service restart

2021-06-11 Thread Huangzhichao
Hi Everyone, We find migration capabilities is not reset after restarting libvirtd, it would cause problem in the following scene: Version: libvirt release 7.4.0 Step 1. create a VM and query migration capabilities, mark the return content as "Cap A". Step 2. stop the source libvirtd service

[libvirt PATCH] qemu_firmware: select correct firmware for AMD SEV-ES

2021-06-11 Thread Pavel Hrdina
When using firmware auto-selection and user enables AMD SEV-ES we need to pick correct firmware that actually supports it. This can be detected by having `amd-sev-es` in the firmware JSON description. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_firmware.c | 28 1 f

Re: [PATCH v2 0/6] qemu: Adapt to virtio*gl* devices

2021-06-11 Thread Michal Prívozník
On 6/11/21 12:49 PM, Han Han wrote: > On Fri, Jun 11, 2021 at 4:55 PM Michal Prívozník > wrote: > >> On 6/9/21 10:32 AM, Han Han wrote: >>> Diff from v1: >>> - Leave qemuBuildVirtioDevStr() unmodified >>> - New patch: qemu_validate: Validate virtio*gl* devices for 3d >>> accerlation >>> - Use D

Re: [PATCH v2 0/6] qemu: Adapt to virtio*gl* devices

2021-06-11 Thread Han Han
On Fri, Jun 11, 2021 at 4:55 PM Michal Prívozník wrote: > On 6/9/21 10:32 AM, Han Han wrote: > > Diff from v1: > > - Leave qemuBuildVirtioDevStr() unmodified > > - New patch: qemu_validate: Validate virtio*gl* devices for 3d > > accerlation > > - Use DO_TEST_CAPS_LATEST instead of DO_TEST > > -

Re: [PATCH v2 4/6] qemu: Adapt to virtio-gpu-gl-pci device

2021-06-11 Thread Han Han
On Fri, Jun 11, 2021 at 4:55 PM Michal Prívozník wrote: > On 6/9/21 10:32 AM, Han Han wrote: > > QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property > > of virtio-gpu-pci device. Adapt to that change. > > > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356 > > >

Re: [PATCH v2 5/6] qemu: Adapt to virtio-vga-gl device

2021-06-11 Thread Han Han
On Fri, Jun 11, 2021 at 4:55 PM Michal Prívozník wrote: > On 6/9/21 10:32 AM, Han Han wrote: > > QEMU 6.1 will replace the virgl property of virtio-vga device to > > virtio-vga-gl device. Adapt to that update. > > > > Resolves: https://gitlab.com/libvirt/libvirt/-/issues/167 > > > > Signed-off-by

Re: [PATCH v2 0/6] qemu: Adapt to virtio*gl* devices

2021-06-11 Thread Michal Prívozník
On 6/9/21 10:32 AM, Han Han wrote: > Diff from v1: > - Leave qemuBuildVirtioDevStr() unmodified > - New patch: qemu_validate: Validate virtio*gl* devices for 3d > accerlation > - Use DO_TEST_CAPS_LATEST instead of DO_TEST > - Save video-virtio-vga-gpu-gl.x86_64-latest.xml as the sym link of > te

Re: [PATCH v2 4/6] qemu: Adapt to virtio-gpu-gl-pci device

2021-06-11 Thread Michal Prívozník
On 6/9/21 10:32 AM, Han Han wrote: > QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property > of virtio-gpu-pci device. Adapt to that change. > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356 > > Signed-off-by: Han Han > --- > src/qemu/qemu_command.c | 5 +

Re: [PATCH v2 5/6] qemu: Adapt to virtio-vga-gl device

2021-06-11 Thread Michal Prívozník
On 6/9/21 10:32 AM, Han Han wrote: > QEMU 6.1 will replace the virgl property of virtio-vga device to > virtio-vga-gl device. Adapt to that update. > > Resolves: https://gitlab.com/libvirt/libvirt/-/issues/167 > > Signed-off-by: Han Han > --- > src/qemu/qemu_command.c | 3 +++ > 1 file changed,

Re: [libvirt PATCH] cpu_map: Add cpu feature avx-vnni

2021-06-11 Thread Michal Prívozník
On 6/10/21 9:45 AM, Tim Wiederhake wrote: > "avx-vvni" was introduced to qemu in commit > c1826ea6a052084f2e6a0bae9dd5932a727df039, adding it Cooperlake. > > This feature is currently not used by any libvirt CPU models, but its > addition silences a warning from sync_qemu_i386.py: > > ``` > warni