From: Dietmar Maurer Date: Fri, 6 Dec 2013 09:32:46 +0000 (+0100) Subject: always set backup end time to mark backup as finished X-Git-Url: https://git.proxmox.com/?p=pve-qemu-kvm.git;a=commitdiff_plain;h=b38014b6ba573639f410e9c2117e874b46cf558b always set backup end time to mark backup as finished --- diff --git a/debian/patches/backup-add-dir-format.patch b/debian/patches/backup-add-dir-format.patch index 91b2f03..2a92799 100644 --- a/debian/patches/backup-add-dir-format.patch +++ b/debian/patches/backup-add-dir-format.patch @@ -1,7 +1,7 @@ Index: new/qapi-schema.json =================================================================== ---- new.orig/qapi-schema.json 2013-12-06 09:11:43.000000000 +0100 -+++ new/qapi-schema.json 2013-12-06 09:27:30.000000000 +0100 +--- new.orig/qapi-schema.json 2013-12-06 10:26:47.000000000 +0100 ++++ new/qapi-schema.json 2013-12-06 10:27:49.000000000 +0100 @@ -586,7 +586,7 @@ # @vma: Proxmox vma backup format ## @@ -13,8 +13,8 @@ Index: new/qapi-schema.json # @backup: Index: new/blockdev.c =================================================================== ---- new.orig/blockdev.c 2013-12-06 09:26:53.000000000 +0100 -+++ new/blockdev.c 2013-12-06 09:28:58.000000000 +0100 +--- new.orig/blockdev.c 2013-12-06 10:27:39.000000000 +0100 ++++ new/blockdev.c 2013-12-06 10:27:49.000000000 +0100 @@ -1760,6 +1760,8 @@ uint8_t dev_id; //bool started; @@ -24,7 +24,7 @@ Index: new/blockdev.c } PVEBackupDevInfo; static void pvebackup_run_next_job(void); -@@ -1827,8 +1829,6 @@ +@@ -1828,8 +1830,6 @@ { PVEBackupDevInfo *di = opaque; @@ -33,7 +33,7 @@ Index: new/blockdev.c di->completed = true; if (ret < 0 && !backup_state.error) { -@@ -1839,8 +1839,11 @@ +@@ -1840,8 +1840,11 @@ BlockDriverState *bs = di->bs; di->bs = NULL; @@ -46,7 +46,7 @@ Index: new/blockdev.c block_job_cb(bs, ret); -@@ -1917,6 +1920,7 @@ +@@ -1918,6 +1921,7 @@ bool has_speed, int64_t speed, Error **errp) { BlockDriverState *bs; @@ -54,7 +54,7 @@ Index: new/blockdev.c Error *local_err = NULL; uuid_t uuid; VmaWriter *vmaw = NULL; -@@ -1933,11 +1937,6 @@ +@@ -1934,11 +1938,6 @@ /* Todo: try to auto-detect format based on file name */ format = has_format ? format : BACKUP_FORMAT_VMA; @@ -66,7 +66,7 @@ Index: new/blockdev.c if (has_devlist) { devs = g_strsplit_set(devlist, ",;:", -1); -@@ -2005,27 +2004,63 @@ +@@ -2006,27 +2005,63 @@ uuid_generate(uuid); @@ -146,7 +146,7 @@ Index: new/blockdev.c } /* add configuration file to archive */ -@@ -2038,12 +2073,27 @@ +@@ -2039,12 +2074,27 @@ goto err; } @@ -179,7 +179,7 @@ Index: new/blockdev.c g_free(cdata); } -@@ -2083,10 +2133,11 @@ +@@ -2084,10 +2134,11 @@ PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data; l = g_list_next(l); @@ -192,7 +192,7 @@ Index: new/blockdev.c if (local_err != NULL) { error_setg(&backup_state.error, "backup_job_create failed"); pvebackup_cancel(NULL); -@@ -2103,8 +2154,17 @@ +@@ -2104,8 +2155,17 @@ l = di_list; while (l) { @@ -211,7 +211,7 @@ Index: new/blockdev.c } g_list_free(di_list); -@@ -2118,6 +2178,10 @@ +@@ -2119,6 +2179,10 @@ unlink(backup_file); } @@ -224,8 +224,8 @@ Index: new/blockdev.c Index: new/hmp-commands.hx =================================================================== ---- new.orig/hmp-commands.hx 2013-12-06 09:11:43.000000000 +0100 -+++ new/hmp-commands.hx 2013-12-06 09:27:30.000000000 +0100 +--- new.orig/hmp-commands.hx 2013-12-06 10:26:47.000000000 +0100 ++++ new/hmp-commands.hx 2013-12-06 10:27:49.000000000 +0100 @@ -85,9 +85,11 @@ { @@ -243,8 +243,8 @@ Index: new/hmp-commands.hx Index: new/hmp.c =================================================================== ---- new.orig/hmp.c 2013-12-06 09:11:43.000000000 +0100 -+++ new/hmp.c 2013-12-06 09:27:30.000000000 +0100 +--- new.orig/hmp.c 2013-12-06 10:26:47.000000000 +0100 ++++ new/hmp.c 2013-12-06 10:27:49.000000000 +0100 @@ -1245,11 +1245,13 @@ { Error *error = NULL; diff --git a/debian/patches/backup-add-pve-monitor-commands.patch b/debian/patches/backup-add-pve-monitor-commands.patch index 86695eb..8c04c9c 100644 --- a/debian/patches/backup-add-pve-monitor-commands.patch +++ b/debian/patches/backup-add-pve-monitor-commands.patch @@ -1,7 +1,7 @@ Index: new/blockdev.c =================================================================== --- new.orig/blockdev.c 2013-12-06 10:04:18.000000000 +0100 -+++ new/blockdev.c 2013-12-06 10:07:21.000000000 +0100 ++++ new/blockdev.c 2013-12-06 10:27:39.000000000 +0100 @@ -45,6 +45,7 @@ #include "qmp-commands.h" #include "trace.h" @@ -18,7 +18,7 @@ Index: new/blockdev.c static void eject_device(BlockDriverState *bs, int force, Error **errp) { if (bdrv_in_use(bs)) { -@@ -1736,6 +1736,436 @@ +@@ -1736,6 +1736,437 @@ bdrv_put_ref_bh_schedule(bs); } @@ -89,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); @@ -458,7 +459,7 @@ Index: new/blockdev.c Index: new/hmp-commands.hx =================================================================== --- new.orig/hmp-commands.hx 2013-12-03 06:36:18.000000000 +0100 -+++ new/hmp-commands.hx 2013-12-06 10:06:44.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 @@ -507,7 +508,7 @@ Index: new/hmp-commands.hx Index: new/hmp.c =================================================================== --- new.orig/hmp.c 2013-12-06 10:04:18.000000000 +0100 -+++ new/hmp.c 2013-12-06 10:06:44.000000000 +0100 ++++ new/hmp.c 2013-12-06 10:26:47.000000000 +0100 @@ -133,6 +133,44 @@ qapi_free_MouseInfoList(mice_list); } @@ -625,7 +626,7 @@ Index: new/monitor.c Index: new/qapi-schema.json =================================================================== --- new.orig/qapi-schema.json 2013-12-06 10:04:18.000000000 +0100 -+++ new/qapi-schema.json 2013-12-06 10:06:44.000000000 +0100 ++++ new/qapi-schema.json 2013-12-06 10:26:47.000000000 +0100 @@ -547,6 +547,95 @@ ## { 'command': 'query-events', 'returns': ['EventInfo'] }