[libvirt PATCH v2 05/15] qemu: add -display dbus support

2021-12-02 Thread marcandre . lureau
From: Marc-André Lureau By default, libvirt will start a private bus and tell QEMU to connect to it. Instead, a D-Bus "address" to connect to can be specified, or the p2p mode enabled. D-Bus display works best with GL & a rendernode, which can be specified with child element. Signed-off-by: Ma

[libvirt PATCH v2 02/15] qemu: add -display dbus capability check (to update to 6.3)

2021-12-02 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.2.0.x86_64.replies | 10 +- tests/qemucapabilitiesdata/caps_6.2.0.x86

[libvirt PATCH v2 04/15] qemu: start the D-Bus daemon for the display

2021-12-02 Thread marcandre . lureau
From: Marc-André Lureau Start the daemon if necessary (it is already stopped in qemuProcessStop) Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index 537b130

[libvirt PATCH v2 01/15] qemu: add chardev-vdagent capability check

2021-12-02 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 + tests

[libvirt PATCH v2 00/15] WIP/RFC: add QEMU "-display dbus" support

2021-12-02 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series implements supports for the upcoming QEMU "-display dbus" support. Development is still in progress, but I hope to land the QEMU support early in 6.3 (last version posted: https://patchew.org/QEMU/20211009210838.2219430-1-marcandre.lur...@redhat.com/). By

Re: [libvirt PATCH v2 12/12] run: detect daemons when run via wrapper commands

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The run script tries to detect when a daemon is being run in order to shutdown other systemd unit files that clash. As implemented this only works if the daemon name is the first argument. This won't be the case if running via GDB or strace eg .

Re: [libvirt PATCH v2 11/12] qemu: mock swtpm initialization in tests

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The domain capabilities won't report TPM support unless SWTPM can be initialized. To avoid relying on the swtpm install in the host, mock the entire initialization method, since all it needs todo is return a non-error value. Signed-off-by: Daniel

Re: [libvirt PATCH v2 10/12] qemu: fill in domain capabilities for TPMs

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: This reports what TPM features QEMU supports, provided that swtpm is installed in the host. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c | 34 +++ src/qemu/qemu_capabilities.h

Re: [libvirt PATCH v2 09/12] conf: add TPM devices to domain capabilities

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: This adds reporting of available TPM models and backends to the domain capabilities schema Signed-off-by: Daniel P. Berrangé --- docs/schemas/domaincaps.rng| 10 ++ src/conf/domain_capabilities.c | 14 ++ src/conf/domain_ca

Re: [libvirt PATCH v2 08/12] util: add a method for checking if swtpm is available

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The QEMU domain capabilities code wants to quietly know whether swtpm is available on the host. Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 + src/util/virtpm.c| 45 +--- src/util

Re: [libvirt PATCH v2 07/12] util: pull TPM capabilities probing out of main init method

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: Many methods merely want to know that the swtpm binaries have been found, and don't care about probing for capabilities. Even when starting a guest, the QEMU driver may not need the capabilities. Skipping probing ensures the VM startup path is as

Re: [libvirt PATCH v2 06/12] util: ensure all TPM global vars access is protected by lock

2021-11-25 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The virTPMEmulatorInit method updates various global variables and holds a lock while doing so. Other methods which access these variables, however, don't reliably hold locks over all of their accesses. Since virTPMEmulatorInit is no longer expor

Re: [libvirt PATCH v2 05/12] util: don't export virTPMEmulatorInit method

2021-11-24 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: Every other exportd API from virtpm.h will internally call *exported virTPMEmulatorInit, so there is no reason for this initializer to be exported on its own. Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 - src/qemu/qemu

Re: [libvirt PATCH v2 04/12] util: replace TPM global variables with a struct array

2021-11-24 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The virTPMEmulatorInit function defines a struct that gets filled with pointers to global variables. It will be simpler to just use the struct for the global variables directly. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 121 +

Re: [libvirt PATCH v2 03/12] util: refactor TPM helper methods to reduce duplicationm

2021-11-24 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: The TPM helper methods for querying the binary path and capabilities have the same patterns across all swtpm binaries. This code duplication can be reduced by introducing helper methods. s/duplicationm/duplication/ in the commit summary Signe

Re: [libvirt PATCH v2 02/12] util: rename typedef for parsing swtpm capabilities

2021-11-24 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: Best practice is to have all types use a naming convention based on the filename. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jan

Re: [libvirt PATCH v2 01/12] util: use consistent naming for swtpm global variables

2021-11-24 Thread Ján Tomko
On a Wednesday in 2021, Daniel P. Berrangé wrote: Use a '_path' suffix on all vars which are paths. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP sig

[libvirt PATCH v2 12/12] run: detect daemons when run via wrapper commands

2021-11-24 Thread Daniel P . Berrangé
The run script tries to detect when a daemon is being run in order to shutdown other systemd unit files that clash. As implemented this only works if the daemon name is the first argument. This won't be the case if running via GDB or strace eg ./run strace -e trace=openat ./build/src/virtqemud

[libvirt PATCH v2 11/12] qemu: mock swtpm initialization in tests

2021-11-24 Thread Daniel P . Berrangé
The domain capabilities won't report TPM support unless SWTPM can be initialized. To avoid relying on the swtpm install in the host, mock the entire initialization method, since all it needs todo is return a non-error value. Signed-off-by: Daniel P. Berrangé --- tests/domaincapsdata/qemu_2.11.0-

[libvirt PATCH v2 07/12] util: pull TPM capabilities probing out of main init method

2021-11-24 Thread Daniel P . Berrangé
Many methods merely want to know that the swtpm binaries have been found, and don't care about probing for capabilities. Even when starting a guest, the QEMU driver may not need the capabilities. Skipping probing ensures the VM startup path is as fast as possible when capabilities are not required

[libvirt PATCH v2 09/12] conf: add TPM devices to domain capabilities

2021-11-24 Thread Daniel P . Berrangé
This adds reporting of available TPM models and backends to the domain capabilities schema Signed-off-by: Daniel P. Berrangé --- docs/schemas/domaincaps.rng| 10 ++ src/conf/domain_capabilities.c | 14 ++ src/conf/domain_capabilities.h | 10 ++ 3 files changed, 34

[libvirt PATCH v2 05/12] util: don't export virTPMEmulatorInit method

2021-11-24 Thread Daniel P . Berrangé
Every other exportd API from virtpm.h will internally call virTPMEmulatorInit, so there is no reason for this initializer to be exported on its own. Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 - src/qemu/qemu_tpm.c | 6 -- src/util/virtpm.c| 4 +++- src/u

[libvirt PATCH v2 10/12] qemu: fill in domain capabilities for TPMs

2021-11-24 Thread Daniel P . Berrangé
This reports what TPM features QEMU supports, provided that swtpm is installed in the host. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c | 34 +++ src/qemu/qemu_capabilities.h | 3 ++ .../domaincapsdata/qemu_2.11.0-q35.x86_

[libvirt PATCH v2 04/12] util: replace TPM global variables with a struct array

2021-11-24 Thread Daniel P . Berrangé
The virTPMEmulatorInit function defines a struct that gets filled with pointers to global variables. It will be simpler to just use the struct for the global variables directly. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 121 ++ 1 file c

[libvirt PATCH v2 08/12] util: add a method for checking if swtpm is available

2021-11-24 Thread Daniel P . Berrangé
The QEMU domain capabilities code wants to quietly know whether swtpm is available on the host. Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 + src/util/virtpm.c| 45 +--- src/util/virtpm.h| 2 ++ 3 files changed, 36 ins

[libvirt PATCH v2 03/12] util: refactor TPM helper methods to reduce duplicationm

2021-11-24 Thread Daniel P . Berrangé
The TPM helper methods for querying the binary path and capabilities have the same patterns across all swtpm binaries. This code duplication can be reduced by introducing helper methods. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 53 ---

[libvirt PATCH v2 06/12] util: ensure all TPM global vars access is protected by lock

2021-11-24 Thread Daniel P . Berrangé
The virTPMEmulatorInit method updates various global variables and holds a lock while doing so. Other methods which access these variables, however, don't reliably hold locks over all of their accesses. Since virTPMEmulatorInit is no longer exported, we can push the locking up into all the callers

[libvirt PATCH v2 02/12] util: rename typedef for parsing swtpm capabilities

2021-11-24 Thread Daniel P . Berrangé
Best practice is to have all types use a naming convention based on the filename. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index d5d80aa9dc..1a34f8ce56

[libvirt PATCH v2 01/12] util: use consistent naming for swtpm global variables

2021-11-24 Thread Daniel P . Berrangé
Use a '_path' suffix on all vars which are paths. Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 2c0dd707b0..d5d80aa9dc 100644 --- a/src/util/virtpm.c +++ b/s

[libvirt PATCH v2 00/12] Expose TPM availability in domain capabilities

2021-11-24 Thread Daniel P . Berrangé
If we can report whuether TPM is available, then mgmt apps can enable it by default for new VMs. This is important because OS like Win11 consider TPM to be mandatory. In v2: - Avoid triggering reporting of errors when querying caps - Only skip reporting of emulator backend when swtpm is m

[libvirt PATCH v2 0/1] Ignore EPERM on attempts to clear a VF VLAN ID

2021-11-10 Thread Dmitrii Shcherbakov
SmartNIC DPUs may not expose some privileged eswitch operations to the hypervisor hosts. For example, this happens with Bluefield devices running in the ECPF (default) mode [1] for security reasons. While VF MAC address programming is possible via an RTM_SETLINK operation, trying to set a VLAN ID i

[libvirt PATCH v2 1/1] Ignore EPERM on attempts to clear VF VLAN ID

2021-11-10 Thread Dmitrii Shcherbakov
SmartNIC DPUs may not expose some privileged eswitch operations to the hypervisor hosts. For example, this happens with Bluefield devices running in the ECPF (default) mode for security reasons. While VF MAC address programming is possible via an RTM_SETLINK operation, trying to set a VLAN ID in th

Re: [libvirt PATCH v2 07/20] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-11-05 Thread Tim Wiederhake
On Fri, 2021-11-05 at 16:30 +0100, Michal Prívozník wrote: > On 11/4/21 5:27 PM, Tim Wiederhake wrote: > > Signed-off-by: Tim Wiederhake > > --- > >  src/cpu/cpu_x86.c | 69 > > +++ > >  1 file changed, 69 insertions(+) > > > > diff --git a/src/cpu/cpu_x

Re: [libvirt PATCH v2 01/20] cpu_x86: Simplify x86ParseCPUID

2021-11-05 Thread Tim Wiederhake
On Fri, 2021-11-05 at 16:30 +0100, Michal Prívozník wrote: > On 11/4/21 5:27 PM, Tim Wiederhake wrote: > > ... by using virXMLProp*() helpers. These only require a xmlNodePtr > > and > > do not need a xmlXPathContextPtr. Reflect that in the function > > signature. > > > > Signed-off-by: Tim Wieder

Re: [libvirt PATCH v2 00/20] Invalidate the cpu flags cache on host cpuid mismatch

2021-11-05 Thread Michal Prívozník
On 11/4/21 5:27 PM, Tim Wiederhake wrote: > Many things can affect the availability of cpu features (e.g. software > upgrades, kernel versions, kernel command line, etc.) and invalidate the > cached capabilities without notice. Add CPUID information to the > capabilities cache. > > Fixes https://b

Re: [libvirt PATCH v2 07/20] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-11-05 Thread Michal Prívozník
On 11/4/21 5:27 PM, Tim Wiederhake wrote: > Signed-off-by: Tim Wiederhake > --- > src/cpu/cpu_x86.c | 69 +++ > 1 file changed, 69 insertions(+) > > diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c > index a08ac225ef..5ce193e693 100644 > --- a/src/cp

Re: [libvirt PATCH v2 01/20] cpu_x86: Simplify x86ParseCPUID

2021-11-05 Thread Michal Prívozník
On 11/4/21 5:27 PM, Tim Wiederhake wrote: > ... by using virXMLProp*() helpers. These only require a xmlNodePtr and > do not need a xmlXPathContextPtr. Reflect that in the function signature. > > Signed-off-by: Tim Wiederhake > --- > src/cpu/cpu_x86.c | 43 +--

[libvirt PATCH v2 15/20] virhostcpu: Add virHostCPUGetCPUID

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/libvirt_private.syms | 1 + src/util/virhostcpu.c| 43 src/util/virhostcpu.h| 2 ++ 3 files changed, 46 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 665db255a6..e92670

[libvirt PATCH v2 11/20] cpu: Add virCPUDataNewCopy

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 21 + src/cpu/cpu.h| 7 +++ src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 0c1c7902f0..b5669246b4 100644 --- a/src/cpu/cpu.c +++

[libvirt PATCH v2 09/20] cpu_arm: Implement virCPUDataIsIdentical for arm

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index ac174891b7..c9114d53bf 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -124,6 +124,32 @@ virCPUarmDataClear(vi

[libvirt PATCH v2 08/20] cpu_arm: No need to protect macro definitions

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 09ade1d422..ac174891b7 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -39,12 +39,11 @@ #include "virxml.h" #def

[libvirt PATCH v2 07/20] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 69 +++ 1 file changed, 69 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index a08ac225ef..5ce193e693 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3332,6 +3332,74 @@

[libvirt PATCH v2 05/20] cpu: Split up virCPUDataParse

2021-11-04 Thread Tim Wiederhake
This makes it possible to call virCPUDataParse with a xmlNodePtr, which will be required by a later patch. Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 29 + src/cpu/cpu.h| 2 ++ src/libvirt_private.syms | 1 + 3 files changed, 24 inserti

[libvirt PATCH v2 06/20] cpu: Add virCPUDataIsIdentical

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 28 src/cpu/cpu.h| 9 + src/libvirt_private.syms | 1 + 3 files changed, 38 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b97d06c7d8..0c1c7902f0 100644 --- a/src/cpu/c

[libvirt PATCH v2 04/20] cpu: Change virCPUArchDataParse to take xmlNodePtr

2021-11-04 Thread Tim Wiederhake
The function does not need a full xmlXPathContextPtr any longer and a later patch will require a call to this function with only a xmlNodePtr available. Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c | 2 +- src/cpu/cpu.h | 2 +- src/cpu/cpu_x86.c | 4 ++-- 3 files changed, 4 insertions

[libvirt PATCH v2 02/20] cpu_x86: Simplify x86ParseMSR

2021-11-04 Thread Tim Wiederhake
... by using virXMLProp*() helpers. These only require a xmlNodePtr and do not need a xmlXPathContextPtr. Reflect that in the function signature. Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/s

[libvirt PATCH v2 00/20] Invalidate the cpu flags cache on host cpuid mismatch

2021-11-04 Thread Tim Wiederhake
Many things can affect the availability of cpu features (e.g. software upgrades, kernel versions, kernel command line, etc.) and invalidate the cached capabilities without notice. Add CPUID information to the capabilities cache. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1953389. V1: https

[libvirt PATCH v2 20/20] qemu: Invalidate capabilities cache on host cpuid mismatch

2021-11-04 Thread Tim Wiederhake
See https://bugzilla.redhat.com/show_bug.cgi?id=1953389. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 15 --- src/qemu/qemu_capspriv.h | 3 ++- tests/qemucapsprobe.c| 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu

[libvirt PATCH v2 18/20] virQEMUCaps: Add host cpuid information

2021-11-04 Thread Tim Wiederhake
Many things can affect the availability of cpu flags (e.g. software upgrades, kernel versions, kernel command line, etc.) and invalidate the cached capabilities without notice. Add CPUID information to the capabilities cache. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 16 ++

[libvirt PATCH v2 16/20] cpu_x86: Add virCPUDataGetHost

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 19 +++ src/cpu/cpu.h| 7 +++ src/libvirt_private.syms | 1 + 3 files changed, 27 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b5669246b4..285c7eee44 100644 --- a/src/cpu/cpu.c +++ b/

[libvirt PATCH v2 19/20] virQEMUCapsCachePriv: Add host cpuid information

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b2d5242264..5fa3111201 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4023,6 +

[libvirt PATCH v2 17/20] cpu_x86: Implement virCPUDataGetHost for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 40 1 file changed, 40 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 0dc9a7d9fb..a72eae07dd 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -20,6 +20,9 @@ #include

[libvirt PATCH v2 12/20] cpu_x86: Implement virCPUDataNewCopy for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 5ce193e693..0dc9a7d9fb 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -481,6 +481,23 @@ virCPUx86DataClear(virCPUx86Da

[libvirt PATCH v2 01/20] cpu_x86: Simplify x86ParseCPUID

2021-11-04 Thread Tim Wiederhake
... by using virXMLProp*() helpers. These only require a xmlNodePtr and do not need a xmlXPathContextPtr. Reflect that in the function signature. Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-

[libvirt PATCH v2 13/20] cpu_arm: Implement virCPUDataNewCopy for arm

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 20 1 file changed, 20 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index c9114d53bf..51a3c1f3ee 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -150,6 +150,25 @@ virCPUarmDataIsIdentical(con

[libvirt PATCH v2 14/20] cpu_ppc64: Implement virCPUDataNewCopy for ppc64

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_ppc64.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index fcd68c8a7c..c7caaa9608 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -603,6 +603,23 @@ virCPUppc64DataIsIde

[libvirt PATCH v2 10/20] cpu_ppc64: Implement virCPUDataIsIdentical for ppc64

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_ppc64.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 4909f61ff1..fcd68c8a7c 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -578,6 +578,31 @@ ppc64DriverD

[libvirt PATCH v2 03/20] cpu_x86: Add x86ParseDataItemList

2021-11-04 Thread Tim Wiederhake
Factor out duplicated code from x86FeatureParse and virCPUx86DataParse. This also consolidates error messages. Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 106 ++ 1 file changed, 41 insertions(+), 65 deletions(-) diff --git a/src/cpu/cpu_x86

Re: [libvirt PATCH v2 0/3] PCI VPD: Handle More Edge Cases

2021-10-31 Thread Daniel Henrique Barboza
On 10/29/21 15:57, Dmitrii Shcherbakov wrote: This patch set improves edge case testing: * The parser is now more strict about checking boundary conditions when parsing fields: an invalid field length is a possibility which is now being accounted for; * The parser will now make sur

[libvirt PATCH v2 0/3] PCI VPD: Handle More Edge Cases

2021-10-29 Thread Dmitrii Shcherbakov
This patch set improves edge case testing: * The parser is now more strict about checking boundary conditions when parsing fields: an invalid field length is a possibility which is now being accounted for; * The parser will now make sure that RV and RW fields are the last in their sect

[libvirt PATCH v2 2/3] PCI VPD: Skip fields with invalid values

2021-10-29 Thread Dmitrii Shcherbakov
While invalid values need to be ignored when presenting VPD data to the user, it would be good to attempt to parse a valid portion of the VPD instead of marking it invalid as a whole. Based on a mailing list discussion, the set of accepted characters is extended to the set of printable ASCII chara

[libvirt PATCH v2 3/3] PCI VPD: Fix a wrong return code in a test case

2021-10-29 Thread Dmitrii Shcherbakov
The test case should return -1, not 0 in case a valid resource could not be parsed successfully but the ret value is initialized to 0. Signed-off-by: Dmitrii Shcherbakov --- tests/virpcivpdtest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/virpcivpdtest.c b/tes

[libvirt PATCH v2 1/3] PCI VPD: handle additional edge cases

2021-10-29 Thread Dmitrii Shcherbakov
* RV and RW fields must be at the last position in their respective section (per the conditions in the spec). Therefore, the parser now stops iterating over fields as soon as it encounters one of those fields and checks whether the end of the resource has been reached; * The lack of the RW fi

Re: [libvirt PATCH v2 00/22] qemu: Implement virtio-iommu support

2021-10-20 Thread Andrea Bolognani
On Wed, Oct 20, 2021 at 03:44:48PM +0200, Ján Tomko wrote: > On a Wednesday in 2021, Andrea Bolognani wrote: > > tests: Add replies for QEMU 6.2.0 on aarch64 > > conf: Make virDomainDeviceInfoFormat() const correct > > qemu: Make qemuBuildDeviceAddressProps() const correct > > qemu: Make qemuBu

Re: [libvirt PATCH v2 00/22] qemu: Implement virtio-iommu support

2021-10-20 Thread Ján Tomko
On a Wednesday in 2021, Andrea Bolognani wrote: The first patch adds QEMU replies and as such has been aggressively snipped to deal with mailing list message size limits. Grab the unabriged version with $ git fetch https://gitlab.com/abologna/libvirt.git virtio-iommu As noted in patch 10, the

[libvirt PATCH v2 16/22] conf: Add virDomainDeviceInfo to virDomainIOMMUDef

2021-10-20 Thread Andrea Bolognani
This is needed so that IOMMU devices can have addresses. Existing IOMMU devices (intel-iommu and SMMUv3) are system devices and as such don't have an address associated to them, but virtio-iommu is a PCI device and needs one. Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng | 6

[libvirt PATCH v2 17/22] qemu: Assign PCI address to virtio-iommu

2021-10-20 Thread Andrea Bolognani
The device is configured to be an integrated endpoint, as is necessary for it to function correctly. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain_address.c | 6 +- .../virtio-iommu-aarch64.aarch64-latest.xml | 4 +++- .../virtio-iommu-

[libvirt PATCH v2 07/22] conf: Introduce VIR_PCI_CONNECT_INTEGRATED

2021-10-20 Thread Andrea Bolognani
This new flag can be used to convince the PCI address assignment algorithm to place a device directly on the root bus. It will be used to implement support for virtio-iommu, which needs to be an integrated device in order to work correctly. Signed-off-by: Andrea Bolognani --- src/conf/domain_add

[libvirt PATCH v2 15/22] qemu: Validate use of ACPI with virtio-iommu

2021-10-20 Thread Andrea Bolognani
virtio-iommu doesn't work without ACPI, so we need to make sure the latter is enabled. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 6 ++ .../virtio-iommu-no-acpi.x86_64-latest.err| 1 + tests/qemuxml2argvdata/virtio-iommu-no-acpi.xml |

[libvirt PATCH v2 08/22] qemu: Tweak some code

2021-10-20 Thread Andrea Bolognani
The altered code is functionally equivalent to the previous one, but it's already laid down in a way that will make further changes easier and less messy. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c| 18 +- src/qemu/qemu_domain_address.c | 23 +

[libvirt PATCH v2 21/22] docs: Document virtio-iommu

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/formatdomain.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 9bf59936e5..ed9fc735a5 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7986,8 +7986,9 @@ Exampl

[libvirt PATCH v2 22/22] news: Document virtio-iommu

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index f3b9e5f0cb..07971a6c42 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -40,6 +40,10 @@ v7.9.0 (unreleased) domain definition when the guest was first started).This setting i

[libvirt PATCH v2 20/22] qemu: Generate command line for virtio-iommu

2021-10-20 Thread Andrea Bolognani
https://bugzilla.redhat.com/show_bug.cgi?id=1653327 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 12 +++- .../virtio-iommu-aarch64.aarch64-latest.args | 1 + .../virtio-iommu-x86_64.x86_64-latest.args | 1 + 3 files change

[libvirt PATCH v2 12/22] tests: Add test cases for virtio-iommu

2021-10-20 Thread Andrea Bolognani
These represent valid uses of the device. Signed-off-by: Andrea Bolognani --- .../virtio-iommu-aarch64.aarch64-latest.args | 34 +++ .../qemuxml2argvdata/virtio-iommu-aarch64.xml | 20 +++ .../virtio-iommu-x86_64.x86_64-latest.args| 30 .../qemuxml2a

[libvirt PATCH v2 19/22] tests: Add test for virtio-iommu address

2021-10-20 Thread Andrea Bolognani
virtio-iommu needs to be an integrated device, and our address assignment code will make sure that is the case. If the user has provided an explicit address, however, we should make sure any addresses pointing to a different bus are rejected. Signed-off-by: Andrea Bolognani --- ...io-iommu-inval

[libvirt PATCH v2 18/22] qemu: Validate address type for virtio-iommu

2021-10-20 Thread Andrea Bolognani
virtio-iommu is a PCI device and attempts to use a different address type should be rejected. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 7 +++ ...mmu-invalid-address-type.x86_64-latest.err | 1 + .../virtio-iommu-invalid-address-type.xml | 20 +

[libvirt PATCH v2 14/22] qemu: Validate capabilities for virtio-iommu

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 8 .../qemuxml2argvdata/virtio-iommu-x86_64.x86_64-6.1.0.err | 1 + tests/qemuxml2argvtest.c | 1 + 3 files changed, 10 insertions(+) create mode 100644 tests

[libvirt PATCH v2 06/22] conf: Add new/free functions for virDomainIOMMUDef

2021-10-20 Thread Andrea Bolognani
This will make it possible to limit changes to a single spot later on, and is also just an overall nicer way to create and destroy objects. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 29 + src/conf/domain_conf.h | 3 +++ 2 files changed, 28 insertio

[libvirt PATCH v2 13/22] qemu: Validate machine type used with virtio-iommu

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 8 ...irtio-iommu-wrong-machine.x86_64-latest.err | 1 + .../virtio-iommu-wrong-machine.xml | 18 ++ tests/qemuxml2argvtest.c | 1 + 4 files changed,

[libvirt PATCH v2 11/22] conf: Introduce virtio model for

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c| 4 src/qemu/qemu_domain_address.c | 6 ++ src/qemu/qemu_validate.c | 3 +++ 6 files changed, 16 ins

[libvirt PATCH v2 10/22] DONOTMERGEYET: qemu: Introduce QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS

2021-10-20 Thread Andrea Bolognani
This capability detects the availability of the boot-bypass property of the virtio-iommu-pci device. This property was only introduced in QEMU 6.2 but, since the device has been around for much longer, we end up querying its properties for several more releases. As I don't have convenient access t

[libvirt PATCH v2 04/22] qemu: Make qemuBuildVirtioDevProps() const correct

2021-10-20 Thread Andrea Bolognani
This involves a bit of a hack, but is overall preferable to forcing callers to pass non-const devdata as argument. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qem

[libvirt PATCH v2 09/22] qemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI

2021-10-20 Thread Andrea Bolognani
This capability detects the availability of the virtio-iommu-pci device. Note that, while this device is present even in somewhat old versions of QEMU, it's only some recent changes that made it actually usable for our purposes. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c

[libvirt PATCH v2 05/22] conf: Add IOMMU support to virDomainDeviceDefCopy()

2021-10-20 Thread Andrea Bolognani
There doesn't seem to be a reason for IOMMUs not to be handled by this function. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a3f0a27058..0618343b79 100644

[libvirt PATCH v2 02/22] conf: Make virDomainDeviceInfoFormat() const correct

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/conf/domain_addr.c | 4 ++-- src/conf/domain_addr.h | 4 ++-- src/conf/domain_conf.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 53b39923e8..fe6520cf3a 100644 --- a/src/conf/do

[libvirt PATCH v2 00/22] qemu: Implement virtio-iommu support

2021-10-20 Thread Andrea Bolognani
The first patch adds QEMU replies and as such has been aggressively snipped to deal with mailing list message size limits. Grab the unabriged version with $ git fetch https://gitlab.com/abologna/libvirt.git virtio-iommu As noted in patch 10, the QEMU feature this series enables has not yet bee

[libvirt PATCH v2 03/22] qemu: Make qemuBuildDeviceAddressProps() const correct

2021-10-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1084f5acc7..035943fa96 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -359,7 +359,7

[libvirt PATCH v2 01/22] tests: Add replies for QEMU 6.2.0 on aarch64

2021-10-20 Thread Andrea Bolognani
These were generated using a QEMU binary built from commit v6.1.0-1552-g362534a643 Notably, this causes the arguments of -device to be generated in JSON format. Signed-off-by: Andrea Bolognani --- .../qemu_6.2.0-virt.aarch64.xml | 184 + tests/domaincapsdata/qemu_6.2.0.aarch64.x

Re: [libvirt PATCH v2 1/2] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-07 Thread Daniel P . Berrangé
On Thu, Oct 07, 2021 at 12:36:14PM +0200, Jiri Denemark wrote: > On Thu, Oct 07, 2021 at 11:09:19 +0100, Daniel P. Berrangé wrote: > > On Thu, Oct 07, 2021 at 11:53:00AM +0200, Jiri Denemark wrote: > > > On Thu, Oct 07, 2021 at 10:05:12 +0100, Daniel P. Berrangé wrote: > > > > The -cpu arg gained s

Re: [libvirt PATCH v2 1/2] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-07 Thread Jiri Denemark
On Thu, Oct 07, 2021 at 11:09:19 +0100, Daniel P. Berrangé wrote: > On Thu, Oct 07, 2021 at 11:53:00AM +0200, Jiri Denemark wrote: > > On Thu, Oct 07, 2021 at 10:05:12 +0100, Daniel P. Berrangé wrote: > > > The -cpu arg gained support for feature=on|off syntax for the x86 > > > emulator in 2.4.0 >

Re: [libvirt PATCH v2 1/2] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-07 Thread Daniel P . Berrangé
On Thu, Oct 07, 2021 at 11:53:00AM +0200, Jiri Denemark wrote: > On Thu, Oct 07, 2021 at 10:05:12 +0100, Daniel P. Berrangé wrote: > > The -cpu arg gained support for feature=on|off syntax for the x86 > > emulator in 2.4.0 > > > > commit 38e5c119c2925812bd441450ab9e5e00fc79e662 > > Author: Edu

Re: [libvirt PATCH v2 1/2] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-07 Thread Jiri Denemark
On Thu, Oct 07, 2021 at 10:05:12 +0100, Daniel P. Berrangé wrote: > The -cpu arg gained support for feature=on|off syntax for the x86 > emulator in 2.4.0 > > commit 38e5c119c2925812bd441450ab9e5e00fc79e662 > Author: Eduardo Habkost > Date: Mon Mar 23 17:29:32 2015 -0300 > > target-i3

[libvirt PATCH v2 2/2] qemu: remove use of implicit boolean syntax for -cpu features

2021-10-07 Thread Daniel P . Berrangé
Some CPU features are still added using implicit syntax "feature" which is a deprecated shorthand for "feature=on". Reviewed-by: Peter Krempa Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_command.c | 6 +++--- tests/qemuxml2argvdata/clock-timer-hyperv-r

[libvirt PATCH v2 0/2] qemu: changes to use feature=on|off syntax for -cpu unconditionally

2021-10-07 Thread Daniel P . Berrangé
Given our min QEMU, it doesn't seem like we need to support either the old "-feature" / "+feature" syntax, nor the bare "feature" syntax. v2: - Now with cpu name compatibility retained Daniel P. Berrangé (2): qemu: remove use of (+|-)name syntax for -cpu featres qemu: remove use of implici

[libvirt PATCH v2 1/2] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-07 Thread Daniel P . Berrangé
The -cpu arg gained support for feature=on|off syntax for the x86 emulator in 2.4.0 commit 38e5c119c2925812bd441450ab9e5e00fc79e662 Author: Eduardo Habkost Date: Mon Mar 23 17:29:32 2015 -0300 target-i386: Register QOM properties for feature flags Most other targets gained this synt

Re: [libvirt PATCH v2] news: mention new nodedev API

2021-09-15 Thread Erik Skultety
On Wed, Sep 15, 2021 at 08:21:13AM -0500, Jonathon Jongsma wrote: > Add news item about the new API for node devices. > > Signed-off-by: Jonathon Jongsma > --- > NEWS.rst | 12 > 1 file changed, 12 insertions(+) > > diff --git a/NEWS.rst b/NEWS.rst > index 4521499db7..fd20e50d18 10

[libvirt PATCH v2] news: mention new nodedev API

2021-09-15 Thread Jonathon Jongsma
Add news item about the new API for node devices. Signed-off-by: Jonathon Jongsma --- NEWS.rst | 12 1 file changed, 12 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 4521499db7..fd20e50d18 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,18 @@ v7.8.0 (unreleased) * **New

Re: [libvirt PATCH v2 01/12] glibcompat: Add G_GNUC_UNUSED to g_auto* definitions for clang

2021-09-14 Thread Daniel P . Berrangé
On Tue, Sep 14, 2021 at 03:28:12PM +0200, Tim Wiederhake wrote: > > Adding G_GNUC_UNUSED at the usage sites (of which there will be a > couple hundred), will disable unused variable detection irregardless of > used compiler, just to work around a bug in one single compiler. AFAIK, there is /no/ u

Re: [libvirt PATCH v2 01/12] glibcompat: Add G_GNUC_UNUSED to g_auto* definitions for clang

2021-09-14 Thread Daniel P . Berrangé
On Tue, Sep 14, 2021 at 03:28:06PM +0200, Tim Wiederhake wrote: > On Fri, 2021-09-10 at 14:35 +0200, Ján Tomko wrote: > > On a Friday in 2021, Tim Wiederhake wrote: > > > Workaround for a bug in clang. Clang emits an unused-variable warning > > > if the variable is only accessed on scope exit by a

Re: [libvirt PATCH v2 01/12] glibcompat: Add G_GNUC_UNUSED to g_auto* definitions for clang

2021-09-14 Thread Tim Wiederhake
On Fri, 2021-09-10 at 14:35 +0200, Ján Tomko wrote: > On a Friday in 2021, Tim Wiederhake wrote: > > Workaround for a bug in clang. Clang emits an unused-variable warning > > if the variable is only accessed on scope exit by a destructor > > function. > > Note that gcc does not exhibit this behavio

<    5   6   7   8   9   10   11   12   13   14   >