]> git.proxmox.com Git - pve-qemu.git/commitdiff
re-export patches in normalized form
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Jun 2022 13:47:34 +0000 (15:47 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Jun 2022 13:49:53 +0000 (15:49 +0200)
iow. using:

git format-patch --zero-commit --no-signature --no-numbered --diff-algorithm=myers ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/patches/pve/0005-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
debian/patches/pve/0006-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch
debian/patches/pve/0008-PVE-Up-glusterfs-allow-partial-reads.patch
debian/patches/pve/0010-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch
debian/patches/pve/0031-PVE-various-PBS-fixes.patch
debian/patches/pve/0037-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
debian/patches/pve/0038-PVE-Backup-Don-t-block-on-finishing-and-cleanup-crea.patch
debian/patches/pve/0051-vma-allow-partial-restore.patch
debian/patches/pve/0052-pbs-namespace-support.patch
debian/patches/pve/0055-PVE-Backup-ensure-jobs-in-di_list-are-referenced.patch
debian/patches/pve/0056-PVE-Backup-avoid-segfault-issues-upon-backup-cancel.patch

index fd4934ca482fa35ac18813bc3d969977c3f08037..f8775dccdbbbf7fa7f45daf2a79e65f6a2ca9f20 100644 (file)
@@ -9,7 +9,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
  1 file changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/block/gluster.c b/block/gluster.c
-index 398976bc66..523304835e 100644
+index 592e71b22a..aebfece6eb 100644
 --- a/block/gluster.c
 +++ b/block/gluster.c
 @@ -42,7 +42,7 @@
index 87ed54bfb9409a82b85169986a7725b13095df3e..e378405c43a76b02d76e2842cd426e5fa3d52e35 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
  1 file changed, 2 insertions(+)
 
 diff --git a/block/rbd.c b/block/rbd.c
-index 8f183eba2a..458f6bd7eb 100644
+index def96292e0..a4b8fb482c 100644
 --- a/block/rbd.c
 +++ b/block/rbd.c
 @@ -820,6 +820,8 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
index adc5bae96dbd17bc1f95a0ea9f7b14e6250c04f7..1c16ff76d310613e359413d5ddf72bcd7ae6784f 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
  1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/block/gluster.c b/block/gluster.c
-index 523304835e..80b75cb96c 100644
+index aebfece6eb..3b7ee2f649 100644
 --- a/block/gluster.c
 +++ b/block/gluster.c
 @@ -57,6 +57,7 @@ typedef struct GlusterAIOCB {
index ddd374387ad9e6e3b26ec7ab841a24d069842582..26ccf4f20afb885656334b47e4ef61e13e2d9f1e 100644 (file)
@@ -134,11 +134,7 @@ index 080ad9bca7..1f457d9e80 100644
 -        error_report_err(local_err);
 -        ret = -1;
 -        goto out;
-+        if (!blk1) {
-+            ret = -1;
-+            goto out;
-+        }
-     }
+-    }
 -    if (!drv->create_opts) {
 -        error_report("Format driver '%s' does not support image creation",
 -                     drv->format_name);
@@ -150,12 +146,16 @@ index 080ad9bca7..1f457d9e80 100644
 -                     proto_drv->format_name);
 -        ret = -1;
 -        goto out;
--    }
++        if (!blk1) {
++            ret = -1;
++            goto out;
++        }
+     }
 -    create_opts = qemu_opts_append(create_opts, drv->create_opts);
 -    create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
--
--    opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
  
