Index: new/Makefile
===================================================================
---- new.orig/Makefile 2013-11-29 08:45:24.000000000 +0100
-+++ new/Makefile 2013-11-29 12:25:23.000000000 +0100
+--- new.orig/Makefile 2013-12-04 10:45:30.000000000 +0100
++++ new/Makefile 2013-12-04 10:45:45.000000000 +0100
@@ -128,7 +128,7 @@
include $(SRC_PATH)/libcacard/Makefile
endif
Index: new/docs/specs/vma_spec.txt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/docs/specs/vma_spec.txt 2013-11-29 10:08:41.000000000 +0100
++++ new/docs/specs/vma_spec.txt 2013-12-04 10:45:45.000000000 +0100
@@ -0,0 +1,24 @@
+=Virtual Machine Archive format (VMA)=
+
Index: new/vma-reader.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-reader.c 2013-11-29 12:10:53.000000000 +0100
++++ new/vma-reader.c 2013-12-04 10:45:45.000000000 +0100
@@ -0,0 +1,799 @@
+/*
+ * VMA: Virtual Machine Archive
Index: new/vma-writer.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma-writer.c 2013-11-29 10:19:59.000000000 +0100
++++ new/vma-writer.c 2013-12-04 10:45:45.000000000 +0100
@@ -0,0 +1,872 @@
+/*
+ * VMA: Virtual Machine Archive
Index: new/vma.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.c 2013-11-29 12:10:53.000000000 +0100
-@@ -0,0 +1,623 @@
++++ new/vma.c 2013-12-04 10:47:35.000000000 +0100
+@@ -0,0 +1,579 @@
+/*
+ * VMA: Virtual Machine Archive
+ *
+ uint8_t dev_id;
+} BackupJob;
+
-+/*
-+static int backup_dump_cb(void *opaque, BlockDriverState *bs,
-+ int64_t cluster_num, unsigned char *buf)
-+{
-+ BackupCB *bcb = opaque;
-+ size_t zb = 0;
-+ if (vma_writer_write(bcb->vmaw, bcb->dev_id, cluster_num, buf, &zb) < 0) {
-+ g_warning("backup_dump_cb vma_writer_write failed");
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+static void backup_complete_cb(void *opaque, int ret)
-+{
-+ BackupCB *bcb = opaque;
-+
-+ if (ret < 0) {
-+ vma_writer_set_error(bcb->vmaw, "backup_complete_cb %d", ret);
-+ }
-+
-+ if (vma_writer_close_stream(bcb->vmaw, bcb->dev_id) <= 0) {
-+ Error *err = NULL;
-+ if (vma_writer_close(bcb->vmaw, &err) != 0) {
-+ g_warning("vma_writer_close failed %s", error_get_pretty(err));
-+ }
-+ }
-+}
-+*/
-+
+#define BACKUP_SECTORS_PER_CLUSTER (VMA_CLUSTER_SIZE / BDRV_SECTOR_SIZE)
+
+static void coroutine_fn backup_run(void *opaque)
+
+ Coroutine *co = qemu_coroutine_create(backup_run);
+ qemu_coroutine_enter(co, job);
-+
-+ //BlockDriverState *target = NULL;
-+ //backup_start(bs, target, 0, MIRROR_SYNC_MODE_FULL,
-+ // BLOCKDEV_ON_ERROR_STOP, BLOCKDEV_ON_ERROR_STOP,
-+ // NULL, bcb, &errp);
-+
-+ //if (backup_job_create(bs, backup_dump_cb, backup_complete_cb,
-+ // bcb, 0) < 0) {
-+ // unlink(archivename);
-+ // g_error("backup_job_start failed");
-+ //} else {
-+ // backup_job_start(bs, false);
-+ // }
+ }
+
+ VmaStatus vmastat;
Index: new/vma.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ new/vma.h 2013-11-29 12:10:53.000000000 +0100
++++ new/vma.h 2013-12-04 10:45:45.000000000 +0100
@@ -0,0 +1,144 @@
+/*
+ * VMA: Virtual Machine Archive
+#endif /* BACKUP_VMA_H */
Index: new/Makefile.objs
===================================================================
---- new.orig/Makefile.objs 2013-11-29 12:10:45.000000000 +0100
-+++ new/Makefile.objs 2013-11-29 12:24:55.000000000 +0100
+--- new.orig/Makefile.objs 2013-12-04 10:45:30.000000000 +0100
++++ new/Makefile.objs 2013-12-04 10:45:45.000000000 +0100
@@ -14,6 +14,7 @@
block-obj-y += block/
block-obj-y += qapi-types.o qapi-visit.o
14 files changed, 692 insertions(+), 7 deletions(-)
create mode 100644 savevm-async.c
-diff --git a/Makefile.objs b/Makefile.objs
-index 2b6c1fe..cce2562 100644
---- a/Makefile.objs
-+++ b/Makefile.objs
-@@ -55,6 +55,7 @@ common-obj-$(CONFIG_RDMA) += migration-rdma.o
+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
+@@ -56,6 +56,7 @@
common-obj-y += qemu-char.o #aio.o
common-obj-y += block-migration.o
common-obj-y += page_cache.o xbzrle.o
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
-diff --git a/block.c b/block.c
-index 382ea71..249cb82 100644
---- a/block.c
-+++ b/block.c
-@@ -1710,7 +1710,7 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
+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
+@@ -1710,7 +1710,7 @@
bs_new->drv ? bs_new->drv->format_name : "");
}
{
assert(!bs->dev);
assert(!bs->job);
-diff --git a/hmp-commands.hx b/hmp-commands.hx
-index caae5ad..5dbe6d0 100644
---- a/hmp-commands.hx
-+++ b/hmp-commands.hx
-@@ -1698,6 +1698,8 @@ show migration status
+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 @@
show current migration capabilities
@item info migrate_cache_size
show current migration XBZRLE cache size
@item info balloon
show balloon information
@item info qtree
-@@ -1719,3 +1721,35 @@ ETEXI
+@@ -1750,3 +1752,35 @@
STEXI
@end table
ETEXI
+ .help = "Resume VM after snaphot.",
+ .mhandler.cmd = hmp_savevm_end,
+ },
-diff --git a/hmp.c b/hmp.c
-index c2efa8d..60d6a8e 100644
---- a/hmp.c
-+++ b/hmp.c
-@@ -1592,3 +1592,60 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
+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
+@@ -1655,3 +1655,60 @@
hmp_handle_error(mon, &err);
}
+ monitor_printf(mon, "Error: %s\n", info->error);
+ }
+}
-diff --git a/hmp.h b/hmp.h
-index 54cf71f..bcc1cb6 100644
---- a/hmp.h
-+++ b/hmp.h
-@@ -25,6 +25,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict);
+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
+@@ -25,6 +25,7 @@
void hmp_info_uuid(Monitor *mon, const QDict *qdict);
void hmp_info_chardev(Monitor *mon, const QDict *qdict);
void hmp_info_mice(Monitor *mon, const QDict *qdict);
void hmp_info_migrate(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict);
void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict);
-@@ -81,6 +82,10 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict);
+@@ -84,6 +85,10 @@
void hmp_netdev_del(Monitor *mon, const QDict *qdict);
void hmp_getfd(Monitor *mon, const QDict *qdict);
void hmp_closefd(Monitor *mon, const QDict *qdict);
void hmp_send_key(Monitor *mon, const QDict *qdict);
void hmp_screen_dump(Monitor *mon, const QDict *qdict);
void hmp_nbd_server_start(Monitor *mon, const QDict *qdict);
-diff --git a/include/block/block.h b/include/block/block.h
-index 3560deb..22c06bb 100644
---- a/include/block/block.h
-+++ b/include/block/block.h
-@@ -214,6 +214,7 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs,
+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
+@@ -214,6 +214,7 @@
const char *backing_file);
int bdrv_get_backing_file_depth(BlockDriverState *bs);
int bdrv_truncate(BlockDriverState *bs, int64_t offset);
int64_t bdrv_getlength(BlockDriverState *bs);
int64_t bdrv_get_allocated_file_size(BlockDriverState *bs);
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
-diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
-index 495dae8..d2bb686 100644
---- a/include/sysemu/sysemu.h
-+++ b/include/sysemu/sysemu.h
-@@ -73,16 +73,17 @@ void qemu_add_machine_init_done_notifier(Notifier *notify);
+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
+@@ -73,16 +73,17 @@
void do_savevm(Monitor *mon, const QDict *qdict);
int load_vmstate(const char *name);
void qemu_savevm_state_cancel(void);
uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size);
int qemu_loadvm_state(QEMUFile *f);
-diff --git a/monitor.c b/monitor.c
-index 845f608..30cc965 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -2901,6 +2901,13 @@ static mon_cmd_t info_cmds[] = {
+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
+@@ -2908,6 +2908,13 @@
.mhandler.cmd = hmp_info_migrate_cache_size,
},
{
.name = "balloon",
.args_type = "",
.params = "",
-diff --git a/qapi-schema.json b/qapi-schema.json
-index 7a36e99..1faf622 100644
---- a/qapi-schema.json
-+++ b/qapi-schema.json
-@@ -651,6 +651,42 @@
+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
+@@ -740,6 +740,42 @@
'*downtime': 'int',
'*setup-time': 'int'} }
##
# @query-migrate
#
-@@ -3347,8 +3383,18 @@
+@@ -3436,8 +3472,18 @@
#
# Since: 1.2.0
##
##
# @QKeyCode:
#
-diff --git a/qemu-options.hx b/qemu-options.hx
-index 51b1cd0..a2834da 100644
---- a/qemu-options.hx
-+++ b/qemu-options.hx
-@@ -2734,6 +2734,19 @@ STEXI
+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
+@@ -2734,6 +2734,19 @@
Start right away with a saved state (@code{loadvm} in monitor)
ETEXI
#ifndef _WIN32
DEF("daemonize", 0, QEMU_OPTION_daemonize, \
"-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
-diff --git a/qmp-commands.hx b/qmp-commands.hx
-index 5584fe2..90a0d71 100644
---- a/qmp-commands.hx
-+++ b/qmp-commands.hx
-@@ -3308,3 +3308,34 @@ Example (2):
+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
+@@ -3326,3 +3326,34 @@
<- { "return": {} }
EQMP
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_savevm,
+ },
-diff --git a/savevm-async.c b/savevm-async.c
-new file mode 100644
-index 0000000..64768b1
---- /dev/null
-+++ b/savevm-async.c
+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
@@ -0,0 +1,478 @@
+#include "qemu-common.h"
+#include "qapi/qmp/qerror.h"
+ }
+ return ret;
+}
-diff --git a/savevm.c b/savevm.c
-index 3f912dd..9ca3309 100644
---- a/savevm.c
-+++ b/savevm.c
-@@ -1845,11 +1845,11 @@ bool qemu_savevm_state_blocked(Error **errp)
+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
+@@ -1845,11 +1845,11 @@
return false;
}
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
if (!se->ops || !se->ops->set_params) {
-@@ -1890,6 +1890,7 @@ void qemu_savevm_state_begin(QEMUFile *f,
+@@ -1890,6 +1890,7 @@
break;
}
}
}
/*
-@@ -1937,7 +1938,7 @@ int qemu_savevm_state_iterate(QEMUFile *f)
+@@ -1937,7 +1938,7 @@
return ret;
}
{
SaveStateEntry *se;
int ret;
-@@ -1962,7 +1963,7 @@ void qemu_savevm_state_complete(QEMUFile *f)
+@@ -1962,7 +1963,7 @@
trace_savevm_section_end(se->section_id);
if (ret < 0) {
qemu_file_set_error(f, ret);
}
}
-@@ -1991,6 +1992,7 @@ void qemu_savevm_state_complete(QEMUFile *f)
+@@ -1991,6 +1992,7 @@
qemu_put_byte(f, QEMU_VM_EOF);
qemu_fflush(f);
}
uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size)
-diff --git a/vl.c b/vl.c
-index 16540f6..1b39acf 100644
---- a/vl.c
-+++ b/vl.c
-@@ -1643,6 +1643,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
+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
+@@ -1643,6 +1643,7 @@
info->name = g_strdup(m->name);
info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;
if (strcmp(m->name, current_machine->name) == 0) {
info->has_is_current = true;
info->is_current = true;
-@@ -2842,6 +2843,7 @@ int main(int argc, char **argv, char **envp)
+@@ -2842,6 +2843,7 @@
int optind;
const char *optarg;
const char *loadvm = NULL;
QEMUMachine *machine;
const char *cpu_model;
const char *vga_model = "none";
-@@ -3455,6 +3457,9 @@ int main(int argc, char **argv, char **envp)
+@@ -3455,6 +3457,9 @@
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
case QEMU_OPTION_full_screen:
full_screen = 1;
break;
-@@ -4406,6 +4411,10 @@ int main(int argc, char **argv, char **envp)
+@@ -4406,6 +4411,10 @@
if (load_vmstate(loadvm) < 0) {
autostart = 0;
}
}
if (incoming) {
---
-1.7.10.4
-