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 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
##
# @backup:
Index: new/blockdev.c
===================================================================
---- new.orig/blockdev.c 2013-12-06 07:46:40.000000000 +0100
-+++ new/blockdev.c 2013-12-06 07:46:45.000000000 +0100
-@@ -1463,6 +1463,8 @@
+--- 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;
bool completed;
} PVEBackupDevInfo;
static void pvebackup_run_next_job(void);
-@@ -1534,8 +1536,11 @@
+@@ -1828,8 +1830,6 @@
+ {
+ PVEBackupDevInfo *di = opaque;
+- assert(backup_state.vmaw);
+-
di->completed = true;
+
+ if (ret < 0 && !backup_state.error) {
+@@ -1840,8 +1840,11 @@
+ BlockDriverState *bs = di->bs;
+
di->bs = NULL;
+ di->target = NULL;
+ vma_writer_close_stream(backup_state.vmaw, di->dev_id);
+ }
- if (!backup_state.cancel) {
- pvebackup_run_next_job();
-@@ -1610,6 +1615,7 @@
+ block_job_cb(bs, ret);
+
+@@ -1918,6 +1921,7 @@
bool has_speed, int64_t speed, Error **errp)
{
BlockDriverState *bs;
Error *local_err = NULL;
uuid_t uuid;
VmaWriter *vmaw = NULL;
-@@ -1626,11 +1632,6 @@
+@@ -1934,11 +1938,6 @@
/* Todo: try to auto-detect format based on file name */
format = has_format ? format : BACKUP_FORMAT_VMA;
if (has_devlist) {
devs = g_strsplit_set(devlist, ",;:", -1);
-@@ -1698,27 +1699,63 @@
+@@ -2006,27 +2005,63 @@
uuid_generate(uuid);
}
/* add configuration file to archive */
-@@ -1731,12 +1768,27 @@
+@@ -2039,12 +2074,27 @@
goto err;
}
+ }
+ } else if (format == BACKUP_FORMAT_DIR) {
+ char config_path[PATH_MAX];
-+ snprintf(config_path, PATH_MAX, "%s/%s.raw", backup_dir, basename);
++ snprintf(config_path, PATH_MAX, "%s/%s", backup_dir, basename);
+ if (!g_file_set_contents(config_path, cdata, clen, &err)) {
+ error_setg(errp, "unable to write config file '%s'", config_path);
+ g_free(cdata);
g_free(cdata);
}
-@@ -1776,10 +1828,11 @@
+@@ -2084,10 +2134,11 @@
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
if (local_err != NULL) {
error_setg(&backup_state.error, "backup_job_create failed");
pvebackup_cancel(NULL);
-@@ -1796,8 +1849,17 @@
+@@ -2104,8 +2155,17 @@
l = di_list;
while (l) {
}
g_list_free(di_list);
-@@ -1811,6 +1873,10 @@
+@@ -2119,6 +2179,10 @@
unlink(backup_file);
}
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 07:57:20.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 @@
{
- .help = "create a VM Backup.",
+ .args_type = "directory:-d,backupfile:s,speed:o?,devlist:s?",
+ .params = "[-d] backupfile [speed [devlist]]",
-+ .help = "create a VM Backup."
++ .help = "create a VM Backup."
+ "\n\t\t\t Use -d to dump data into a directory instead"
+ "\n\t\t\t of using VMA format.",
.mhandler.cmd = hmp_backup,
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 10:26:47.000000000 +0100
++++ new/hmp.c 2013-12-06 10:27:49.000000000 +0100
@@ -1245,11 +1245,13 @@
{
Error *error = NULL;