* [Qemu-devel] [PULL for-2.4 1/2] migration: Fix global state with Xen.
2015-08-03 16:19 [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen Stefano Stabellini
@ 2015-08-03 16:19 ` Stefano Stabellini
2015-08-03 16:19 ` [Qemu-devel] [PULL for-2.4 2/2] migration: Fix regression for xenfv and pc, accel=xen machine Stefano Stabellini
2015-08-03 17:52 ` [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2015-08-03 16:19 UTC (permalink / raw)
To: peter.maydell; +Cc: Anthony PERARD, xen-devel, qemu-devel, Stefano Stabellini
From: Anthony PERARD <anthony.perard@citrix.com>
When doing migration via the QMP command xen_save_devices_state, the
current runstate is not store into the global state section. Also the
current runstate is not the one we want on the receiver side.
During migration, the Xen toolstack paused QEMU before save the devices
state. Also, the toolstack expect QEMU to autostart when the migration is
finished.
So this patch store "running" as it's current runstate.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
include/migration/migration.h | 1 +
migration/migration.c | 7 +++++++
migration/savevm.c | 1 +
3 files changed, 9 insertions(+)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index a2f8ed0..8334621 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -203,4 +203,5 @@ void register_global_state(void);
void global_state_set_optional(void);
void savevm_skip_configuration(void);
int global_state_store(void);
+void global_state_store_running(void);
#endif
diff --git a/migration/migration.c b/migration/migration.c
index fd4f99b..662e77e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -122,6 +122,13 @@ int global_state_store(void)
return 0;
}
+void global_state_store_running(void)
+{
+ const char *state = RunState_lookup[RUN_STATE_RUNNING];
+ strncpy((char *)global_state.runstate,
+ state, sizeof(global_state.runstate));
+}
+
static bool global_state_received(void)
{
return global_state.received;
diff --git a/migration/savevm.c b/migration/savevm.c
index 81dbe58..6071215 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1394,6 +1394,7 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
saved_vm_running = runstate_is_running();
vm_stop(RUN_STATE_SAVE_VM);
+ global_state_store_running();
f = qemu_fopen(filename, "wb");
if (!f) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Qemu-devel] [PULL for-2.4 2/2] migration: Fix regression for xenfv and pc, accel=xen machine.
2015-08-03 16:19 [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen Stefano Stabellini
2015-08-03 16:19 ` [Qemu-devel] [PULL for-2.4 1/2] migration: Fix global state with Xen Stefano Stabellini
@ 2015-08-03 16:19 ` Stefano Stabellini
2015-08-03 17:52 ` [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2015-08-03 16:19 UTC (permalink / raw)
To: peter.maydell; +Cc: Anthony PERARD, xen-devel, qemu-devel, Stefano Stabellini
From: Anthony PERARD <anthony.perard@citrix.com>
This fix migration from the same QEMU version and from previous QEMU
version.
>From the global state section, we don't need runstate with Xen. Right now,
the way the Xen toolstack knows when QEMU is ready is when QEMU reach
"running" runstate.
The configuration section and the section footers are not going to be
present in previous version of QEMU with xenfv machine, so we skip them.
The Xen toolstack libxenlight does not specify a particular version of the
'pc' machine, so migration from older version of QEMU used by Xen to newer
one would break due to missing "configuration" section and section footers.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
xen-common.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen-common.c b/xen-common.c
index 56359ca..0dcdbc3 100644
--- a/xen-common.c
+++ b/xen-common.c
@@ -12,6 +12,7 @@
#include "qmp-commands.h"
#include "sysemu/char.h"
#include "sysemu/accel.h"
+#include "migration/migration.h"
//#define DEBUG_XEN
@@ -119,6 +120,10 @@ static int xen_init(MachineState *ms)
}
qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
+ global_state_set_optional();
+ savevm_skip_configuration();
+ savevm_skip_section_footers();
+
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen
2015-08-03 16:19 [Qemu-devel] [PULL for-2.4 0/2] Fix migration on Xen Stefano Stabellini
2015-08-03 16:19 ` [Qemu-devel] [PULL for-2.4 1/2] migration: Fix global state with Xen Stefano Stabellini
2015-08-03 16:19 ` [Qemu-devel] [PULL for-2.4 2/2] migration: Fix regression for xenfv and pc, accel=xen machine Stefano Stabellini
@ 2015-08-03 17:52 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-08-03 17:52 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel@lists.xensource.com Devel, QEMU Developers
On 3 August 2015 at 17:19, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> The following changes since commit f60c87154ac722c528fd5582f7137914a93c5eec:
>
> configure: Drop vnc-ws feature from help text (2015-08-03 15:32:17 +0100)
>
> are available in the git repository at:
>
> git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-migration-2.4-tag
>
> for you to fetch changes up to 8c6dc68f4cff9eef870497a19a5373dde9dbdcc2:
>
> migration: Fix regression for xenfv and pc,accel=xen machine. (2015-08-03 16:13:40 +0000)
>
> ----------------------------------------------------------------
> xen-migration-2.4
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread