Re: [PATCH] qemu: add support for qemu switchover-ack

2024-06-20 Thread Peter Xu
On Thu, Jun 20, 2024 at 07:45:42PM +, Jon Kohler wrote: > > > > On Jun 20, 2024, at 4:30 AM, Jiri Denemark wrote: > > > > !---| > > CAUTION: External Email > > > > |

Re: [PATCH v2 09/14] include/hw: temporarily disable deletion of versioned machine types

2024-06-20 Thread Thomas Huth
On 20/06/2024 18.57, Daniel P. Berrangé wrote: The new deprecation and deletion policy for versioned machine types is being introduced in QEMU 9.1.0. Under the new policy a number of old machine types (any prior to 2.12) would be liable for immediate deletion which would be a violation of our hi

[PATCH v2 14/14] docs: document special exception for machine type deprecation & removal

2024-06-20 Thread Daniel P . Berrangé
This extends the deprecation policy to indicate that versioned machine types will be marked deprecated after 3 years, and then subject to removal after a further 3 years has passed. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- docs/about/deprecated.rst | 13 + 1 fi

[PATCH v2 13/14] hw/i386: remove obsolete manual deprecation reason string of i440fx machines

2024-06-20 Thread Daniel P . Berrangé
The automatic deprecation mechanism introduced in the preceeding patches will mark every i440fx machine upto and including 2.12 as deprecated. As such we can revert the manually added deprecation introduced in: commit 792b4fdd4eb8197bd6eb9e80a1dfaf0cb3b54aeb Author: Philippe Mathieu-Daudé D

[PATCH v2 12/14] hw/ppc: remove obsolete manual deprecation reason string of spapr machines

2024-06-20 Thread Daniel P . Berrangé
The automatic deprecation mechanism introduced in the preceeding patches will mark every spapr machine upto and including 2.12 as deprecated. As such we can revert the manually added deprecation which was a subset: commit 1392617d35765d5d912625fbb5cab1ffbed8e140 Author: Cédric Le Goater Dat

[PATCH v2 11/14] hw: skip registration of outdated versioned machine types

2024-06-20 Thread Daniel P . Berrangé
This calls the MACHINE_VER_DELETION() macro in the machine type registration method, so that when a versioned machine type reaches the end of its life, it is no longer registered with QOM and thus cannot be used. The actual definition of the machine type should be deleted at this point, but experi

[PATCH v2 10/14] hw: set deprecation info for all versioned machine types

2024-06-20 Thread Daniel P . Berrangé
This calls the MACHINE_VER_DEPRECATION() macro in the definition of all machine type classes which support versioning. This ensures that they will automatically get deprecation info set when they reach the appropriate point in their lifecycle. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Ber

[PATCH v2 09/14] include/hw: temporarily disable deletion of versioned machine types

2024-06-20 Thread Daniel P . Berrangé
The new deprecation and deletion policy for versioned machine types is being introduced in QEMU 9.1.0. Under the new policy a number of old machine types (any prior to 2.12) would be liable for immediate deletion which would be a violation of our historical deprecation and removal policy Thus aut

[PATCH v2 08/14] include/hw: add macros for deprecation & removal of versioned machines

2024-06-20 Thread Daniel P . Berrangé
Versioned machines live for a long time to provide back compat for incoming migration and restore of saved images. To guide users away from usage of old machines, however, we want to deprecate any older than 3 years (equiv of 9 releases), and delete any older than 6 years (equiva of 18 releases).

[PATCH v2 07/14] hw/i386: convert 'q35' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_Q35_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number thrice in three different formats in the calls to DEFINE_Q

[PATCH v2 06/14] hw/i386: convert 'i440fx' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_I440FX_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number thrice in three different formats in the calls to DEFIN

[PATCH v2 05/14] hw/m68k: convert 'virt' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_VIRT_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. A DEFINE_VIRT_MACHINE_AS_LATEST helper is added so that it is not required to pass 'false' for every single historical machine type

[PATCH v2 04/14] hw/ppc: convert 'spapr' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_SPAPR_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number twice in two different formats in the calls to DEFINE_SP

[PATCH v2 03/14] hw/s390x: convert 'ccw' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_CCW_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number twice in two different formats in the calls to DEFINE_CCW_

[PATCH v2 02/14] hw/arm: convert 'virt' machine definitions to use new macros

2024-06-20 Thread Daniel P . Berrangé
This changes the DEFINE_VIRT_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- hw/arm/virt.c | 28 +++- 1 file changed,

[PATCH v2 01/14] include/hw: add helpers for defining versioned machine types

