]> git.proxmox.com Git - pve-qemu-kvm.git/blobdiff - debian/patches/backup-add-pve-monitor-commands.patch
always set backup end time to mark backup as finished
[pve-qemu-kvm.git] / debian / patches / backup-add-pve-monitor-commands.patch
index 31f745a11f5d26c13a25b0ad740f286b39fab77b..8c04c9c55961bde39a77578abc9b95d3c411569b 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 10:04:18.000000000 +0100
++++ new/blockdev.c     2013-12-06 10:27:39.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,437 @@
+     bdrv_put_ref_bh_schedule(bs);
+ }
 +/* PVE backup related function */
 +
 +static struct PVEBackupState {
@@ -81,8 +89,9 @@ Index: new/blockdev.c
 +
 +static void pvebackup_cleanup(void)
 +{
++    backup_state.end_time = time(NULL);
++
 +    if (backup_state.vmaw) {
-+        backup_state.end_time = time(NULL);
 +        Error *local_err = NULL;
 +        vma_writer_close(backup_state.vmaw, &local_err);
 +        error_propagate(&backup_state.error, local_err);
@@ -108,10 +117,20 @@ Index: new/blockdev.c
 +    assert(backup_state.vmaw);
 +
 +    di->completed = true;
++
++    if (ret < 0 && !backup_state.error) {
++        error_setg(&backup_state.error, "job failed with err %d - %s",
++                   ret, strerror(-ret));
++    }
++
++    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 +452,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 10:26:47.000000000 +0100
 @@ -83,6 +83,35 @@
  Copy data from a backing file into a block device.
  ETEXI
@@ -487,8 +507,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 10:04:18.000000000 +0100
++++ new/hmp.c  2013-12-06 10:26:47.000000000 +0100
 @@ -133,6 +133,44 @@
      qapi_free_MouseInfoList(mice_list);
  }
@@ -566,8 +586,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 10:04:22.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 +607,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 10:04:22.000000000 +0100
 @@ -2880,6 +2880,13 @@
      },
  #endif
@@ -605,8 +625,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 10:04:18.000000000 +0100
++++ new/qapi-schema.json       2013-12-06 10:26:47.000000000 +0100
 @@ -547,6 +547,95 @@
  ##
  { 'command': 'query-events', 'returns': ['EventInfo'] }
@@ -705,8 +725,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 10:04:18.000000000 +0100
++++ new/qmp-commands.hx        2013-12-06 10:04:22.000000000 +0100
 @@ -966,6 +966,24 @@
  EQMP