* [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen
@ 2015-08-03 12:44 Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 1/3] migration: Fix regretion for xenfv machine Amit Shah
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Amit Shah @ 2015-08-03 12:44 UTC (permalink / raw)
To: qemu list; +Cc: Amit Shah, Peter Maydell
The following changes since commit cb48f67ad8c7b33c617d4f8144a27706e69fd688:
bsd-user: Fix operand to cpu_x86_exec (2015-07-30 12:38:49 +0100)
are available in the git repository at:
https://git.kernel.org/pub/scm/qemu/amit/migration for-2.4
for you to fetch changes up to 040f70812f1fc2523945a047982694d1ef1d9e1d:
migration: Add configuration section to vmstate with xen. (2015-08-03 11:42:39 +0530)
----------------------------------------------------------------
Fixes a regression with migration for the Xen machine type
----------------------------------------------------------------
Anthony PERARD (3):
migration: Fix regretion for xenfv machine.
migration: Fix global state with Xen.
migration: Add configuration section to vmstate with xen.
hw/i386/pc_piix.c | 3 +++
include/migration/migration.h | 1 +
migration/migration.c | 7 +++++++
migration/savevm.c | 6 ++++++
4 files changed, 17 insertions(+)
--
2.4.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL for-2.4 1/3] migration: Fix regretion for xenfv machine.
2015-08-03 12:44 [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Amit Shah
@ 2015-08-03 12:44 ` Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen Amit Shah
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Amit Shah @ 2015-08-03 12:44 UTC (permalink / raw)
To: qemu list; +Cc: Anthony PERARD, Peter Maydell, Amit Shah, Anthony PERARD
From: Anthony PERARD <anthony.perard@gmail.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 sectin and the section footers are not going to be
present in previous version of QEMU with xenfv machine, so we skip them.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <1438098885-4339-2-git-send-email-anthony.perard@citrix.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/i386/pc_piix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a896624..b18758d 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -455,6 +455,9 @@ static void pc_xen_hvm_init(MachineState *machine)
if (bus != NULL) {
pci_create_simple(bus, -1, "xen-platform");
}
+ global_state_set_optional();
+ savevm_skip_configuration();
+ savevm_skip_section_footers();
}
#endif
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen.
2015-08-03 12:44 [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 1/3] migration: Fix regretion for xenfv machine Amit Shah
@ 2015-08-03 12:44 ` Amit Shah
2015-08-03 12:50 ` Dr. David Alan Gilbert
2015-08-03 12:45 ` [Qemu-devel] [PULL for-2.4 3/3] migration: Add configuration section to vmstate with xen Amit Shah
2015-08-03 13:09 ` [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Anthony PERARD
3 siblings, 1 reply; 6+ messages in thread
From: Amit Shah @ 2015-08-03 12:44 UTC (permalink / raw)
To: qemu list; +Cc: Anthony PERARD, Peter Maydell, Amit Shah, Anthony PERARD
From: Anthony PERARD <anthony.perard@gmail.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>
Message-Id: <1438098885-4339-3-git-send-email-anthony.perard@citrix.com>
Signed-off-by: Amit Shah <amit.shah@redhat.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..175a397 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];
+ memcpy((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) {
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL for-2.4 3/3] migration: Add configuration section to vmstate with xen.
2015-08-03 12:44 [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 1/3] migration: Fix regretion for xenfv machine Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen Amit Shah
@ 2015-08-03 12:45 ` Amit Shah
2015-08-03 13:09 ` [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Anthony PERARD
3 siblings, 0 replies; 6+ messages in thread
From: Amit Shah @ 2015-08-03 12:45 UTC (permalink / raw)
To: qemu list; +Cc: Anthony PERARD, Peter Maydell, Amit Shah, Anthony PERARD
From: Anthony PERARD <anthony.perard@gmail.com>
This adds the configuration section in the vmstate saved by
xen_save_devices_state.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <1438098885-4339-4-git-send-email-anthony.perard@citrix.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
migration/savevm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index 6071215..b3f605c 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -961,6 +961,11 @@ static int qemu_save_device_state(QEMUFile *f)
cpu_synchronize_all_states();
+ if (!savevm_state.skip_configuration) {
+ qemu_put_byte(f, QEMU_VM_CONFIGURATION);
+ vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0);
+ }
+
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (se->is_ram) {
continue;
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen.
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen Amit Shah
@ 2015-08-03 12:50 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2015-08-03 12:50 UTC (permalink / raw)
To: Amit Shah; +Cc: Anthony PERARD, Peter Maydell, qemu list, Anthony PERARD
* Amit Shah (amit.shah@redhat.com) wrote:
> From: Anthony PERARD <anthony.perard@gmail.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>
> Message-Id: <1438098885-4339-3-git-send-email-anthony.perard@citrix.com>
> Signed-off-by: Amit Shah <amit.shah@redhat.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..175a397 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];
> + memcpy((char *)global_state.runstate,
> + state, sizeof(global_state.runstate));
> +}
As mentioned previously, I think that needs to be a strcpy,
NOT a memcpy; the RuNState_lookup[] array isn't guaranteed to
be long enough to fulfill that memcpy.
Dave
> +
> 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) {
> --
> 2.4.3
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen
2015-08-03 12:44 [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Amit Shah
` (2 preceding siblings ...)
2015-08-03 12:45 ` [Qemu-devel] [PULL for-2.4 3/3] migration: Add configuration section to vmstate with xen Amit Shah
@ 2015-08-03 13:09 ` Anthony PERARD
3 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD @ 2015-08-03 13:09 UTC (permalink / raw)
To: Amit Shah; +Cc: Peter Maydell, qemu list
On Mon, Aug 3, 2015 at 1:44 PM, Amit Shah <amit.shah@redhat.com> wrote:
> The following changes since commit cb48f67ad8c7b33c617d4f8144a27706e69fd688:
>
> bsd-user: Fix operand to cpu_x86_exec (2015-07-30 12:38:49 +0100)
>
> are available in the git repository at:
>
> https://git.kernel.org/pub/scm/qemu/amit/migration for-2.4
>
> for you to fetch changes up to 040f70812f1fc2523945a047982694d1ef1d9e1d:
>
> migration: Add configuration section to vmstate with xen. (2015-08-03 11:42:39 +0530)
>
> ----------------------------------------------------------------
> Fixes a regression with migration for the Xen machine type
Hi,
I do have an update on this series which would also fix 'pc,accel=xen'
machine case, which I should send today.
And there is actually an issue with one of the patch, which should use
strcpy instead of memcpy.
So please don't apply just yet.
Thanks,
> ----------------------------------------------------------------
> Anthony PERARD (3):
> migration: Fix regretion for xenfv machine.
> migration: Fix global state with Xen.
> migration: Add configuration section to vmstate with xen.
>
> hw/i386/pc_piix.c | 3 +++
> include/migration/migration.h | 1 +
> migration/migration.c | 7 +++++++
> migration/savevm.c | 6 ++++++
> 4 files changed, 17 insertions(+)
--
Anthony PERARD
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-03 13:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 12:44 [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 1/3] migration: Fix regretion for xenfv machine Amit Shah
2015-08-03 12:44 ` [Qemu-devel] [PULL for-2.4 2/3] migration: Fix global state with Xen Amit Shah
2015-08-03 12:50 ` Dr. David Alan Gilbert
2015-08-03 12:45 ` [Qemu-devel] [PULL for-2.4 3/3] migration: Add configuration section to vmstate with xen Amit Shah
2015-08-03 13:09 ` [Qemu-devel] [PULL for-2.4 0/3] Regression fix for migration on Xen Anthony PERARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).