===================================================================
--- new.orig/blockdev.c 2014-11-20 08:59:29.000000000 +0100
+++ new/blockdev.c 2014-11-20 09:04:05.000000000 +0100
-@@ -1979,6 +1979,8 @@
+@@ -2301,6 +2301,8 @@
uint8_t dev_id;
//bool started;
bool completed;
} PVEBackupDevInfo;
static void pvebackup_run_next_job(void);
-@@ -2047,8 +2049,6 @@
+@@ -2369,8 +2371,6 @@
{
PVEBackupDevInfo *di = opaque;
di->completed = true;
if (ret < 0 && !backup_state.error) {
-@@ -2059,8 +2059,11 @@
+@@ -2381,8 +2381,11 @@
BlockDriverState *bs = di->bs;
di->bs = NULL;
block_job_cb(bs, ret);
-@@ -2138,6 +2141,7 @@
+@@ -2461,6 +2464,7 @@
{
BlockBackend *blk;
BlockDriverState *bs = NULL;
Error *local_err = NULL;
uuid_t uuid;
VmaWriter *vmaw = NULL;
-@@ -2154,11 +2158,6 @@
+@@ -2478,11 +2482,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);
-@@ -2225,27 +2224,63 @@
+@@ -2551,27 +2550,63 @@
uuid_generate(uuid);
}
/* add configuration file to archive */
-@@ -2258,12 +2293,27 @@
+@@ -2584,12 +2619,27 @@
goto err;
}
g_free(cdata);
}
-@@ -2303,10 +2353,11 @@
+@@ -2629,10 +2679,11 @@
PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
l = g_list_next(l);
-- backup_start(di->bs, NULL, speed, MIRROR_SYNC_MODE_FULL,
-+ backup_start(di->bs, di->target, speed, MIRROR_SYNC_MODE_FULL,
+- backup_start(di->bs, NULL, speed, MIRROR_SYNC_MODE_FULL, NULL,
++ backup_start(di->bs, di->target, speed, MIRROR_SYNC_MODE_FULL, NULL,
BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
pvebackup_dump_cb, pvebackup_complete_cb, di,
true, &local_err);
if (local_err != NULL) {
error_setg(&backup_state.error, "backup_job_create failed");
pvebackup_cancel(NULL);
-@@ -2323,8 +2374,17 @@
+@@ -2651,8 +2702,17 @@
l = di_list;
while (l) {
}
g_list_free(di_list);
-@@ -2338,6 +2398,10 @@
+@@ -2666,6 +2726,10 @@
unlink(backup_file);
}
===================================================================
--- new.orig/hmp-commands.hx 2014-11-20 08:59:29.000000000 +0100
+++ new/hmp-commands.hx 2014-11-20 09:03:23.000000000 +0100
-@@ -90,9 +90,11 @@
+@@ -89,9 +89,11 @@
{
.name = "backup",
===================================================================
--- new.orig/hmp.c 2014-11-20 08:59:29.000000000 +0100
+++ new/hmp.c 2014-11-20 09:03:23.000000000 +0100
-@@ -1264,11 +1264,13 @@
+@@ -1459,11 +1459,13 @@
{
Error *error = NULL;
===================================================================
--- new.orig/blockdev.c 2014-11-20 07:36:12.000000000 +0100
+++ new/blockdev.c 2014-11-20 07:47:31.000000000 +0100
-@@ -46,6 +46,7 @@
+@@ -49,6 +49,7 @@
#include "qmp-commands.h"
#include "trace.h"
#include "sysemu/arch_init.h"
static const char *const if_name[IF_COUNT] = {
[IF_NONE] = "none",
-@@ -1954,6 +1955,440 @@
+@@ -2276,6 +2277,443 @@
bdrv_put_ref_bh_schedule(bs);
}
+ gchar **devs = NULL;
+ GList *di_list = NULL;
+ GList *l;
++ UuidInfo *uuid_info;
+
+ if (backup_state.di_list) {
+ error_set(errp, ERROR_CLASS_GENERIC_ERROR,
+ PVEBackupDevInfo *di = (PVEBackupDevInfo *)l->data;
+ l = g_list_next(l);
+
-+ backup_start(di->bs, NULL, speed, MIRROR_SYNC_MODE_FULL,
++ backup_start(di->bs, NULL, speed, MIRROR_SYNC_MODE_FULL, NULL,
+ BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
+ pvebackup_dump_cb, pvebackup_complete_cb, di,
+ true, &local_err);
+ pvebackup_run_next_job(); // run one job
+ }
+
-+ return g_strdup(backup_state.uuid_str);
++ uuid_info = g_malloc0(sizeof(*uuid_info));
++ uuid_info->UUID = g_strdup(backup_state.uuid_str);
++ return uuid_info;
+
+err:
+
===================================================================
--- new.orig/hmp-commands.hx 2014-11-20 06:45:05.000000000 +0100
+++ new/hmp-commands.hx 2014-11-20 07:47:31.000000000 +0100
-@@ -88,6 +88,35 @@
+@@ -87,6 +87,35 @@
Copy data from a backing file into a block device.
ETEXI
{
.name = "block_job_set_speed",
.args_type = "device:B,speed:o",
-@@ -1760,6 +1789,8 @@
+@@ -1768,6 +1797,8 @@
show CPU statistics
@item info usernet
show user network stack connection states
===================================================================
--- new.orig/hmp.c 2014-11-20 07:26:23.000000000 +0100
+++ new/hmp.c 2014-11-20 07:47:31.000000000 +0100
-@@ -137,6 +137,44 @@
+@@ -145,6 +145,44 @@
qapi_free_MouseInfoList(mice_list);
}
void hmp_info_migrate(Monitor *mon, const QDict *qdict)
{
MigrationInfo *info;
-@@ -1212,6 +1250,29 @@
+@@ -1407,6 +1445,29 @@
hmp_handle_error(mon, &error);
}
===================================================================
--- new.orig/hmp.h 2014-11-20 06:45:05.000000000 +0100
+++ new/hmp.h 2014-11-20 07:47:31.000000000 +0100
-@@ -29,6 +29,7 @@
+@@ -30,6 +30,7 @@
void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
void hmp_info_cpus(Monitor *mon, const QDict *qdict);
void hmp_info_block(Monitor *mon, const QDict *qdict);
void hmp_info_blockstats(Monitor *mon, const QDict *qdict);
-@@ -70,6 +71,8 @@
+@@ -74,6 +75,8 @@
void hmp_change(Monitor *mon, const QDict *qdict);
void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict);
void hmp_block_stream(Monitor *mon, const QDict *qdict);
===================================================================
--- new.orig/monitor.c 2014-11-20 06:45:06.000000000 +0100
+++ new/monitor.c 2014-11-20 07:47:31.000000000 +0100
-@@ -2848,6 +2848,13 @@
+@@ -2759,6 +2759,13 @@
},
#endif
{
===================================================================
--- new.orig/qmp-commands.hx 2014-11-20 07:26:23.000000000 +0100
+++ new/qmp-commands.hx 2014-11-20 07:47:31.000000000 +0100
-@@ -1097,6 +1097,24 @@
+@@ -1203,6 +1203,24 @@
EQMP
{
===================================================================
--- new.orig/block/backup.c 2014-11-20 07:55:31.000000000 +0100
+++ new/block/backup.c 2014-11-20 08:56:23.000000000 +0100
-@@ -39,6 +39,7 @@
+@@ -42,6 +42,7 @@
BdrvDirtyBitmap *sync_bitmap;
MirrorSyncMode sync_mode;
RateLimit limit;
BlockdevOnError on_source_error;
BlockdevOnError on_target_error;
CoRwlock flush_rwlock;
-@@ -136,14 +137,21 @@
+@@ -139,14 +140,21 @@
goto out;
}
}
if (ret < 0) {
trace_backup_do_cow_write_fail(job, start, ret);
-@@ -205,7 +213,9 @@
+@@ -208,7 +216,9 @@
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common);
}
static const BlockJobDriver backup_job_driver = {
-@@ -221,9 +231,11 @@
+@@ -224,9 +234,11 @@
if (read) {
return block_job_error_action(&job->common, job->common.bs,
job->on_source_error, true, error);
}
}
-@@ -264,9 +276,11 @@
+@@ -351,9 +363,11 @@
job->bitmap = hbitmap_alloc(end, 0);
bdrv_add_before_write_notifier(bs, &before_write);
-@@ -359,8 +373,10 @@
+@@ -443,8 +461,10 @@
}
hbitmap_free(job->bitmap);
data = g_malloc(sizeof(*data));
data->ret = ret;
-@@ -370,13 +386,15 @@ for backup_start
+@@ -456,13 +472,15 @@ for backup_start
BdrvDirtyBitmap *sync_bitmap,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
assert(cb);
if (bs == target) {
-@@ -419,7 +437,7 @@ in backup_start
+@@ -483,7 +501,7 @@ in backup_start
return;
}
error_setg(errp, "Device is not inserted: %s",
bdrv_get_device_name(target));
return;
-@@ -429,7 +447,7 @@ in backup_start
+@@ -493,7 +511,7 @@ in backup_start
return;
}
return;
}
-@@ -397,14 +415,17 @@ in backup_start
+@@ -529,14 +547,17 @@ in backup_start
goto error;
}
===================================================================
--- new.orig/blockdev.c 2014-11-20 07:55:31.000000000 +0100
+++ new/blockdev.c 2014-11-20 08:48:02.000000000 +0100
-@@ -2223,8 +2223,8 @@ qmp_drive_backup
+@@ -2571,8 +2571,8 @@ qmp_drive_backup
}
backup_start(bs, target_bs, speed, sync, bmap,
if (local_err != NULL) {
bdrv_unref(target_bs);
error_propagate(errp, local_err);
-@@ -2284,7 +2284,7 @@ qmp_blockdev_backup
+@@ -2633,7 +2633,7 @@ qmp_blockdev_backup
bdrv_ref(target_bs);
bdrv_set_aio_context(target_bs, aio_context);
backup_start(bs, target_bs, speed, sync, NULL, on_source_error,
===================================================================
--- new.orig/include/block/block_int.h 2014-11-20 07:55:31.000000000 +0100
+++ new/include/block/block_int.h 2014-11-20 08:52:59.000000000 +0100
-@@ -57,6 +57,9 @@
+@@ -59,6 +59,9 @@
#define BLOCK_PROBE_BUF_SIZE 512
typedef struct BdrvTrackedRequest {
BlockDriverState *bs;
int64_t offset;
-@@ -583,7 +586,9 @@
+@@ -651,7 +654,9 @@
BdrvDirtyBitmap *sync_bitmap,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,