Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Akihiko Odaki
On 2024/09/09 10:58, Joelle van Dyne wrote: New optional argument for 'blockdev-change-medium' QAPI command to allow the caller to specify if they wish to enable file locking. Signed-off-by: Joelle van Dyne --- qapi/block.json| 23 ++- block/monitor/block-

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Kevin Wolf
Am 09.09.2024 um 03:58 hat Joelle van Dyne geschrieben: > New optional argument for 'blockdev-change-medium' QAPI command to allow > the caller to specify if they wish to enable file locking. > > Signed-off-by: Joelle van Dyne I feel once you need to control such details of the backend, you shou

[PATCH v11 03/10] scsi/constant: add persistent reservation in/out protocol constants

2024-09-09 Thread Changqi Lu
Add constants for the persistent reservation in/out protocol in the scsi/constant module. The constants include the persistent reservation command, type, and scope values defined in sections 6.13 and 6.14 of the SCSI Primary Commands-4 (SPC-4) specification. Signed-off-by: Changqi Lu Signed-off-b

[PATCH v11 09/10] hw/nvme: add reservation protocal command

2024-09-09 Thread Changqi Lu
Add reservation acquire, reservation register, reservation release and reservation report commands in the nvme device layer. By introducing these commands, this enables the nvme device to perform reservation-related tasks, including querying keys, querying reservation status, registering reservati

[PATCH v11 02/10] block/raw: add persistent reservation in/out driver

2024-09-09 Thread Changqi Lu
Add persistent reservation in/out operations for raw driver. The following methods are implemented: bdrv_co_pr_read_keys, bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, bdrv_co_pr_release, bdrv_co_pr_clear and bdrv_co_pr_preempt. Signed-off-by: Changqi Lu Signed-off-by: zhe

[PATCH v11 01/10] block: add persistent reservation in/out api

2024-09-09 Thread Changqi Lu
Add persistent reservation in/out operations at the block level. The following operations are included: - read_keys:retrieves the list of registered keys. - read_reservation: retrieves the current reservation status. - register: registers a new reservation key. - reserve:

[PATCH v11 04/10] scsi/util: add helper functions for persistent reservation types conversion

2024-09-09 Thread Changqi Lu
This commit introduces two helper functions that facilitate the conversion between the persistent reservation types used in the SCSI protocol and those used in the block layer. Signed-off-by: Changqi Lu Signed-off-by: zhenwei pi Reviewed-by: Stefan Hajnoczi --- include/scsi/utils.h | 8 +

[PATCH v11 00/10] Support persistent reservation operations

2024-09-09 Thread Changqi Lu
Hi, Patch v11 has been modified, thanks to Klaus for the code review. v10->v11: - Before executing the pr operation, check whether it is supported. If it is not supported, return NVME_INVALID_OPCODE directly. v9->v10: - When the driver does not support the pr operation, the error code return

[PATCH v11 10/10] block/iscsi: add persistent reservation in/out driver

2024-09-09 Thread Changqi Lu
Add persistent reservation in/out operations for iscsi driver. The following methods are implemented: bdrv_co_pr_read_keys, bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, bdrv_co_pr_release, bdrv_co_pr_clear and bdrv_co_pr_preempt. Signed-off-by: Changqi Lu Signed-off-by: z

[PATCH v11 05/10] hw/scsi: add persistent reservation in/out api for scsi device

2024-09-09 Thread Changqi Lu
Add persistent reservation in/out operations in the SCSI device layer. By introducing the persistent reservation in/out api, this enables the SCSI device to perform reservation-related tasks, including querying keys, querying reservation status, registering reservation keys, initiating and releasin

[PATCH v11 06/10] block/nvme: add reservation command protocol constants

2024-09-09 Thread Changqi Lu
Add constants for the NVMe persistent command protocol. The constants include the reservation command opcode and reservation type values defined in section 7 of the NVMe 2.0 specification. Reviewed-by: Stefan Hajnoczi Signed-off-by: Changqi Lu Signed-off-by: zhenwei pi --- include/block/nvme.h

[PATCH v11 07/10] hw/nvme: add helper functions for converting reservation types

2024-09-09 Thread Changqi Lu
This commit introduces two helper functions that facilitate the conversion between the reservation types used in the NVME protocol and those used in the block layer. Reviewed-by: Klaus Jensen Reviewed-by: Stefan Hajnoczi Signed-off-by: Changqi Lu Signed-off-by: zhenwei pi --- hw/nvme/nvme.h |

[PATCH v11 08/10] hw/nvme: enable ONCS and rescap function

2024-09-09 Thread Changqi Lu
This commit enables ONCS to support the reservation function at the controller level. Also enables rescap function in the namespace by detecting the supported reservation function in the backend driver. Reviewed-by: Klaus Jensen Signed-off-by: Changqi Lu Signed-off-by: zhenwei pi Reviewed-by: S

[PULL 00/10] Crypto fixes patches

2024-09-09 Thread Daniel P . Berrangé
The following changes since commit f2aee60305a1e40374b2fc1093e4d04404e780ee: Merge tag 'pull-request-2024-09-08' of https://gitlab.com/huth/qemu into staging (2024-09-09 10:47:24 +0100) are available in the Git repository at: https://gitlab.com/berrange/qemu tags/crypto-fixes-pull-request

[PULL 02/10] crypto: run qcrypto_pbkdf2_count_iters in a new thread

2024-09-09 Thread Daniel P . Berrangé
From: Tiago Pasqualini CPU time accounting in the kernel has been demonstrated to have a sawtooth pattern[1][2]. This can cause the getrusage system call to not be as accurate as we are expecting, which can cause this calculation to stall. The kernel discussions shows that this inaccuracy happen

[PULL 01/10] iotests: fix expected output from gnutls

2024-09-09 Thread Daniel P . Berrangé
Error reporting from gnutls was improved by: commit 57941c9c86357a6a642f9ee3279d881df4043b6d Author: Daniel P. Berrangé Date: Fri Mar 15 14:07:58 2024 + crypto: push error reporting into TLS session I/O APIs This has the effect of changing the output from one of the NBD tests.

[PULL 03/10] crypto: check gnutls & gcrypt support the requested pbkdf hash

2024-09-09 Thread Daniel P . Berrangé
Both gnutls and gcrypt can be configured to exclude support for certain algorithms via a runtime check against system crypto policies. Thus it is not sufficient to have a compile time test for hash support in their pbkdf implementations. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P

[PULL 07/10] crypto: use consistent error reporting pattern for unsupported cipher modes

2024-09-09 Thread Daniel P . Berrangé
Not all paths in qcrypto_cipher_ctx_new() were correctly distinguishing between valid user input for cipher mode (which should report a user facing error), vs program logic errors (which should assert). Reported-by: Peter Maydell Signed-off-by: Daniel P. Berrangé --- crypto/cipher-nettle.c.inc

[PULL 06/10] crypto: avoid leak of ctx when bad cipher mode is given

2024-09-09 Thread Daniel P . Berrangé
Fixes: Coverity CID 1546884 Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé --- crypto/cipher-nettle.c.inc | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/cipher-nettle.c.inc b/crypto/cipher-nettle.c.inc index 42

[PULL 05/10] tests/unit: build pbkdf test on macOS

2024-09-09 Thread Daniel P . Berrangé
Add CONFIG_DARWIN to the pbkdf test build condition, since we have a way to measure CPU time on this platform since commit bf98afc75efedf1. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé --- tests/unit/test-crypto-pbkdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PULL 04/10] tests/unit: always build the pbkdf crypto unit test

2024-09-09 Thread Daniel P . Berrangé
The meson rules were excluding the pbkdf crypto test when gnutls was the crypto backend. It was then excluded again in #if statements in the test file. Rather than update these conditions, remove them all, and use the result of the qcrypto_pbkdf_supports() function to determine whether to skip tes

[PULL 09/10] crypto: Support SHA384 hash when using glib

2024-09-09 Thread Daniel P . Berrangé
From: Dorjoy Chowdhury QEMU requires minimum glib version 2.66.0 as per the root meson.build file and per glib documentation[1] G_CHECKSUM_SHA384 is available since 2.51. [1] https://docs.gtk.org/glib/enum.ChecksumType.html Reviewed-by: Daniel P. Berrangé Signed-off-by: Dorjoy Chowdhury Signe

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Joelle van Dyne
On Mon, Sep 9, 2024 at 12:36 AM Akihiko Odaki wrote: > > On 2024/09/09 10:58, Joelle van Dyne wrote: > > New optional argument for 'blockdev-change-medium' QAPI command to allow > > the caller to specify if they wish to enable file locking. > > > > Signed-off-by: Joelle van Dyne > > --- > > qap

