]> git.proxmox.com Git - pve-qemu-kvm.git/blobdiff - debian/patches/pve/0014-backup-modify-job-api.patch
fix backup jobs
[pve-qemu-kvm.git] / debian / patches / pve / 0014-backup-modify-job-api.patch
index c382b1e9d29b2dfcd315cd587aa5d7fb73956661..53975e66c6e0f9eafc0aeaef131f068af1e456af 100644 (file)
@@ -1,4 +1,4 @@
-From 46f9d5c97a466bc121c99d9f178a4c1bdc74e9f9 Mon Sep 17 00:00:00 2001
+From c46139b295f9edffd43a12e7f029fce4f9b2ea46 Mon Sep 17 00:00:00 2001
 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
 Date: Wed, 9 Dec 2015 15:04:57 +0100
 Subject: [PATCH 14/47] backup: modify job api
@@ -7,14 +7,14 @@ Introduces a BackupDump function callback and a pause_count
 for backup_start. For a dump-backup the target parameter
 can now be NULL so access to target needs to be guarded now.
 ---
- block/backup.c            | 116 ++++++++++++++++++++++++++++------------------
+ block/backup.c            | 118 +++++++++++++++++++++++++++++-----------------
  block/replication.c       |   3 +-
  blockdev.c                |   4 +-
  include/block/block_int.h |   5 ++
- 4 files changed, 81 insertions(+), 47 deletions(-)
+ 4 files changed, 83 insertions(+), 47 deletions(-)
 
 diff --git a/block/backup.c b/block/backup.c
-index a4fb288..3a230b5 100644
+index a4fb288..fe4ce7f 100644
 --- a/block/backup.c
 +++ b/block/backup.c
 @@ -36,6 +36,7 @@ typedef struct BackupBlockJob {
@@ -55,7 +55,16 @@ index a4fb288..3a230b5 100644
          }
          if (ret < 0) {
              trace_backup_do_cow_write_fail(job, start, ret);
-@@ -330,9 +342,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
+@@ -246,6 +258,8 @@ static void backup_abort(BlockJob *job)
+ static void backup_clean(BlockJob *job)
+ {
+     BackupBlockJob *s = container_of(job, BackupBlockJob, common);
++    if (!s->target)
++        return;
+     assert(s->target);
+     blk_unref(s->target);
+     s->target = NULL;
+@@ -330,9 +344,11 @@ static BlockErrorAction backup_error_action(BackupBlockJob *job,
      if (read) {
          return block_job_error_action(&job->common, job->on_source_error,
                                        true, error);
@@ -68,7 +77,7 @@ index a4fb288..3a230b5 100644
      }
  }
  
-@@ -453,6 +467,7 @@ static void coroutine_fn backup_run(void *opaque)
+@@ -453,6 +469,7 @@ static void coroutine_fn backup_run(void *opaque)
  
      job->done_bitmap = bitmap_new(end);
  
@@ -76,7 +85,7 @@ index a4fb288..3a230b5 100644
      job->before_write.notify = backup_before_write_notify;
      bdrv_add_before_write_notifier(bs, &job->before_write);
  
-@@ -557,7 +572,9 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -557,7 +574,9 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
                    BlockdevOnError on_source_error,
                    BlockdevOnError on_target_error,
                    int creation_flags,
@@ -86,7 +95,7 @@ index a4fb288..3a230b5 100644
                    BlockJobTxn *txn, Error **errp)
  {
      int64_t len;
-@@ -566,7 +583,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -566,7 +585,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
      int ret;
  
      assert(bs);
@@ -95,7 +104,7 @@ index a4fb288..3a230b5 100644
  
      if (bs == target) {
          error_setg(errp, "Source and target cannot be the same");
-@@ -579,13 +596,13 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -579,13 +598,13 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
          return NULL;
      }
  
@@ -111,7 +120,7 @@ index a4fb288..3a230b5 100644
          error_setg(errp, "Compression is not supported for this drive %s",
                     bdrv_get_device_name(target));
          return NULL;
-@@ -595,7 +612,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -595,7 +614,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
          return NULL;
      }
  
@@ -120,7 +129,7 @@ index a4fb288..3a230b5 100644
          return NULL;
      }
  
-@@ -635,15 +652,18 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -635,15 +654,18 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
          goto error;
      }
  
@@ -146,7 +155,7 @@ index a4fb288..3a230b5 100644
      job->on_source_error = on_source_error;
      job->on_target_error = on_target_error;
      job->sync_mode = sync_mode;
-@@ -651,36 +671,44 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
+@@ -651,36 +673,44 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
                         sync_bitmap : NULL;
      job->compress = compress;