[pve-devel] [PATCH qemu] QMP backup: use correct errno when getting blockdrive length fails

Fiona Ebner f.ebner at proxmox.com
Mon Jan 30 11:20:42 CET 2023


di->size would only be set later. The errno is minus the return value
from the function.

Signed-off-by: Fiona Ebner <f.ebner at 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






More information about the pve-devel mailing list