[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] Continue a migrated vm is a bad idea
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 6/6] Continue a migrated vm is a bad idea |
Date: |
Wed, 19 Aug 2009 04:07:49 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 1 +
monitor.c | 6 ++++++
sysemu.h | 1 +
vl.c | 1 +
4 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/migration.c b/migration.c
index ee64d41..f91401e 100644
--- a/migration.c
+++ b/migration.c
@@ -275,6 +275,7 @@ void migrate_fd_put_ready(void *opaque)
state = MIG_STATE_ERROR;
} else {
state = MIG_STATE_COMPLETED;
+ vm_has_migrated = 1;
}
migrate_fd_cleanup(s);
s->state = state;
diff --git a/monitor.c b/monitor.c
index ea5c33a..762a9a5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -567,6 +567,11 @@ static void do_cont(Monitor *mon)
{
struct bdrv_iterate_context context = { mon, 0 };
+ if (unlikely(vm_has_migrated)) {
+ monitor_printf(mon, "this vm has migrated to other machine\n");
+ monitor_printf(mon, "You have to load other vm\n");
+ return;
+ }
bdrv_iterate(encrypted_bdrv_it, &context);
/* only resume the vm if all keys are set and valid */
if (!context.err)
@@ -1780,6 +1785,7 @@ static void do_loadvm(Monitor *mon, const char *name)
{
int saved_vm_running = vm_running;
+ vm_has_migrated = 0;
vm_stop(0);
if (load_vmstate(mon, name) >= 0 && saved_vm_running)
diff --git a/sysemu.h b/sysemu.h
index e0338ce..7c3fdc1 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -18,6 +18,7 @@ extern const char *bios_name;
char *qemu_find_file(int type, const char *name);
extern int vm_running;
+extern int vm_has_migrated;
extern const char *qemu_name;
extern uint8_t qemu_uuid[];
int qemu_uuid_parse(const char *str, uint8_t *uuid);
diff --git a/vl.c b/vl.c
index bf2468e..d39295a 100644
--- a/vl.c
+++ b/vl.c
@@ -188,6 +188,7 @@ ram_addr_t ram_size;
int nb_nics;
NICInfo nd_table[MAX_NICS];
int vm_running;
+int vm_has_migrated;
int autostart;
static int rtc_utc = 1;
static int rtc_date_offset = -1; /* -1 means no change */
--
1.6.2.5
[Qemu-devel] [PATCH 3/6] split do_loadvm() into do_loadvm() and load_vmstate(), Juan Quintela, 2009/08/18
[Qemu-devel] [PATCH 5/6] make load_vmstate() return errors, Juan Quintela, 2009/08/18