]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
backup: call block_job_cb()
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 6 Dec 2013 08:10:16 +0000 (09:10 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 6 Dec 2013 08:10:16 +0000 (09:10 +0100)
Try to use the same cleanup method as other command do.

debian/patches/backup-add-dir-format.patch
debian/patches/backup-add-pve-monitor-commands.patch
debian/patches/internal-snapshot-async.patch

index 9663f5009b8632705ea41e0691ad69d6f029dc30..e1e527d458008309b501d8eff96b35326164b6ca 100644 (file)
@@ -1,7 +1,7 @@
 Index: new/qapi-schema.json
 ===================================================================
---- new.orig/qapi-schema.json  2013-12-06 07:46:40.000000000 +0100
-+++ new/qapi-schema.json       2013-12-06 07:46:45.000000000 +0100
+--- new.orig/qapi-schema.json  2013-12-06 08:42:27.000000000 +0100
++++ new/qapi-schema.json       2013-12-06 08:57:27.000000000 +0100
 @@ -586,7 +586,7 @@
  # @vma: Proxmox vma backup format
  ##
@@ -13,9 +13,9 @@ Index: new/qapi-schema.json
  # @backup:
 Index: new/blockdev.c
 ===================================================================
---- new.orig/blockdev.c        2013-12-06 07:46:40.000000000 +0100
-+++ new/blockdev.c     2013-12-06 08:09:32.000000000 +0100
-@@ -1463,6 +1463,8 @@
+--- new.orig/blockdev.c        2013-12-06 08:53:36.000000000 +0100
++++ new/blockdev.c     2013-12-06 08:59:07.000000000 +0100
+@@ -1760,6 +1760,8 @@
      uint8_t dev_id;
      //bool started;
      bool completed;
@@ -24,13 +24,16 @@ Index: new/blockdev.c
  } PVEBackupDevInfo;
  
  static void pvebackup_run_next_job(void);
-@@ -1530,12 +1532,13 @@
+@@ -1827,15 +1829,16 @@
  {
      PVEBackupDevInfo *di = opaque;
  
 -    assert(backup_state.vmaw);
 -
      di->completed = true;
+     BlockDriverState *bs = di->bs;
      di->bs = NULL;
 +    di->target = NULL;
  
@@ -39,9 +42,9 @@ Index: new/blockdev.c
 +        vma_writer_close_stream(backup_state.vmaw, di->dev_id);
 +    }
  
-     if (!backup_state.cancel) {
-         pvebackup_run_next_job();
-@@ -1610,6 +1613,7 @@
+     block_job_cb(bs, ret);
+@@ -1912,6 +1915,7 @@
                      bool has_speed, int64_t speed, Error **errp)
  {
      BlockDriverState *bs;
@@ -49,7 +52,7 @@ Index: new/blockdev.c
      Error *local_err = NULL;
      uuid_t uuid;
      VmaWriter *vmaw = NULL;
-@@ -1626,11 +1630,6 @@
+@@ -1928,11 +1932,6 @@
      /* Todo: try to auto-detect format based on file name */
      format = has_format ? format : BACKUP_FORMAT_VMA;
  
@@ -61,7 +64,7 @@ Index: new/blockdev.c
      if (has_devlist) {
          devs = g_strsplit_set(devlist, ",;:", -1);
  
-@@ -1698,27 +1697,63 @@
+@@ -2000,27 +1999,63 @@
  
      uuid_generate(uuid);
  
@@ -141,7 +144,7 @@ Index: new/blockdev.c
      }
  
      /* add configuration file to archive */
-@@ -1731,12 +1766,27 @@
+@@ -2033,12 +2068,27 @@
              goto err;
          }
  
@@ -174,7 +177,7 @@ Index: new/blockdev.c
          g_free(cdata);
      }
  
-@@ -1776,10 +1826,11 @@
+@@ -2078,10 +2128,11 @@
          PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
          l = g_list_next(l);
  
@@ -187,7 +190,7 @@ Index: new/blockdev.c
          if (local_err != NULL) {
              error_setg(&backup_state.error, "backup_job_create failed");
              pvebackup_cancel(NULL);
-@@ -1796,8 +1847,17 @@
+@@ -2098,8 +2149,17 @@
  
      l = di_list;
      while (l) {
@@ -206,7 +209,7 @@ Index: new/blockdev.c
      }
      g_list_free(di_list);
  
-@@ -1811,6 +1871,10 @@
+@@ -2113,6 +2173,10 @@
          unlink(backup_file);
      }
  
@@ -219,8 +222,8 @@ Index: new/blockdev.c
  
 Index: new/hmp-commands.hx
 ===================================================================
---- new.orig/hmp-commands.hx   2013-12-06 07:46:38.000000000 +0100
-+++ new/hmp-commands.hx        2013-12-06 08:01:26.000000000 +0100
+--- new.orig/hmp-commands.hx   2013-12-06 08:42:27.000000000 +0100
++++ new/hmp-commands.hx        2013-12-06 08:57:27.000000000 +0100
 @@ -85,9 +85,11 @@
  
     {
@@ -238,8 +241,8 @@ Index: new/hmp-commands.hx
  
 Index: new/hmp.c
 ===================================================================
---- new.orig/hmp.c     2013-12-06 07:46:38.000000000 +0100
-+++ new/hmp.c  2013-12-06 07:50:58.000000000 +0100
+--- new.orig/hmp.c     2013-12-06 08:42:27.000000000 +0100
++++ new/hmp.c  2013-12-06 08:57:27.000000000 +0100
 @@ -1245,11 +1245,13 @@
  {
      Error *error = NULL;
index 31f745a11f5d26c13a25b0ad740f286b39fab77b..67e0467721882c5c1b5225c85a24b42ca9165769 100644 (file)
@@ -1,7 +1,7 @@
 Index: new/blockdev.c
 ===================================================================
---- new.orig/blockdev.c        2013-12-05 13:39:59.000000000 +0100
-+++ new/blockdev.c     2013-12-06 06:59:11.000000000 +0100
+--- new.orig/blockdev.c        2013-12-06 07:46:29.000000000 +0100
++++ new/blockdev.c     2013-12-06 08:53:36.000000000 +0100
 @@ -45,6 +45,7 @@
  #include "qmp-commands.h"
  #include "trace.h"
@@ -10,10 +10,18 @@ Index: new/blockdev.c
  
  static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives);
  
-@@ -1438,6 +1439,425 @@
+@@ -1438,7 +1439,6 @@
      }
  }
  