[PULL 08/10] crypto: Define macros for hash algorithm digest lengths

2024-09-09 Thread Daniel P . Berrangé
From: Dorjoy Chowdhury Reviewed-by: Daniel P. Berrangé Signed-off-by: Dorjoy Chowdhury Signed-off-by: Daniel P. Berrangé --- crypto/hash.c | 14 +++--- include/crypto/hash.h | 8 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crypto/hash.c b/crypto/h

[PULL 10/10] crypto: Introduce x509 utils

2024-09-09 Thread Daniel P . Berrangé
From: Dorjoy Chowdhury An utility function for getting fingerprint from X.509 certificate has been introduced. Implementation only provided using gnutls. Signed-off-by: Dorjoy Chowdhury [DB: fixed missing gnutls_x509_crt_deinit in success path] Reviewed-by: Philippe Mathieu-Daudé Signed-off-by

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Joelle van Dyne
On Mon, Sep 9, 2024 at 2:56 AM Kevin Wolf wrote: > > Am 09.09.2024 um 03:58 hat Joelle van Dyne geschrieben: > > New optional argument for 'blockdev-change-medium' QAPI command to allow > > the caller to specify if they wish to enable file locking. > > > > Signed-off-by: Joelle van Dyne > > I fee

Re: [PATCH 2/2] hw/sd: Remove legacy sd_enable()

2024-09-09 Thread Peter Maydell
On Tue, 3 Sept 2024 at 21:04, Philippe Mathieu-Daudé wrote: > > sd_enable() was only used by omap_mmc_enable() which > got recently removed. Time to remove it. > > Since the SDState::enable boolean is now always %true, > we can remove it and simplify. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH 1/2] hw/sd: Remove legacy sd_set_cb()

2024-09-09 Thread Peter Maydell
On Tue, 3 Sept 2024 at 21:04, Philippe Mathieu-Daudé wrote: > > sd_set_cb() was only used by omap2_mmc_init() which > got recently removed. Time to remove it. For historical > background on the me_no_qdev_me_kill_mammoth_with_rocks > kludge, see commit 007d1dbf72 ("sd: Hide the qdev-but-not-quite

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Kevin Wolf
Am 09.09.2024 um 16:25 hat Joelle van Dyne geschrieben: > On Mon, Sep 9, 2024 at 2:56 AM Kevin Wolf wrote: > > > > Am 09.09.2024 um 03:58 hat Joelle van Dyne geschrieben: > > > New optional argument for 'blockdev-change-medium' QAPI command to allow > > > the caller to specify if they wish to enab

Re: [PULL 00/10] Crypto fixes patches

2024-09-09 Thread Peter Maydell
On Mon, 9 Sept 2024 at 15:17, Daniel P. Berrangé wrote: > > The following changes since commit f2aee60305a1e40374b2fc1093e4d04404e780ee: > > Merge tag 'pull-request-2024-09-08' of https://gitlab.com/huth/qemu into > staging (2024-09-09 10:47:24 +0100) > > are available in the Git repository at:

Re: [PATCH v11 02/10] block/raw: add persistent reservation in/out driver

2024-09-09 Thread Keith Busch
On Mon, Sep 09, 2024 at 07:34:45PM +0800, Changqi Lu wrote: > +static int coroutine_fn GRAPH_RDLOCK > +raw_co_pr_register(BlockDriverState *bs, uint64_t old_key, > + uint64_t new_key, BlockPrType type, > + bool ptpl, bool ignore_key) > +{ > +return bdrv_co_pr

Re: Re: [PATCH v11 02/10] block/raw: add persistent reservation in/out driver

2024-09-09 Thread zhenwei pi
On 9/10/24 04:18, Keith Busch wrote: On Mon, Sep 09, 2024 at 07:34:45PM +0800, Changqi Lu wrote: +static int coroutine_fn GRAPH_RDLOCK +raw_co_pr_register(BlockDriverState *bs, uint64_t old_key, + uint64_t new_key, BlockPrType type, + bool ptpl, bool ignore

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Akihiko Odaki
On 2024/09/09 23:18, Joelle van Dyne wrote: On Mon, Sep 9, 2024 at 12:36 AM Akihiko Odaki wrote: On 2024/09/09 10:58, Joelle van Dyne wrote: New optional argument for 'blockdev-change-medium' QAPI command to allow the caller to specify if they wish to enable file locking. Signed-off-by: Joel