+-    opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
+-
 -    size = blk_getlength(blk1);
 -    if (size < 0) {
 -        error_report("Failed to get size for '%s'", in.filename);
index 8b07653b9d294ce8363c76b49cd9569b78fdb2f1..d3a7334fd78e8c30c168f9605a10172018f1dd22 100644 (file)
@@ -14,9 +14,9 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 ---
  block/monitor/block-hmp-cmds.c |  4 ++-
- pve-backup.c                   | 59 ++++++++++++++++++++++++++--------
+ pve-backup.c                   | 57 +++++++++++++++++++++++++++-------
  qapi/block-core.json           |  6 ++++
- 3 files changed, 55 insertions(+), 14 deletions(-)
+ 3 files changed, 54 insertions(+), 13 deletions(-)
 
 diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
 index 3c06734e6d..4481b60a5c 100644
@@ -67,17 +67,24 @@ index 1c49cd178d..c15abefdda 100644
      qemu_co_mutex_lock(&backup_state.dump_callback_mutex);
  
      // avoid deadlock if job is cancelled
-@@ -147,16 +152,28 @@ pvebackup_co_dump_pbs_cb(
+@@ -147,17 +152,29 @@ pvebackup_co_dump_pbs_cb(
          return -1;
      }
  
 -    pbs_res = proxmox_backup_co_write_data(backup_state.pbs, di->dev_id, buf, start, size, &local_err);
+-    qemu_co_mutex_unlock(&backup_state.dump_callback_mutex);
 +    uint64_t transferred = 0;
 +    uint64_t reused = 0;
 +    while (transferred < size) {
 +        uint64_t left = size - transferred;
 +        uint64_t to_transfer = left < di->block_size ? left : di->block_size;
-+
+-    if (pbs_res < 0) {
+-        pvebackup_propagate_error(local_err);
+-        return pbs_res;
+-    } else {
+-        size_t reused = (pbs_res == 0) ? size : 0;
+-        pvebackup_add_transfered_bytes(size, !buf ? size : 0, reused);
 +        pbs_res = proxmox_backup_co_write_data(backup_state.pbs, di->dev_id,
 +            is_zero_block ? NULL : buf + transferred, start + transferred,
 +            to_transfer, &local_err);
@@ -90,21 +97,14 @@ index 1c49cd178d..c15abefdda 100644
 +        }
 +
 +        reused += pbs_res == 0 ? to_transfer : 0;
-+    }
-+
-     qemu_co_mutex_unlock(&backup_state.dump_callback_mutex);
--
--    if (pbs_res < 0) {
--        pvebackup_propagate_error(local_err);
--        return pbs_res;
--    } else {
--        size_t reused = (pbs_res == 0) ? size : 0;
--        pvebackup_add_transfered_bytes(size, !buf ? size : 0, reused);
--    }
-+    pvebackup_add_transfered_bytes(size, is_zero_block ? size : 0, reused);
+     }
  
++    qemu_co_mutex_unlock(&backup_state.dump_callback_mutex);
++    pvebackup_add_transfered_bytes(size, is_zero_block ? size : 0, reused);
++
      return size;
  }
 @@ -178,6 +195,7 @@ pvebackup_co_dump_vma_cb(
      int ret = -1;
  
index c7c31de911954fd5a433425667aa68fe623e1221..1a08f4bb00632e73a3b7f5d32a91bb514d84a6ea 100644 (file)
@@ -15,8 +15,8 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 [add new force parameter to job_cancel_sync calls]
 Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
 ---
- pve-backup.c | 169 +++++++++++++++------------------------------------
- 1 file changed, 50 insertions(+), 119 deletions(-)
+ pve-backup.c | 167 +++++++++++++++------------------------------------
+ 1 file changed, 49 insertions(+), 118 deletions(-)
 
 diff --git a/pve-backup.c b/pve-backup.c
 index f90abaa50a..63c686463f 100644
@@ -123,22 +123,8 @@ index f90abaa50a..63c686463f 100644
          proxmox_backup_abort(backup_state.pbs, "backup canceled");
      }
  
