aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2015-02-23 13:56:42 +0100
committerJuan Quintela <quintela@redhat.com>2015-03-16 14:35:20 +0100
commit9850c6047b8b4343e91da4780a41bb88faeb018a (patch)
treee3aafafa355915599863288dce6841401efe1e44 /savevm.c
parent1925cebc4b12903e3a66106893fd97e35c5d0baf (diff)
downloadqemu-arm-9850c6047b8b4343e91da4780a41bb88faeb018a.tar.gz
migration: Allow to suppress vmdesc submission
We now always send a JSON blob describing the migration file format as part of the migration stream. However, some tools built around QEMU have proven to stumble over this. This patch gives the user the chance to disable said self-describing part of the migration stream. To disable vmdesc submission, just add -machine suppress-vmdesc=on to your QEMU command line. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/savevm.c b/savevm.c
index 54510e9b8a..e7d97eea93 100644
--- a/savevm.c
+++ b/savevm.c
@@ -710,6 +710,12 @@ int qemu_savevm_state_iterate(QEMUFile *f)
return ret;
}
+static bool should_send_vmdesc(void)
+{
+ MachineState *machine = MACHINE(qdev_get_machine());
+ return !machine->suppress_vmdesc;
+}
+
void qemu_savevm_state_complete(QEMUFile *f)
{
QJSON *vmdesc;
@@ -782,9 +788,11 @@ void qemu_savevm_state_complete(QEMUFile *f)
qjson_finish(vmdesc);
vmdesc_len = strlen(qjson_get_str(vmdesc));
- qemu_put_byte(f, QEMU_VM_VMDESCRIPTION);
- qemu_put_be32(f, vmdesc_len);
- qemu_put_buffer(f, (uint8_t *)qjson_get_str(vmdesc), vmdesc_len);
+ if (should_send_vmdesc()) {
+ qemu_put_byte(f, QEMU_VM_VMDESCRIPTION);
+ qemu_put_be32(f, vmdesc_len);
+ qemu_put_buffer(f, (uint8_t *)qjson_get_str(vmdesc), vmdesc_len);
+ }
object_unref(OBJECT(vmdesc));
qemu_fflush(f);