+-
+ static void eject_device(BlockDriverState *bs, int force, Error **errp)
+ {
+     if (bdrv_in_use(bs)) {
+@@ -1736,6 +1736,431 @@
+     bdrv_put_ref_bh_schedule(bs);
+ }
 +/* PVE backup related function */
 +
 +static struct PVEBackupState {
@@ -108,10 +116,15 @@ Index: new/blockdev.c
 +    assert(backup_state.vmaw);
 +
 +    di->completed = true;
++
++    BlockDriverState *bs = di->bs;
++
 +    di->bs = NULL;
 +
 +    vma_writer_close_stream(backup_state.vmaw, di->dev_id);
 +
++    block_job_cb(bs, ret);
++
 +    if (!backup_state.cancel) {
 +        pvebackup_run_next_job();
 +    }
@@ -433,13 +446,14 @@ Index: new/blockdev.c
 +
 +    return info;
 +}
- static void eject_device(BlockDriverState *bs, int force, Error **errp)
- {
++
+ void qmp_block_stream(const char *device, bool has_base,
+                       const char *base, bool has_speed, int64_t speed,
+                       bool has_on_error, BlockdevOnError on_error,
 Index: new/hmp-commands.hx
 ===================================================================
---- new.orig/hmp-commands.hx   2013-12-05 13:39:59.000000000 +0100
-+++ new/hmp-commands.hx        2013-12-05 13:40:07.000000000 +0100
+--- new.orig/hmp-commands.hx   2013-12-03 06:36:18.000000000 +0100
++++ new/hmp-commands.hx        2013-12-06 08:42:27.000000000 +0100
 @@ -83,6 +83,35 @@
  Copy data from a backing file into a block device.
  ETEXI
@@ -487,8 +501,8 @@ Index: new/hmp-commands.hx
  @item info migrate_capabilities
 Index: new/hmp.c
 ===================================================================
---- new.orig/hmp.c     2013-12-05 13:39:59.000000000 +0100
-+++ new/hmp.c  2013-12-06 07:25:28.000000000 +0100
+--- new.orig/hmp.c     2013-12-06 07:46:29.000000000 +0100
++++ new/hmp.c  2013-12-06 08:42:27.000000000 +0100
 @@ -133,6 +133,44 @@
      qapi_free_MouseInfoList(mice_list);
  }
@@ -566,8 +580,8 @@ Index: new/hmp.c
  {
 Index: new/hmp.h
 ===================================================================
---- new.orig/hmp.h     2013-12-05 13:39:59.000000000 +0100
-+++ new/hmp.h  2013-12-05 13:40:07.000000000 +0100
+--- new.orig/hmp.h     2013-12-03 06:36:18.000000000 +0100
++++ new/hmp.h  2013-12-06 07:46:38.000000000 +0100
 @@ -28,6 +28,7 @@
  void hmp_info_migrate(Monitor *mon, const QDict *qdict);
  void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
@@ -587,8 +601,8 @@ Index: new/hmp.h
  void hmp_block_job_pause(Monitor *mon, const QDict *qdict);
 Index: new/monitor.c
 ===================================================================
---- new.orig/monitor.c 2013-12-05 13:39:59.000000000 +0100
-+++ new/monitor.c      2013-12-05 13:40:07.000000000 +0100
+--- new.orig/monitor.c 2013-12-03 06:36:18.000000000 +0100
++++ new/monitor.c      2013-12-06 07:46:38.000000000 +0100
 @@ -2880,6 +2880,13 @@
      },
  #endif
@@ -605,8 +619,8 @@ Index: new/monitor.c
          .params     = "",
 Index: new/qapi-schema.json
 ===================================================================
---- new.orig/qapi-schema.json  2013-12-05 13:39:59.000000000 +0100
-+++ new/qapi-schema.json       2013-12-06 06:59:11.000000000 +0100
+--- new.orig/qapi-schema.json  2013-12-06 07:46:29.000000000 +0100
++++ new/qapi-schema.json       2013-12-06 08:42:27.000000000 +0100
 @@ -547,6 +547,95 @@
  ##
  { 'command': 'query-events', 'returns': ['EventInfo'] }
@@ -705,8 +719,8 @@ Index: new/qapi-schema.json
  #
 Index: new/qmp-commands.hx
 ===================================================================
---- new.orig/qmp-commands.hx   2013-12-05 13:39:59.000000000 +0100
-+++ new/qmp-commands.hx        2013-12-05 13:40:07.000000000 +0100
+--- new.orig/qmp-commands.hx   2013-12-06 07:46:29.000000000 +0100
++++ new/qmp-commands.hx        2013-12-06 07:46:38.000000000 +0100
 @@ -966,6 +966,24 @@
  EQMP
  
index bfe44a18680fd079be82db7b4110ce8f05621da1..d7d7252b48d1c2753163c143a7d6ee4c4f9d6593 100644 (file)
@@ -23,8 +23,8 @@ Subject: [PATCH] internal-snapshot-async-qemu1.7.patch
 
 Index: new/Makefile.objs
 ===================================================================
---- new.orig/Makefile.objs     2013-12-04 10:45:45.000000000 +0100
-+++ new/Makefile.objs  2013-12-04 10:48:07.000000000 +0100
+--- new.orig/Makefile.objs     2013-12-06 07:46:38.000000000 +0100
++++ new/Makefile.objs  2013-12-06 08:59:22.000000000 +0100
 @@ -56,6 +56,7 @@
  common-obj-y += qemu-char.o #aio.o
  common-obj-y += block-migration.o
@@ -35,8 +35,8 @@ Index: new/Makefile.objs
  
 Index: new/block.c
 ===================================================================
---- new.orig/block.c   2013-12-04 10:07:06.000000000 +0100
-+++ new/block.c        2013-12-04 10:48:07.000000000 +0100
+--- new.orig/block.c   2013-12-06 07:46:38.000000000 +0100
++++ new/block.c        2013-12-06 08:59:22.000000000 +0100
 @@ -1710,7 +1710,7 @@
              bs_new->drv ? bs_new->drv->format_name : "");
  }