-+    /* it's enough to cancel one job in the transaction, the rest will follow
-+     * automatically */
-+    GList *bdi = g_list_first(backup_state.di_list);
-+    BlockJob *cancel_job = bdi && bdi->data ?
-+        ((PVEBackupDevInfo *)bdi->data)->job :
-+        NULL;
-+
-+    /* ref the job before releasing the mutex, just to be safe */
-+    if (cancel_job) {
-+        job_ref(&cancel_job->job);
-+    }
-+
-+    /* job_cancel_sync may enter the job, so we need to release the
-+     * backup_mutex to avoid deadlock */
-     qemu_mutex_unlock(&backup_state.backup_mutex);
+-    qemu_mutex_unlock(&backup_state.backup_mutex);
+-
 -    for(;;) {
 -
 -        BlockJob *next_job = NULL;
@@ -149,16 +135,29 @@ index f90abaa50a..63c686463f 100644
 -        while (l) {
 -            PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
 -            l = g_list_next(l);
--
++    /* it's enough to cancel one job in the transaction, the rest will follow
++     * automatically */
++    GList *bdi = g_list_first(backup_state.di_list);
++    BlockJob *cancel_job = bdi && bdi->data ?
++        ((PVEBackupDevInfo *)bdi->data)->job :
++        NULL;
 -            BlockJob *job = lookup_active_block_job(di);
 -            if (job != NULL) {
 -                next_job = job;
 -                break;
 -            }
 -        }
--
++    /* ref the job before releasing the mutex, just to be safe */
++    if (cancel_job) {
++        job_ref(&cancel_job->job);
++    }
 -        qemu_mutex_unlock(&backup_state.backup_mutex);
--
++    /* job_cancel_sync may enter the job, so we need to release the
++     * backup_mutex to avoid deadlock */
++    qemu_mutex_unlock(&backup_state.backup_mutex);
 -        if (next_job) {
 -            AioContext *aio_context = next_job->job.aio_context;
 -            aio_context_acquire(aio_context);
index ce92c43f42e8a8d7383342c8b2ec25bbbd415c83..036744510e630172d828211d6649c402f859b332 100644 (file)
@@ -210,7 +210,7 @@ index 63c686463f..6f05796fad 100644
 -    assert(!qemu_in_coroutine());
 +    PVEBackupDevInfo *di = opaque;
 +    di->completed_ret = ret;
++
 +    /*
 +     * Schedule stream cleanup in async coroutine. close_image and finish might
 +     * take a while, so we can't block on them here. This way it also doesn't
@@ -235,7 +235,7 @@ index 63c686463f..6f05796fad 100644
 +    aio_context_release(job_ctx);
 +    aio_co_enter(data->ctx, data->co);
 +}
-+
 +static void coroutine_fn pvebackup_co_cancel(void *opaque)
 +{
      Error *cancel_err = NULL;
@@ -311,13 +311,13 @@ index 63c686463f..6f05796fad 100644
 -        if (!job || local_err != NULL) {
 -            Error *create_job_err = NULL;
 -            error_setg(&create_job_err, "backup_job_create failed: %s",
+-                       local_err ? error_get_pretty(local_err) : "null");
 +        di->job = job;
-+
+-            pvebackup_propagate_error(create_job_err);
 +        if (!job || local_err) {
 +            error_setg(errp, "backup_job_create failed: %s",
-                        local_err ? error_get_pretty(local_err) : "null");
--
--            pvebackup_propagate_error(create_job_err);
++                       local_err ? error_get_pretty(local_err) : "null");
              break;
          }
  
index f5c0992f03c8d248fcce0ebbc40657a482f9042d..670eb68d5f52a91002eae6e574a3d6ce44430817 100644 (file)
@@ -18,10 +18,10 @@ Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
 Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 ---
- vma-reader.c |  6++++++++++---------
- vma.c        | 159 +++++++++++++++++++++++++++++----------------------
+ vma-reader.c |  64 ++++++++++++---------
+ vma.c        | 157 +++++++++++++++++++++++++++++----------------------
  vma.h        |   2 +-
- 3 files changed, 125 insertions(+), 96 deletions(-)
+ 3 files changed, 126 insertions(+), 97 deletions(-)
 
 diff --git a/vma-reader.c b/vma-reader.c
 index 4f4ee2b47b..844d95a5ba 100644
@@ -63,14 +63,10 @@ index 4f4ee2b47b..844d95a5ba 100644
 +    assert(target != NULL || skip);
      assert(dev_id);
 -    assert(vmar->rstate[dev_id].target == NULL);
-+    assert(vmar->rstate[dev_id].target == NULL && !vmar->rstate[dev_id].skip);
+-
 -    int64_t size = blk_getlength(target);
 -    int64_t size_diff = size - vmar->devinfo[dev_id].size;
-+    if (target != NULL) {
-+        int64_t size = blk_getlength(target);
-+        int64_t size_diff = size - vmar->devinfo[dev_id].size;
+-
 -    /* storage types can have different size restrictions, so it
 -     * is not always possible to create an image with exact size.
 -     * So we tolerate a size difference up to 4MB.
@@ -80,6 +76,12 @@ index 4f4ee2b47b..844d95a5ba 100644
 -                   "unexpected size %zd != %zd", vmar->devinfo[dev_id].devname,
 -                   size, vmar->devinfo[dev_id].size);
 -        return -1;
++    assert(vmar->rstate[dev_id].target == NULL && !vmar->rstate[dev_id].skip);
++
++    if (target != NULL) {
++        int64_t size = blk_getlength(target);
++        int64_t size_diff = size - vmar->devinfo[dev_id].size;
++
 +        /* storage types can have different size restrictions, so it
 +         * is not always possible to create an image with exact size.
 +         * So we tolerate a size difference up to 4MB.
@@ -212,15 +214,29 @@ index 89440733b1..21e765a469 100644
 +                } else {
 +                    devname = line + 5;
 +                    skip = true;
++                }
++            } else {
++                while (1) {
++                    if (!try_parse_option(&line, "format", &format, inbuf) &&
++                        !try_parse_option(&line, "throttling.bps", &bps, inbuf) &&
++                        !try_parse_option(&line, "throttling.group", &group, inbuf) &&
++                        !try_parse_option(&line, "cache", &cache, inbuf))
++                    {
++                        break;
++                    }
                  }
 -            }
--
 -            uint64_t bps_value = 0;
 -            if (bps) {
 -                bps_value = verify_u64(bps);
 -                g_free(bps);
 -            }
--
++                if (bps) {
++                    bps_value = verify_u64(bps);
++                    g_free(bps);
++                }
 -            const char *path;
 -            bool write_zero;
 -            if (line[0] == '0' && line[1] == ':') {
@@ -229,23 +245,8 @@ index 89440733b1..21e765a469 100644
 -            } else if (line[0] == '1' && line[1] == ':') {
 -                path = line + 2;
 -                write_zero = true;
-             } else {
+-            } else {
 -                g_error("read map failed - parse error ('%s')", inbuf);
-+                while (1) {
-+                    if (!try_parse_option(&line, "format", &format, inbuf) &&
-+                        !try_parse_option(&line, "throttling.bps", &bps, inbuf) &&
-+                        !try_parse_option(&line, "throttling.group", &group, inbuf) &&
-+                        !try_parse_option(&line, "cache", &cache, inbuf))
-+                    {
-+                        break;
-+                    }
-+                }
-+
-+                if (bps) {
-+                    bps_value = verify_u64(bps);
-+                    g_free(bps);
-+                }
-+
 +                if (line[0] == '0' && line[1] == ':') {
 +                    path = line + 2;
 +                    write_zero = false;
index 74c0a87f9beb7db5dfce94b5ffa674ee8bbbe8fd..8d97602dc3f5a810f87fc83ce2c5d52ce2cc3064 100644 (file)
@@ -202,7 +202,7 @@ index 9f6c04a512..f6a5f8c785 100644
              backup_time,
              dump_cb_block_size,
 diff --git a/qapi/block-core.json b/qapi/block-core.json
-index c5023710f5..619e13b9b1 100644
+index d089328a1f..705f0c97ba 100644
 --- a/qapi/block-core.json
 +++ b/qapi/block-core.json
 @@ -821,6 +821,8 @@
@@ -231,6 +231,3 @@ index c5023710f5..619e13b9b1 100644
  
  ##
  # @BlockdevOptionsNVMe:
--- 
-2.30.2
-
index 18122e5c053d4fc12df341c8f175ebdf3ab9568a..f3bfb157de08f0b25c3dc264e43f8d9df3efb1ca 100644 (file)
@@ -17,14 +17,14 @@ freed. With unlucky timings it seems possible that:
 Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 ---
- pve-backup.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
+ pve-backup.c | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
 
-Index: pve-qemu-kvm-6.2.0/pve-backup.c
-===================================================================
---- pve-qemu-kvm-6.2.0.orig/pve-backup.c
-+++ pve-qemu-kvm-6.2.0/pve-backup.c
-@@ -316,6 +316,14 @@ static void coroutine_fn pvebackup_co_co
+diff --git a/pve-backup.c b/pve-backup.c
+index 5bed6f4014..0c34428713 100644
+--- a/pve-backup.c
++++ b/pve-backup.c
+@@ -316,6 +316,14 @@ static void coroutine_fn pvebackup_co_complete_stream(void *opaque)
          }
      }
  
@@ -39,7 +39,7 @@ Index: pve-qemu-kvm-6.2.0/pve-backup.c
      // remove self from job list
      backup_state.di_list = g_list_remove(backup_state.di_list, di);
  
-@@ -491,9 +499,12 @@ static void create_backup_jobs_bh(void *
+@@ -491,9 +499,12 @@ static void create_backup_jobs_bh(void *opaque) {
              bitmap_mode, false, NULL, &perf, BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
              JOB_DEFAULT, pvebackup_complete_cb, di, backup_state.txn, &local_err);
  
@@ -54,7 +54,7 @@ Index: pve-qemu-kvm-6.2.0/pve-backup.c
  
          if (!job || local_err) {
              error_setg(errp, "backup_job_create failed: %s",
-@@ -521,12 +532,16 @@ static void create_backup_jobs_bh(void *
+@@ -521,12 +532,16 @@ static void create_backup_jobs_bh(void *opaque) {
                  di->target = NULL;
              }
  
index e0c91e65085ab4ea5887dd1f4e1790821435c953..63c449735fcad07813ffb8e06bf04425600939d1 100644 (file)
@@ -37,10 +37,10 @@ Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
  1 file changed, 39 insertions(+), 22 deletions(-)
 
 diff --git a/pve-backup.c b/pve-backup.c
-index cd45e66a61..be21027dad 100644
+index 0c34428713..2e22030eec 100644
 --- a/pve-backup.c
 +++ b/pve-backup.c
-@@ -352,15 +352,42 @@ static void pvebackup_complete_cb(void *opaque, int ret)
+@@ -355,15 +355,42 @@ static void pvebackup_complete_cb(void *opaque, int ret)
  
  /*
   * job_cancel(_sync) does not like to be called from coroutines, so defer to
@@ -89,7 +89,7 @@ index cd45e66a61..be21027dad 100644
      aio_co_enter(data->ctx, data->co);
  }
  
-@@ -381,22 +408,12 @@ void coroutine_fn qmp_backup_cancel(Error **errp)
+@@ -384,22 +411,12 @@ void coroutine_fn qmp_backup_cancel(Error **errp)
          proxmox_backup_abort(backup_state.pbs, "backup canceled");
      }