[PULL 08/11] hw/nvme: do not report null uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 17 +++

[PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller pci id"), the emulated NVMe controller has defaulted to a non-Intel PCI identifier. Deprecate the compatibility parameter so we can get rid of it once and for all. Reviewed-by: Philippe Mathieu-Daudé Si

[PULL 11/11] hw/nvme: add new command abort case

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov NVMe command set specification for end-to-end data protection formatted namespace states: o If the Reference Tag Check bit of the PRCHK field is set to ‘1’ and the namespace is formatted for Type 3 protection, then the controller: ▪ should not compar

[PULL 09/11] hw/nvme: bump firmware revision

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen The Linux kernel quirks the QEMU NVMe controller pretty heavily because of the namespace identifier mess. Since this is now fixed, bump the firmware revision number to allow the quirk to be disabled for this revision. As of now, bump the firmware revision number to be equal to

[PULL 06/11] hw/nvme: do not auto-generate eui64

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen We cannot provide auto-generated unique or persistent namespace identifiers (EUI64, NGUID, UUID) easily. Since 6.1, namespaces have been assigned a generated EUI64 of the form "52:54:00:". This is will be unique within a QEMU instance, but not globally. Revert that this is ass

[PULL 07/11] hw/nvme: do not auto-generate uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably an

[PULL 05/11] hw/nvme: enforce common serial per subsystem

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h |

[PULL 04/11] hw/nvme: fix smart aen

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning") Acked-by

[PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Current implementation have problem in the read part of copy command. Because there is no metadata mangling before nvme_dif_check invocation, reftag error could be thrown for blocks of namespace that have not been previously written to. Signed-off-by: Dmitry Tikhov Reviewed-

[PULL 01/11] hw/nvme: fix narrowing conversion

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Since nlbas is of type int, it does not work with large namespace size values, e.g., 9 TB size of file backing namespace and 8 byte metadata with 4096 bytes lbasz gives negative nlbas value, which is later promoted to negative int64_t type value and results in negative ns->mof

[PULL 02/11] hw/nvme: add missing return statement

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Since there is no return after nvme_dsm_cb invocation, metadata associated with non-zero block range is currently zeroed. Also this behaviour leads to segfault since we schedule iocb->bh two times. First when entering nvme_dsm_cb with iocb->idx == iocb->nr and second because o

[PULL 00/11] hw/nvme updates

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit 70e975203f366f2f30daaeb714bb852562b7b72f: Merge tag 'pull-request-2022-06-03' of https://gitlab.com/thuth/qemu into staging (2022-06-03 06:43:38 -0700) are available in the Git repository at: git://git.infradead.org/qemu-nvm

Re: [PATCH v4 13/13] virDomainHugepagesFormat: Use virXMLFormatElementEmpty

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Refactor the function to use modern XML formatting machinery. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP

Re: [PATCH v4 12/13] Add unit tests for new specification of nvram.

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: From: Rohit Kumar This patch adds unit tests for remote NVRAM. Examples: and and Signed-off-by: Prerna Saxena Signed-off-by: Florian Schmidt Signed-off-by: Rohit Kumar --- .../bios-nvram-file.x86_64-latest.

Re: [PATCH v4 11/13] conf: Add support to parse/format for NVRAM

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: From: Rohit Kumar This patch introduces the logic to format and parse remote NVRAM. Update NVRAM element schema, and docs for supporting network backed NVRAM. NVRAM backed over network would give the flexibility to start the VM on any host without havin

Re: [PATCH v4 10/13] conf: Extract formatting of NVRAM out of virDomainLoaderDefFormat

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Introduce virDomainLoaderDefFormatNvram and extract the code to it so that it's self-contained in upcoming patches adding more complex logic. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 27 +++ 1 file changed, 19 inser

Re: [PATCH v4 09/13] qemuFirmwareFillDomain: Don't fill in firmware for network backed nvram

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Prepare for network backed nvram by refusing the reset of nvram on boot and don't check whether it exists. We will not support filling it from a template. Signed-off-by: Peter Krempa --- src/qemu/qemu_firmware.c | 20 1 file changed,

Re: [PATCH v4 08/13] qemu: validate: Reject virStorageSource features we don't want to support with nvram

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: From: Rohit Kumar Signed-off-by: Prerna Saxena Signed-off-by: Florian Schmidt Signed-off-by: Rohit Kumar Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 108 ++- 1 file changed, 84 insertions(+), 24 delet

Re: [PATCH v4 07/13] qemuDomainInitializePflashStorageSource: Properly and fully initialize nvram source

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Setup all fields for use with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 --- src/qemu/qemu_domain.h | 3 ++- src/qemu/qemu_process.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) Reviewed-by: Ján Tomko

Re: [PATCH v4 06/13] qemuProcessReconnect: Don't re-instantiate pflash storage source

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: We don't really use it besides when starting up the VM so when reconnecting this step is totally pointless. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 4 1 file changed, 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc D

Re: [libvirt][PATCH RESEND v12 0/6] Support query and use SGX

2022-06-03 Thread Michal Prívozník
On 6/3/22 09:36, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 22:49:15 +, Yang, Lin A wrote: >> On 6/2/22, 11:28 AM, "Yang, Lin A" wrote: >>> On 6/1/22, 11:37 PM, "Michal Prívozník" wrote: > > [...] > So maybe in the end libvirt CAN know the difference without having to do any ve

Re: [PATCH v4 05/13] qemu: Properly setup the NVRAM virStorageSource

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Use the designated helpers for virStorageSource instead using the file-based ones with a check. Signed-off-by: Peter Krempa --- src/qemu/qemu_cgroup.c | 3 +-- src/qemu/qemu_namespace.c | 5 +++-- src/security/security_dac.c | 21 +

Re: [libvirt PATCH v2 00/81] Add support for post-copy recovery

2022-06-03 Thread Jiri Denemark
On Wed, Jun 01, 2022 at 14:49:00 +0200, Jiri Denemark wrote: > This series implements a new VIR_MIGRATE_POSTCOPY_RESUME flag (virsh > migrate --resume) for recovering from a failed post-copy migration. > > You can also fetch the series from my gitlab fork (the last RFC patch is > missing there): >

Re: [PATCH v4 04/13] qemu: Use 'def->os.loader->nvram' directly instead of 'priv->pflash1'

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Since we now have a full virStorageSource for storing the nvram path we don't need the extra dance of transfering the data into the 'pflash1' *transferring variable which was an intermediary solution to use -blockdev. For now we keep it functionally i

Re: [libvirt PATCH v2 66/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase

2022-06-03 Thread Jiri Denemark
On Wed, Jun 01, 2022 at 14:50:06 +0200, Jiri Denemark wrote: > The QEMU process is already running, all we need to do is to call > migrate-recover QMP command. Except for some checks and cookie handling, > of course. > > Signed-off-by: Jiri Denemark > Reviewed-by: Peter Krempa > Reviewed-by: Pav

Re: [PATCH v4 03/13] conf: Convert def->os.loader->nvram a virStorageSource

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: From: Rohit Kumar Currently, libvirt allows only local filepaths to specify the location of the 'nvram' image. Changing it to virStorageSource type will allow to support remote storage for nvram. will allow supporting or will allow support for Sig

Re: [PATCH v4 02/13] qemuBuildPflashBlockdevCommandLine: Take virDomainObj instead of private data

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH v4 01/13] qemuDomainPrepareStorageSourceBlockdev: Add a variant for custom nodename

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: Extract the internals of qemuDomainPrepareStorageSourceBlockdev into qemuDomainPrepareStorageSourceBlockdevNodename so that we can reuse it when instantiating the virStorageSource for pflash backing. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c

Re: [PATCH] qemu: fd: Fix monitor usage of qemuFDPassDirectGetPath

2022-06-03 Thread Ján Tomko
On a Friday in 2022, Peter Krempa wrote: We need to use the 'name' variable and just overwrite it with the FD number when FDs are passed on the monitor. Otherwise we will read NULL path if the FD is accessed before being passed on the monitor. The idea of this helper is to simplify the monitor co

[PATCH] qemu: fd: Fix monitor usage of qemuFDPassDirectGetPath

2022-06-03 Thread Peter Krempa
We need to use the 'name' variable and just overwrite it with the FD number when FDs are passed on the monitor. Otherwise we will read NULL path if the FD is accessed before being passed on the monitor. The idea of this helper is to simplify the monitor code so it would be counterproductive to have

Re: [libvirt PATCH v2 67/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Finish phase

2022-06-03 Thread Jiri Denemark
On Wed, Jun 01, 2022 at 14:50:07 +0200, Jiri Denemark wrote: > Everything was already done in the normal Finish phase and vCPUs are > running. We just need to wait for all remaining data to be transferred. > > Signed-off-by: Jiri Denemark > Reviewed-by: Peter Krempa > Reviewed-by: Pavel Hrdina

Re: [libvirt PATCH v2 66/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase

2022-06-03 Thread Jiri Denemark
On Wed, Jun 01, 2022 at 14:50:06 +0200, Jiri Denemark wrote: > The QEMU process is already running, all we need to do is to call > migrate-recover QMP command. Except for some checks and cookie handling, > of course. > > Signed-off-by: Jiri Denemark > Reviewed-by: Peter Krempa > Reviewed-by: Pav

Re: [PATCH v3 0/5] Introduce network backed NVRAM

2022-06-03 Thread Peter Krempa
On Thu, Jun 02, 2022 at 16:50:42 +0530, Rohit Kumar wrote: > > On 17/05/22 8:55 pm, Peter Krempa wrote: > > On Mon, May 16, 2022 at 16:03:21 +0530, Rohit Kumar wrote: > > > Ping. > > > > > > Hi Peter, > > > can you please take a look on this v3 patchset ? > > Yes, don't worry and please be patien

[PATCH v4 09/13] qemuFirmwareFillDomain: Don't fill in firmware for network backed nvram

2022-06-03 Thread Peter Krempa
Prepare for network backed nvram by refusing the reset of nvram on boot and don't check whether it exists. We will not support filling it from a template. Signed-off-by: Peter Krempa --- src/qemu/qemu_firmware.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --

[PATCH v4 12/13] Add unit tests for new specification of nvram.

2022-06-03 Thread Peter Krempa
From: Rohit Kumar This patch adds unit tests for remote NVRAM. Examples: and and Signed-off-by: Prerna Saxena Signed-off-by: Florian Schmidt Signed-off-by: Rohit Kumar --- .../bios-nvram-file.x86_64-latest.args| 37 +++

[PATCH v4 08/13] qemu: validate: Reject virStorageSource features we don't want to support with nvram

2022-06-03 Thread Peter Krempa
From: Rohit Kumar Signed-off-by: Prerna Saxena Signed-off-by: Florian Schmidt Signed-off-by: Rohit Kumar Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 108 ++- 1 file changed, 84 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_valid

[PATCH v4 13/13] virDomainHugepagesFormat: Use virXMLFormatElementEmpty

2022-06-03 Thread Peter Krempa
Refactor the function to use modern XML formatting machinery. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b34513f943..4110109bd8 100644 --- a/sr

[PATCH v4 10/13] conf: Extract formatting of NVRAM out of virDomainLoaderDefFormat

2022-06-03 Thread Peter Krempa
Introduce virDomainLoaderDefFormatNvram and extract the code to it so that it's self-contained in upcoming patches adding more complex logic. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/sr

[PATCH v4 05/13] qemu: Properly setup the NVRAM virStorageSource

2022-06-03 Thread Peter Krempa
Use the designated helpers for virStorageSource instead using the file-based ones with a check. Signed-off-by: Peter Krempa --- src/qemu/qemu_cgroup.c | 3 +-- src/qemu/qemu_namespace.c | 5 +++-- src/security/security_dac.c | 21 +++-- src/security/security_

[PATCH v4 11/13] conf: Add support to parse/format for NVRAM

2022-06-03 Thread Peter Krempa
From: Rohit Kumar This patch introduces the logic to format and parse remote NVRAM. Update NVRAM element schema, and docs for supporting network backed NVRAM. NVRAM backed over network would give the flexibility to start the VM on any host without having to worry about where to get the latest nv

[PATCH v4 07/13] qemuDomainInitializePflashStorageSource: Properly and fully initialize nvram source

2022-06-03 Thread Peter Krempa
Setup all fields for use with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 --- src/qemu/qemu_domain.h | 3 ++- src/qemu/qemu_process.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c in

[PATCH v4 06/13] qemuProcessReconnect: Don't re-instantiate pflash storage source

2022-06-03 Thread Peter Krempa
We don't really use it besides when starting up the VM so when reconnecting this step is totally pointless. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 4 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dab298085f..3334c7d53

[PATCH v4 01/13] qemuDomainPrepareStorageSourceBlockdev: Add a variant for custom nodename

2022-06-03 Thread Peter Krempa
Extract the internals of qemuDomainPrepareStorageSourceBlockdev into qemuDomainPrepareStorageSourceBlockdevNodename so that we can reuse it when instantiating the virStorageSource for pflash backing. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 31 +++ src

[PATCH v4 04/13] qemu: Use 'def->os.loader->nvram' directly instead of 'priv->pflash1'

2022-06-03 Thread Peter Krempa
Since we now have a full virStorageSource for storing the nvram path we don't need the extra dance of transfering the data into the 'pflash1' variable which was an intermediary solution to use -blockdev. For now we keep it functionally identical to the previous impl. Signed-off-by: Peter Krempa

[PATCH v4 00/13] Introduce network backed NVRAM

2022-06-03 Thread Peter Krempa
This version fixes multiple problems which I'd point out when reviewing: - virStorageSource is properly used in all places - logic for initializing NVRAM imgages from template is fixed to avoid touching network backed nvrams - documentation now states the correct version - some cleanups - d

[PATCH v4 03/13] conf: Convert def->os.loader->nvram a virStorageSource

2022-06-03 Thread Peter Krempa
From: Rohit Kumar Currently, libvirt allows only local filepaths to specify the location of the 'nvram' image. Changing it to virStorageSource type will allow to support remote storage for nvram. Signed-off-by: Prerna Saxena Signed-off-by: Florian Schmidt Signed-off-by: Rohit Kumar Signed-off

[PATCH v4 02/13] qemuBuildPflashBlockdevCommandLine: Take virDomainObj instead of private data

2022-06-03 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 52e4ef03cd..7dc09fc101 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10122,8 +10122,10

Re: [libvirt][PATCH RESEND v12 0/6] Support query and use SGX

2022-06-03 Thread Peter Krempa
On Thu, Jun 02, 2022 at 22:49:15 +, Yang, Lin A wrote: > On 6/2/22, 11:28 AM, "Yang, Lin A" wrote: > > On 6/1/22, 11:37 PM, "Michal Prívozník" wrote: [...] > > > So maybe in the end libvirt CAN know the difference without having to do > > > any version check. We have a "dialect" of XPATH th