summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-13 03:12:02 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-13 03:12:02 +0000
commit5bb7910af031cce09cc619b982d39dc889776f65 (patch)
tree9372820c2f7fd94b418be295e995ebfe4a5db587 /vl.c
parent39b65c2e315ad5565e22b98ea2a4498ec2edfad2 (diff)
downloadqemu-5bb7910af031cce09cc619b982d39dc889776f65.tar.gz
Introduce UI for live migration
This patch introduces a command line parameter and monitor command for starting a live migration. The next patch will provide an example of how to use these parameters. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5476 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index c31f972aa0..190a408014 100644
--- a/vl.c
+++ b/vl.c
@@ -38,6 +38,7 @@
#include "qemu-char.h"
#include "block.h"
#include "audio/audio.h"
+#include "migration.h"
#include <unistd.h>
#include <fcntl.h>
@@ -3364,7 +3365,6 @@ static void udp_chr_update_read_handler(CharDriverState *chr)
}
}
-int parse_host_port(struct sockaddr_in *saddr, const char *str);
#ifndef _WIN32
static int parse_unix_path(struct sockaddr_un *uaddr, const char *str);
#endif
@@ -6766,6 +6766,8 @@ int qemu_savevm_state(QEMUFile *f)
saved_vm_running = vm_running;
vm_stop(0);
+ bdrv_flush_all();
+
ret = qemu_savevm_state_begin(f);
if (ret < 0)
goto out;
@@ -8338,6 +8340,7 @@ enum {
QEMU_OPTION_tb_size,
QEMU_OPTION_icount,
QEMU_OPTION_uuid,
+ QEMU_OPTION_incoming,
};
typedef struct QEMUOption {
@@ -8450,6 +8453,7 @@ static const QEMUOption qemu_options[] = {
{ "startdate", HAS_ARG, QEMU_OPTION_startdate },
{ "tb-size", HAS_ARG, QEMU_OPTION_tb_size },
{ "icount", HAS_ARG, QEMU_OPTION_icount },
+ { "incoming", HAS_ARG, QEMU_OPTION_incoming },
{ NULL },
};
@@ -8742,6 +8746,7 @@ int main(int argc, char **argv)
const char *pid_file = NULL;
VLANState *vlan;
int autostart;
+ const char *incoming = NULL;
LIST_INIT (&vm_change_state_head);
#ifndef _WIN32
@@ -9349,6 +9354,9 @@ int main(int argc, char **argv)
icount_time_shift = strtol(optarg, NULL, 0);
}
break;
+ case QEMU_OPTION_incoming:
+ incoming = optarg;
+ break;
}
}
}
@@ -9691,6 +9699,11 @@ int main(int argc, char **argv)
if (loadvm)
do_loadvm(loadvm);
+ if (incoming) {
+ autostart = 0; /* fixme how to deal with -daemonize */
+ qemu_start_incoming_migration(incoming);
+ }
+
{
/* XXX: simplify init */
read_passwords();