From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id BE47C925CC for ; Thu, 13 Oct 2022 14:44:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A3F962F468 for ; Thu, 13 Oct 2022 14:44:28 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 13 Oct 2022 14:44:27 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9B864449AB for ; Thu, 13 Oct 2022 14:44:27 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Thu, 13 Oct 2022 14:44:23 +0200 Message-Id: <20221013124423.227141-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221013124423.227141-1-f.ebner@proxmox.com> References: <20221013124423.227141-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu 4/4] {alloc track, pbs} block driver: bdrv_co_preadv: adapt return values X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2022 12:44:58 -0000 to be in-line with what other implementations in QEMU do. Commit 1d39c7098bbfa6862cb96066c4f8f6735ea397c5 mentions the EIO bit and the function is expected to return 0 upon success (see other implementations). Signed-off-by: Fiona Ebner --- ...PBS-block-driver-to-map-backup-archives-into.patch | 11 ++++++----- ...k-pbs-fast-path-reads-without-allocation-if-.patch | 2 +- .../pve/0048-block-add-alloc-track-driver.patch | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/debian/patches/pve/0033-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch b/debian/patches/pve/0033-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch index 9a850c0..86e85d2 100644 --- a/debian/patches/pve/0033-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch +++ b/debian/patches/pve/0033-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch @@ -7,8 +7,9 @@ Signed-off-by: Stefan Reiter [error cleanups, file_open implementation] Signed-off-by: Dietmar Maurer Signed-off-by: Thomas Lamprecht -[adapt to changed function signatures] -Signed-off-by: Fabian Ebner +[FE: adapt to changed function signatures + make pbs_co_preadv return values consistent with QEMU] +Signed-off-by: Fiona Ebner --- block/meson.build | 3 + block/pbs.c | 276 +++++++++++++++++++++++++++++++++++++++++++ @@ -34,7 +35,7 @@ index 2783b77e9c..a26a69434e 100644 diff --git a/block/pbs.c b/block/pbs.c new file mode 100644 -index 0000000000..0b05ea9080 +index 0000000000..9d1f1f39d4 --- /dev/null +++ b/block/pbs.c @@ -0,0 +1,276 @@ @@ -244,7 +245,7 @@ index 0000000000..0b05ea9080 + + if (offset < 0 || bytes < 0) { + fprintf(stderr, "unexpected negative 'offset' or 'bytes' value!\n"); -+ return -EINVAL; ++ return -EIO; + } + + ReadCallbackData rcb = { @@ -266,7 +267,7 @@ index 0000000000..0b05ea9080 + qemu_iovec_from_buf(qiov, 0, buf, bytes); + free(buf); + -+ return ret; ++ return 0; +} + +static coroutine_fn int pbs_co_pwritev(BlockDriverState *bs, diff --git a/debian/patches/pve/0045-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch b/debian/patches/pve/0045-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch index 893104a..48e6d67 100644 --- a/debian/patches/pve/0045-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch +++ b/debian/patches/pve/0045-PVE-block-pbs-fast-path-reads-without-allocation-if-.patch @@ -49,5 +49,5 @@ index 0b05ea9080..c5eb4d5bad 100644 + g_free(buf); + } - return ret; + return 0; } diff --git a/debian/patches/pve/0048-block-add-alloc-track-driver.patch b/debian/patches/pve/0048-block-add-alloc-track-driver.patch index 45c1c4d..d47c84b 100644 --- a/debian/patches/pve/0048-block-add-alloc-track-driver.patch +++ b/debian/patches/pve/0048-block-add-alloc-track-driver.patch @@ -24,8 +24,9 @@ once the backing image is removed. It will be replaced by 'file'. Signed-off-by: Stefan Reiter Signed-off-by: Thomas Lamprecht -[adapt to changed function signatures] -Signed-off-by: Fabian Ebner +[FE: adapt to changed function signatures + make error return value consistent with QEMU] +Signed-off-by: Fiona Ebner --- block/alloc-track.c | 350 ++++++++++++++++++++++++++++++++++++++++++++ block/meson.build | 1 + @@ -34,7 +35,7 @@ Signed-off-by: Fabian Ebner diff --git a/block/alloc-track.c b/block/alloc-track.c new file mode 100644 -index 0000000000..6b50fbe537 +index 0000000000..43d40d11af --- /dev/null +++ b/block/alloc-track.c @@ -0,0 +1,350 @@ @@ -181,7 +182,7 @@ index 0000000000..6b50fbe537 + + if (offset < 0 || bytes < 0) { + fprintf(stderr, "unexpected negative 'offset' or 'bytes' value!\n"); -+ return -EINVAL; ++ return -EIO; + } + + /* a read request can span multiple granularity-sized chunks, and can thus -- 2.30.2