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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 37F9089485 for ; Mon, 17 Oct 2022 09:18:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 21EFC1C0EC for ; Mon, 17 Oct 2022 09:18:38 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 17 Oct 2022 09:18:37 +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 C21D844A3D for ; Mon, 17 Oct 2022 09:18:36 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 17 Oct 2022 09:18:33 +0200 Message-Id: <20221017071833.73771-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 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] savevm async IO channel: channel writev: fix return value in error case 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: Mon, 17 Oct 2022 07:18:38 -0000 The documentation in include/io/channel.h states that -1 or QIO_CHANNEL_ERR_BLOCK should be returned upon error. Simply passing along the return value from the blk-functions has the potential to confuse the call sides. Non-blocking mode is not implemented currently, so -1 it is. The "return ret" was mistakenly left over from the previous QEMUFileOps based implementation. Also, use error_setg_errno(), since the blk(_co)_p{readv,writev} functions return errno codes. Signed-off-by: Fiona Ebner --- Similar to this patch for channel-block.c upstream: https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg02057.html ...-IOChannel-implementation-for-savevm-async.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/patches/pve/0016-PVE-add-IOChannel-implementation-for-savevm-async.patch b/debian/patches/pve/0016-PVE-add-IOChannel-implementation-for-savevm-async.patch index e48eb9d..a1073bd 100644 --- a/debian/patches/pve/0016-PVE-add-IOChannel-implementation-for-savevm-async.patch +++ b/debian/patches/pve/0016-PVE-add-IOChannel-implementation-for-savevm-async.patch @@ -15,19 +15,19 @@ Additionally, allows tracking the current position from the outside Signed-off-by: Fiona Ebner --- - migration/channel-savevm-async.c | 181 +++++++++++++++++++++++++++++++ + migration/channel-savevm-async.c | 182 +++++++++++++++++++++++++++++++ migration/channel-savevm-async.h | 51 +++++++++ migration/meson.build | 1 + - 3 files changed, 233 insertions(+) + 3 files changed, 234 insertions(+) create mode 100644 migration/channel-savevm-async.c create mode 100644 migration/channel-savevm-async.h diff --git a/migration/channel-savevm-async.c b/migration/channel-savevm-async.c new file mode 100644 -index 0000000000..efea3842cf +index 0000000000..06d5484778 --- /dev/null +++ b/migration/channel-savevm-async.c -@@ -0,0 +1,181 @@ +@@ -0,0 +1,182 @@ +/* + * QIO Channel implementation to be used by savevm-async QMP calls + */ @@ -96,7 +96,7 @@ index 0000000000..efea3842cf + // returns 0 on success + ret = blk_preadv(be, *saioc->bs_pos, size, &qiov, 0); + if (ret < 0) { -+ error_setg(errp, "blk_preadv returned %d", ret); ++ error_setg_errno(errp, -ret, "blk_preadv failed"); + return -1; + } + @@ -129,7 +129,8 @@ index 0000000000..efea3842cf + } + + if (ret < 0) { -+ return ret; ++ error_setg_errno(errp, -ret, "blk(_co)_pwritev failed"); ++ return -1; + } + + *saioc->bs_pos += qiov.size; -- 2.30.2