From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu] QMP backup: use correct errno when getting blockdrive length fails
Date: Mon, 30 Jan 2023 11:20:42 +0100 [thread overview]
Message-ID: <20230130102042.53007-1-f.ebner@proxmox.com> (raw)
di->size would only be set later. The errno is minus the return value
from the function.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
.../0029-PVE-Backup-proxmox-backup-patches-for-qemu.patch | 4 ++--
...043-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/debian/patches/pve/0029-PVE-Backup-proxmox-backup-patches-for-qemu.patch b/debian/patches/pve/0029-PVE-Backup-proxmox-backup-patches-for-qemu.patch
index 40a56be..36ca351 100644
--- a/debian/patches/pve/0029-PVE-Backup-proxmox-backup-patches-for-qemu.patch
+++ b/debian/patches/pve/0029-PVE-Backup-proxmox-backup-patches-for-qemu.patch
@@ -501,7 +501,7 @@ index 0000000000..1dda8b7d8f
+#endif /* PROXMOX_BACKUP_CLIENT_H */
diff --git a/pve-backup.c b/pve-backup.c
new file mode 100644
-index 0000000000..3d28975eaa
+index 0000000000..6af212b9b4
--- /dev/null
+++ b/pve-backup.c
@@ -0,0 +1,956 @@
@@ -1134,7 +1134,7 @@ index 0000000000..3d28975eaa
+
+ ssize_t size = bdrv_getlength(di->bs);
+ if (size < 0) {
-+ error_setg_errno(task->errp, -di->size, "bdrv_getlength failed");
++ error_setg_errno(task->errp, -size, "bdrv_getlength failed");
+ goto err;
+ }
+ di->size = size;
diff --git a/debian/patches/pve/0043-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch b/debian/patches/pve/0043-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch
index 58a3556..18675b2 100644
--- a/debian/patches/pve/0043-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch
+++ b/debian/patches/pve/0043-PVE-Use-coroutine-QMP-for-backup-cancel_backup.patch
@@ -116,7 +116,7 @@ index 4ce7bc0b5e..0923037dec 100644
static void proxmox_backup_schedule_wake(void *data) {
CoCtxData *waker = (CoCtxData *)data;
diff --git a/pve-backup.c b/pve-backup.c
-index fa9c6c4493..109498eaf9 100644
+index 5662f48b72..e4fe1b601d 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -354,7 +354,7 @@ static void job_cancel_bh(void *opaque) {
@@ -267,8 +267,8 @@ index fa9c6c4493..109498eaf9 100644
ssize_t size = bdrv_getlength(di->bs);
if (size < 0) {
-- error_setg_errno(task->errp, -di->size, "bdrv_getlength failed");
-+ error_setg_errno(errp, -di->size, "bdrv_getlength failed");
+- error_setg_errno(task->errp, -size, "bdrv_getlength failed");
++ error_setg_errno(errp, -size, "bdrv_getlength failed");
goto err;
}
di->size = size;
--
2.30.2
next reply other threads:[~2023-01-30 10:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 10:20 Fiona Ebner [this message]
2023-02-21 8:19 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130102042.53007-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox