From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Ynb-0006db-4l for qemu-devel@nongnu.org; Sat, 28 Nov 2015 01:15:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2YnW-0004os-T8 for qemu-devel@nongnu.org; Sat, 28 Nov 2015 01:15:55 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:31408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2YnW-0004oT-8y for qemu-devel@nongnu.org; Sat, 28 Nov 2015 01:15:50 -0500 References: <1448357149-17572-1-git-send-email-zhang.zhanghailiang@huawei.com> <1448357149-17572-39-git-send-email-zhang.zhanghailiang@huawei.com> <565851B9.9020506@easystack.cn> From: Hailiang Zhang Message-ID: <5659467A.5020209@huawei.com> Date: Sat, 28 Nov 2015 14:15:22 +0800 MIME-Version: 1.0 In-Reply-To: <565851B9.9020506@easystack.cn> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v11 38/39] colo: Use default buffer-filter to buffer and release packets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang , qemu-devel@nongnu.org Cc: lizhijian@cn.fujitsu.com, quintela@redhat.com, Jason Wang , yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, arei.gonglei@huawei.com, stefanha@redhat.com, amit.shah@redhat.com 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 >> Cc: Jason Wang >> Cc: Yang Hongyang >> --- >> 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(); >> >