2024-06-20 Thread Daniel P . Berrangé
The various targets which define versioned machine types have a bunch of obfuscated macro code for defining unique function and variable names using string concatenation. This adds a couple of helpers to improve the clarity of such code macro. Reviewed-by: Thomas Huth Reviewed-by: Eric Blake Si

[PATCH v2 00/14] hw: define and enforce a standard lifecycle for versioned machines

2024-06-20 Thread Daniel P . Berrangé
Thomas proposed a new deprecation and removal policy for versioned machine types that would see them liable for deletion after 6 years: https://lists.nongnu.org/archive/html/qemu-devel/2024-04/msg04683.html This suggest was met with broad approval, however, I suggested that we could take it fur

Re: [PATCH 00/12] Introduce SEV-SNP support

2024-06-20 Thread Jonathon Jongsma
On 6/20/24 6:22 AM, Michal Privoznik wrote: SEV-SNP support just landed in QEMU. Here is the first round of patches to incorporate support into libvirt. TODOs (aka problems of future me): - Teach tools/virt-qemu-sev-validate how to deal with SEV-SNP - Try to find a SEV-SNP machine a test these

Re: [PATCH 12/12] qemu_firmware: Pick the right firmware for SEV-SNP guests

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:49PM +0200, Michal Privoznik wrote: > The firmware descriptors have 'amd-sev-snp` feature which > describes whether firmware is suitable for SEV-SNP guests. > Provide necessary implementation to detect the feature and pick > the right firmware if guest is SEV-SNP enabl

Re: [PATCH 11/12] qemu: Allow setting launch security for SEV-SNP

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:48PM +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_driver.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index fc1704f4fc..3a76df8ddb 100644 >

Re: [PATCH 10/12] qemu: Build cmd line for SEV-SNP

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:47PM +0200, Michal Privoznik wrote: > Pretty straightforward as qemu has 'sev-snp-guest' object which > attributes maps pretty much 1:1 to our XML model. Except for > @vcek where QEMU has 'vcek-disabled`, an inverted boolean, while > we model it as virTristateBool. But

Re: [PATCH 09/12] conf: Introduce SEV-SNP support

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:46PM +0200, Michal Privoznik wrote: > SEV-SNP is an enhancement of SEV/SEV-ES and thus it shares some > fields with it. Nevertheless, on XML level, it's yet another type > of . > > Signed-off-by: Michal Privoznik > --- > docs/formatdomain.rst

Re: [PATCH 08/12] qemu_capabilities: Introduce QEMU_CAPS_SEV_SNP_GUEST

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:45PM +0200, Michal Privoznik wrote: > This capability tracks sev-snp-guest object availability. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_capabilities.c | 4 > src/qemu/qemu_capabilities.h | 3 +++ > tests

Re: [PATCH 07/12] qemu: Report snp-policy in virDomainGetLaunchSecurityInfo()

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:44PM +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > include/libvirt/libvirt-domain.h | 10 ++ > src/qemu/qemu_driver.c | 6 ++ > 2 files changed, 16 insertions(+) Reviewed-by: Daniel P. Berrangé With regards, Danie

Re: [PATCH 06/12] qemu_monitor: Allow querying SEV-SNP state in 'query-sev'

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:43PM +0200, Michal Privoznik wrote: > In QEMU commit v9.0.0-1155-g59d3740cb4 the return type of > 'query-sev' monitor command changed to accommodate SEV-SNP. Even > though we currently support launching plain SNP guests, this will > soon change. > > Signed-off-by: Mic

Re: [PATCH 05/12] src: Convert some _virDomainSecDef::sectype checks to switch()

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:42PM +0200, Michal Privoznik wrote: > In a few instances there is a plain if() check for > _virDomainSecDef::sectype. While this works perfectly for now, > soon there'll be another type and we can utilize compiler to > identify all the places that need adaptation. Swit

Re: [PATCH 04/12] Drop needless typecast to virDomainLaunchSecurity

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:41PM +0200, Michal Privoznik wrote: > The sectype member of _virDomainSecDef struct is already declared > as of virDomainLaunchSecurity type. There's no need to typecast > it to the very same type when passing it to switch(). > > Signed-off-by: Michal Privoznik > ---

Re: [PATCH 03/12] conf: Separate SEV formatting into a function

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:40PM +0200, Michal Privoznik wrote: > To avoid convolution of switch() inside of virDomainSecDefFormat() even > more (as new sectypes are added), move formatting into a separate > function. > > Signed-off-by: Michal Privoznik > --- > src/conf/domain_conf.c | 26

