* [Qemu-devel] [PATCH v2 0/3] Migration fixes
@ 2009-03-31 20:31 Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
0 siblings, 1 reply; 6+ messages in thread
From: Glauber Costa @ 2009-03-31 20:31 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, avi
Same thing, with comments addressed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration
2009-03-31 20:31 [Qemu-devel] [PATCH v2 0/3] Migration fixes Glauber Costa
@ 2009-03-31 20:31 ` Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Glauber Costa @ 2009-03-31 20:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Yaniv Kamay, aliguori, Dor Laor, avi
If there is still work to do, it is not safe to assume we
can end the dirty tracking. Specifically, kvm can update the dirty
tracking log inside ram_save_block(), leaving pages still out of sync
if we go with the current code.
Based on a patch by Yaniv Kamay
Signed-off-by: Glauber Costa <glommer@redhat.com>
CC: Yaniv Kamay <ykamay@redhat.com>
CC: Dor Laor <dlaor@redhat.com>
---
vl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vl.c b/vl.c
index 5e6c621..1626f8a 100644
--- a/vl.c
+++ b/vl.c
@@ -3249,10 +3249,10 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
/* try transferring iterative blocks of memory */
if (stage == 3) {
- cpu_physical_memory_set_dirty_tracking(0);
/* flush all remaining blocks regardless of rate limiting */
while (ram_save_block(f) != 0);
+ cpu_physical_memory_set_dirty_tracking(0);
}
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
--
1.5.6.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
@ 2009-03-31 20:31 ` Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 3/3] propagate error on failed completion Glauber Costa
2009-04-05 19:30 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Anthony Liguori
2009-04-05 19:33 ` Anthony Liguori
2 siblings, 1 reply; 6+ messages in thread
From: Glauber Costa @ 2009-03-31 20:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Yaniv Kamay, aliguori, Dor Laor, avi
This is mainly for consistency, since we don't want
anything outside of savevm setting it explicitly. There
are current no users of that in qemu tree, but there
are potential candidates on kvm-userspace. And avi
is a nice guy, let's be nice with him.
Based on a patch by Yaniv Kamay
Signed-off-by: Glauber Costa <glommer@redhat.com>
CC: Yaniv Kamay <ykamay@redhat.com>
CC: Dor Laor <dlaor@redhat.com>
---
hw/hw.h | 1 +
savevm.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index eab7bb4..e9628d4 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -67,6 +67,7 @@ unsigned int qemu_get_be32(QEMUFile *f);
uint64_t qemu_get_be64(QEMUFile *f);
int qemu_file_rate_limit(QEMUFile *f);
int qemu_file_has_error(QEMUFile *f);
+void qemu_file_set_error(QEMUFile *f);
/* Try to send any outstanding data. This function is useful when output is
* halted due to rate limiting or EAGAIN errors occur as it can be used to
diff --git a/savevm.c b/savevm.c
index ce12628..9f81d07 100644
--- a/savevm.c
+++ b/savevm.c
@@ -370,6 +370,11 @@ int qemu_file_has_error(QEMUFile *f)
return f->has_error;
}
+void qemu_file_set_error(QEMUFile *f)
+{
+ f->has_error = 1;
+}
+
void qemu_fflush(QEMUFile *f)
{
if (!f->put_buffer)
--
1.5.6.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v2 3/3] propagate error on failed completion
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
@ 2009-03-31 20:31 ` Glauber Costa
0 siblings, 0 replies; 6+ messages in thread
From: Glauber Costa @ 2009-03-31 20:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Yaniv Kamay, aliguori, Dor Laor, avi
migrate_fd_put_ready() calls qemu_savevm_state_complete(),
but the later can fail.
If it happens, re-start the vm and propagate the error up
Based on a patch by Yaniv Kamay
Signed-off-by: Glauber Costa <glommer@redhat.com>
CC: Yaniv Kamay <ykamay@redhat.com>
CC: Dor Laor <dlaor@redhat.com>
---
migration.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/migration.c b/migration.c
index b3904b2..859d945 100644
--- a/migration.c
+++ b/migration.c
@@ -220,13 +220,19 @@ void migrate_fd_put_ready(void *opaque)
dprintf("iterate\n");
if (qemu_savevm_state_iterate(s->file) == 1) {
+ int state;
dprintf("done iterating\n");
vm_stop(0);
bdrv_flush_all();
- qemu_savevm_state_complete(s->file);
- s->state = MIG_STATE_COMPLETED;
+ if ((qemu_savevm_state_complete(s->file)) < 0) {
+ vm_start();
+ state = MIG_STATE_ERROR;
+ } else {
+ state = MIG_STATE_COMPLETED;
+ }
migrate_fd_cleanup(s);
+ s->state = state;
}
}
--
1.5.6.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
@ 2009-04-05 19:30 ` Anthony Liguori
2009-04-05 19:33 ` Anthony Liguori
2 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2009-04-05 19:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Yaniv Kamay, Dor Laor, avi
Glauber Costa wrote:
> If there is still work to do, it is not safe to assume we
> can end the dirty tracking. Specifically, kvm can update the dirty
> tracking log inside ram_save_block(), leaving pages still out of sync
> if we go with the current code.
>
> Based on a patch by Yaniv Kamay
>
> Signed-off-by: Glauber Costa <glommer@redhat.com>
>
Applied all. Thanks.
--
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
2009-04-05 19:30 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Anthony Liguori
@ 2009-04-05 19:33 ` Anthony Liguori
2 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2009-04-05 19:33 UTC (permalink / raw)
To: qemu-devel; +Cc: Yaniv Kamay, Dor Laor, avi
Glauber Costa wrote:
> If there is still work to do, it is not safe to assume we
> can end the dirty tracking. Specifically, kvm can update the dirty
> tracking log inside ram_save_block(), leaving pages still out of sync
> if we go with the current code.
>
> Based on a patch by Yaniv Kamay
>
> Signed-off-by: Glauber Costa <glommer@redhat.com>
Applied to stable. Thanks.
--
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-04-05 19:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-31 20:31 [Qemu-devel] [PATCH v2 0/3] Migration fixes Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 3/3] propagate error on failed completion Glauber Costa
2009-04-05 19:30 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Anthony Liguori
2009-04-05 19:33 ` Anthony Liguori
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).