On 2015/11/27 20:51, Yang Hongyang wrote:
On 2015年11月24日 17:25, zhanghailiang wrote:
Enable default filter to buffer packets and release the
packets after a checkpoint.
Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com>
Cc: Jason Wang <jasow...@redhat.com>
Cc: Yang Hongyang <hongyang.y...@easystack.cn>
---
v11:
- Use new helper functions to buffer and release packets.
---
migration/colo.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/migration/colo.c b/migration/colo.c
index 79a8d6b..b1b7905 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -19,6 +19,7 @@
#include "qemu/sockets.h"
#include "migration/failover.h"
#include "qapi-event.h"
+#include "net/filter.h"
/*
* The delay time before qemu begin the procedure of default failover
treatment.
@@ -131,6 +132,8 @@ static void primary_vm_do_failover(void)
"old_state: %d", old_state);
return;
}
+ /* Don't buffer any packets while exited COLO */
+ qemu_set_default_filter_buffers(false);
You might need to release packets before exited COLO ?
Yes, we should flush the queue and release the buffered packets.
I will fix this it in next version, thanks.
}
void colo_do_failover(MigrationState *s)
@@ -290,6 +293,8 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
goto out;
}
+ qemu_release_default_filters_packets();
+
if (colo_shutdown) {
colo_ctl_put(s->to_dst_file, COLO_COMMAND_GUEST_SHUTDOWN, 0);
qemu_fflush(s->to_dst_file);
@@ -367,6 +372,8 @@ static void colo_process_checkpoint(MigrationState *s)
error_report("Failed to allocate colo buffer!");
goto out;
}
+ /* Begin to buffer packets that sent by VM */
+ qemu_set_default_filter_buffers(true);
qemu_mutex_lock_iothread();
vm_start();