Re: [PATCH 02/12] conf: Move some members of virDomainSEVDef into virDomainSEVCommonDef

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:39PM +0200, Michal Privoznik wrote: > Some parts of SEV are to be shared with SEV SNP. In order to > reuse XML parsing / formatting code cleanly, let's move those > common bits into a new struct (virDomainSEVCommonDef) and adjust > rest of the code. > > Signed-off-by:

Re: [PATCH 01/12] qemu_monitor_json: Report error in error paths in SEV related code

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:38PM +0200, Michal Privoznik wrote: > While working on qemuMonitorJSONGetSEVMeasurement() and > qemuMonitorJSONGetSEVInfo() I've noticed that if these functions > fail, they do so without appropriate error set. Fill in error > reporting. > > Signed-off-by: Michal Priv

Re: [PATCH 00/12] Introduce SEV-SNP support

2024-06-20 Thread Daniel P . Berrangé
On Thu, Jun 20, 2024 at 01:22:37PM +0200, Michal Privoznik wrote: > SEV-SNP support just landed in QEMU. Here is the first round of patches > to incorporate support into libvirt. > > TODOs (aka problems of future me): > > - Teach tools/virt-qemu-sev-validate how to deal with SEV-SNP There's noth

Re: [PATCH] vmx: Accept more serial variations

2024-06-20 Thread Richard W.M. Jones
On Mon, Jun 17, 2024 at 09:36:04AM +0200, Martin Kletzander wrote: > Commit 23c47944882b added parsing of serial ports connected to vspc, but > the VM can also have a network serial port with an empty filename or no > filename at all. Parse these the same way, as a . > > Resolves: https://issues.

[PATCH 12/12] qemu_firmware: Pick the right firmware for SEV-SNP guests

2024-06-20 Thread Michal Privoznik
The firmware descriptors have 'amd-sev-snp` feature which describes whether firmware is suitable for SEV-SNP guests. Provide necessary implementation to detect the feature and pick the right firmware if guest is SEV-SNP enabled. Signed-off-by: Michal Privoznik --- src/qemu/qemu_firmware.c

[PATCH 11/12] qemu: Allow setting launch security for SEV-SNP

2024-06-20 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fc1704f4fc..3a76df8ddb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19185,9 +19185,10 @

[PATCH 09/12] conf: Introduce SEV-SNP support

2024-06-20 Thread Michal Privoznik
SEV-SNP is an enhancement of SEV/SEV-ES and thus it shares some fields with it. Nevertheless, on XML level, it's yet another type of . Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 108 ++ src/conf/domain_conf.c| 73 +

[PATCH 10/12] qemu: Build cmd line for SEV-SNP

2024-06-20 Thread Michal Privoznik
Pretty straightforward as qemu has 'sev-snp-guest' object which attributes maps pretty much 1:1 to our XML model. Except for @vcek where QEMU has 'vcek-disabled`, an inverted boolean, while we model it as virTristateBool. But that's easy to map too. Signed-off-by: Michal Privoznik --- src/qemu/q

[PATCH 08/12] qemu_capabilities: Introduce QEMU_CAPS_SEV_SNP_GUEST

2024-06-20 Thread Michal Privoznik
This capability tracks sev-snp-guest object availability. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 + 3 files changed, 8 insertions

[PATCH 07/12] qemu: Report snp-policy in virDomainGetLaunchSecurityInfo()

2024-06-20 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- include/libvirt/libvirt-domain.h | 10 ++ src/qemu/qemu_driver.c | 6 ++ 2 files changed, 16 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 2f5b01bbfe..8f00e9e959 100644 --- a/include

[PATCH 05/12] src: Convert some _virDomainSecDef::sectype checks to switch()

2024-06-20 Thread Michal Privoznik
In a few instances there is a plain if() check for _virDomainSecDef::sectype. While this works perfectly for now, soon there'll be another type and we can utilize compiler to identify all the places that need adaptation. Switch those if() statements to switch(). Signed-off-by: Michal Privoznik --

[PATCH 06/12] qemu_monitor: Allow querying SEV-SNP state in 'query-sev'

2024-06-20 Thread Michal Privoznik
In QEMU commit v9.0.0-1155-g59d3740cb4 the return type of 'query-sev' monitor command changed to accommodate SEV-SNP. Even though we currently support launching plain SNP guests, this will soon change. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 32 ++ src/

[PATCH 04/12] Drop needless typecast to virDomainLaunchSecurity

2024-06-20 Thread Michal Privoznik
The sectype member of _virDomainSecDef struct is already declared as of virDomainLaunchSecurity type. There's no need to typecast it to the very same type when passing it to switch(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c| 6 +++--- src/qemu/qemu_command.c | 4 ++-- sr