@@ -48,9 +48,9 @@ Index: new/block.c
      assert(!bs->job);
 Index: new/hmp-commands.hx
 ===================================================================
---- new.orig/hmp-commands.hx   2013-12-04 10:48:06.000000000 +0100
-+++ new/hmp-commands.hx        2013-12-04 10:48:07.000000000 +0100
-@@ -1729,6 +1729,8 @@
+--- new.orig/hmp-commands.hx   2013-12-06 08:57:27.000000000 +0100
++++ new/hmp-commands.hx        2013-12-06 08:59:22.000000000 +0100
+@@ -1731,6 +1731,8 @@
  show current migration capabilities
  @item info migrate_cache_size
  show current migration XBZRLE cache size
@@ -59,7 +59,7 @@ Index: new/hmp-commands.hx
  @item info balloon
  show balloon information
  @item info qtree
-@@ -1750,3 +1752,35 @@
+@@ -1752,3 +1754,35 @@
  STEXI
  @end table
  ETEXI
@@ -97,8 +97,8 @@ Index: new/hmp-commands.hx
 +    },
 Index: new/hmp.c
 ===================================================================
---- new.orig/hmp.c     2013-12-04 10:48:06.000000000 +0100
-+++ new/hmp.c  2013-12-04 10:48:07.000000000 +0100
+--- new.orig/hmp.c     2013-12-06 08:57:27.000000000 +0100
++++ new/hmp.c  2013-12-06 08:59:22.000000000 +0100
 @@ -1655,3 +1655,60 @@
  
      hmp_handle_error(mon, &err);
@@ -162,8 +162,8 @@ Index: new/hmp.c
 +}
 Index: new/hmp.h
 ===================================================================
---- new.orig/hmp.h     2013-12-04 10:48:06.000000000 +0100
-+++ new/hmp.h  2013-12-04 10:48:07.000000000 +0100
+--- new.orig/hmp.h     2013-12-06 07:46:38.000000000 +0100
++++ new/hmp.h  2013-12-06 08:59:22.000000000 +0100
 @@ -25,6 +25,7 @@
  void hmp_info_uuid(Monitor *mon, const QDict *qdict);
  void hmp_info_chardev(Monitor *mon, const QDict *qdict);
@@ -185,8 +185,8 @@ Index: new/hmp.h
  void hmp_nbd_server_start(Monitor *mon, const QDict *qdict);
 Index: new/include/block/block.h
 ===================================================================
---- new.orig/include/block/block.h     2013-12-04 10:07:06.000000000 +0100
-+++ new/include/block/block.h  2013-12-04 10:48:07.000000000 +0100
+--- new.orig/include/block/block.h     2013-12-06 07:46:38.000000000 +0100
++++ new/include/block/block.h  2013-12-06 08:59:22.000000000 +0100
 @@ -214,6 +214,7 @@
      const char *backing_file);
  int bdrv_get_backing_file_depth(BlockDriverState *bs);
@@ -197,8 +197,8 @@ Index: new/include/block/block.h
  void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
 Index: new/include/sysemu/sysemu.h
 ===================================================================
---- new.orig/include/sysemu/sysemu.h   2013-12-04 10:07:06.000000000 +0100
-+++ new/include/sysemu/sysemu.h        2013-12-04 10:48:07.000000000 +0100
+--- new.orig/include/sysemu/sysemu.h   2013-12-06 07:46:38.000000000 +0100
++++ new/include/sysemu/sysemu.h        2013-12-06 08:59:22.000000000 +0100
 @@ -73,16 +73,17 @@
  
  void do_savevm(Monitor *mon, const QDict *qdict);
@@ -221,8 +221,8 @@ Index: new/include/sysemu/sysemu.h
  int qemu_loadvm_state(QEMUFile *f);
 Index: new/monitor.c
 ===================================================================
---- new.orig/monitor.c 2013-12-04 10:48:06.000000000 +0100
-+++ new/monitor.c      2013-12-04 10:48:07.000000000 +0100
+--- new.orig/monitor.c 2013-12-06 07:46:38.000000000 +0100
++++ new/monitor.c      2013-12-06 08:59:22.000000000 +0100
 @@ -2908,6 +2908,13 @@
          .mhandler.cmd = hmp_info_migrate_cache_size,
      },
@@ -239,8 +239,8 @@ Index: new/monitor.c
          .params     = "",
 Index: new/qapi-schema.json
 ===================================================================
---- new.orig/qapi-schema.json  2013-12-04 10:48:06.000000000 +0100
-+++ new/qapi-schema.json       2013-12-04 10:48:07.000000000 +0100
+--- new.orig/qapi-schema.json  2013-12-06 08:57:27.000000000 +0100
++++ new/qapi-schema.json       2013-12-06 08:59:22.000000000 +0100
 @@ -740,6 +740,42 @@
             '*downtime': 'int',
             '*setup-time': 'int'} }
@@ -305,8 +305,8 @@ Index: new/qapi-schema.json
  #
 Index: new/qemu-options.hx
 ===================================================================
---- new.orig/qemu-options.hx   2013-12-04 10:07:06.000000000 +0100
-+++ new/qemu-options.hx        2013-12-04 10:48:07.000000000 +0100
+--- new.orig/qemu-options.hx   2013-12-06 07:46:38.000000000 +0100
++++ new/qemu-options.hx        2013-12-06 08:59:22.000000000 +0100
 @@ -2734,6 +2734,19 @@
  Start right away with a saved state (@code{loadvm} in monitor)
  ETEXI
@@ -329,8 +329,8 @@ Index: new/qemu-options.hx
      "-daemonize      daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
 Index: new/qmp-commands.hx
 ===================================================================
---- new.orig/qmp-commands.hx   2013-12-04 10:48:06.000000000 +0100
-+++ new/qmp-commands.hx        2013-12-04 10:48:07.000000000 +0100
+--- new.orig/qmp-commands.hx   2013-12-06 07:46:38.000000000 +0100
++++ new/qmp-commands.hx        2013-12-06 08:59:22.000000000 +0100
 @@ -3326,3 +3326,34 @@
  <- { "return": {} }
  
@@ -369,7 +369,7 @@ Index: new/qmp-commands.hx
 Index: new/savevm-async.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ new/savevm-async.c 2013-12-04 10:48:07.000000000 +0100
++++ new/savevm-async.c 2013-12-06 08:59:22.000000000 +0100
 @@ -0,0 +1,478 @@
 +#include "qemu-common.h"
 +#include "qapi/qmp/qerror.h"
@@ -851,8 +851,8 @@ Index: new/savevm-async.c
 +}
 Index: new/savevm.c
 ===================================================================
---- new.orig/savevm.c  2013-12-04 10:07:06.000000000 +0100
-+++ new/savevm.c       2013-12-04 10:48:07.000000000 +0100
+--- new.orig/savevm.c  2013-12-06 07:46:38.000000000 +0100
++++ new/savevm.c       2013-12-06 08:59:22.000000000 +0100
 @@ -1845,11 +1845,11 @@
      return false;
  }
@@ -903,8 +903,8 @@ Index: new/savevm.c
  uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size)
 Index: new/vl.c
 ===================================================================
---- new.orig/vl.c      2013-12-04 10:07:06.000000000 +0100
-+++ new/vl.c   2013-12-04 10:48:07.000000000 +0100
+--- new.orig/vl.c      2013-12-06 07:46:38.000000000 +0100
++++ new/vl.c   2013-12-06 08:59:22.000000000 +0100
 @@ -1643,6 +1643,7 @@
          info->name = g_strdup(m->name);
          info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;