[PATCH 03/12] conf: Separate SEV formatting into a function

2024-06-20 Thread Michal Privoznik
To avoid convolution of switch() inside of virDomainSecDefFormat() even more (as new sectypes are added), move formatting into a separate function. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff

[PATCH 02/12] conf: Move some members of virDomainSEVDef into virDomainSEVCommonDef

2024-06-20 Thread Michal Privoznik
Some parts of SEV are to be shared with SEV SNP. In order to reuse XML parsing / formatting code cleanly, let's move those common bits into a new struct (virDomainSEVCommonDef) and adjust rest of the code. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c| 55 +++

[PATCH 01/12] qemu_monitor_json: Report error in error paths in SEV related code

2024-06-20 Thread Michal Privoznik
While working on qemuMonitorJSONGetSEVMeasurement() and qemuMonitorJSONGetSEVInfo() I've noticed that if these functions fail, they do so without appropriate error set. Fill in error reporting. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor_json.c | 10 -- 1 file changed, 8 in

[PATCH 00/12] Introduce SEV-SNP support

2024-06-20 Thread Michal Privoznik
SEV-SNP support just landed in QEMU. Here is the first round of patches to incorporate support into libvirt. TODOs (aka problems of future me): - Teach tools/virt-qemu-sev-validate how to deal with SEV-SNP - Try to find a SEV-SNP machine a test these patches in real worl - Write a kbase article o

Re: [PATCH 0/4] nodedev: adjust handling DASDs

2024-06-20 Thread smitterl
> On 6/19/24 5:10 PM, smitterl(a)redhat.com wrote: > I am > not aware of a "storage" option on command nodedev-list. My guess > is that your are referring to "nodedev-list --tree". I meant the '--cap storage' option. But I see the '--tree' also works and it additionally displays the hierarchy tha

[PATCH] qemu_domain: Check if driver->domainEventState is NULL

2024-06-20 Thread Rayhan Faizel
Under the test environment, driver->domainEventState is uninitialized. If a disk gets dropped, it will attempt to queue an event which will cause a segmentation fault. This crash does not occur during normal use. This patch adds a quick check to ensure driver->domainEventState is not NULL along wi

Re: [PATCH] qemu: add support for qemu switchover-ack

2024-06-20 Thread Jiri Denemark
On Tue, Jun 18, 2024 at 16:14:29 +0100, Daniel P. Berrangé wrote: > On Tue, Jun 18, 2024 at 08:06:06AM -0700, Jon Kohler wrote: > > diff --git a/include/libvirt/libvirt-domain.h > > b/include/libvirt/libvirt-domain.h > > index 2f5b01bbfe..9543629f30 100644 > > --- a/include/libvirt/libvirt-domain.

Re: [PATCH 0/4] nodedev: adjust handling DASDs

2024-06-20 Thread Boris Fiuczynski
On 6/20/24 9:41 AM, Michal Prívozník wrote: On 6/19/24 14:29, Boris Fiuczynski wrote: Adjusting how DASDs are handled as recently ID_* tags are also included in the udev information which causes the problems reported by https://issues.redhat.com/browse/RHEL-39497 Removing the filtering of offlin

Re: [PATCH 1/4] nodedev: refactor storage type fixup

2024-06-20 Thread Michal Prívozník
On 6/19/24 14:29, Boris Fiuczynski wrote: > Refactor the storage type fixup into a reusable method. > > Reviewed-by: Marc Hartmayer > Signed-off-by: Boris Fiuczynski > --- > src/node_device/node_device_udev.c | 22 -- > 1 file changed, 16 insertions(+), 6 deletions(-) > > d

Re: [PATCH 4/4] nodedev: add ccw device state and remove fencing

2024-06-20 Thread Michal Prívozník
On 6/19/24 14:29, Boris Fiuczynski wrote: > Instead of fencing offline ccw devices add the state to the ccw > capability. > > Resolves: https://issues.redhat.com/browse/RHEL-39497 > Signed-off-by: Boris Fiuczynski > --- > src/conf/node_device_conf.c| 24 > src/co

Re: [PATCH 0/4] nodedev: adjust handling DASDs

2024-06-20 Thread Michal Prívozník
On 6/19/24 14:29, Boris Fiuczynski wrote: > Adjusting how DASDs are handled as recently ID_* tags are also included > in the udev information which causes the problems reported by > https://issues.redhat.com/browse/RHEL-39497 > Removing the filtering of offline ccw devices as these devices are > av