From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2IUm-0003ZU-SX for qemu-devel@nongnu.org; Fri, 27 Nov 2015 07:51:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2IUj-0001Eh-6B for qemu-devel@nongnu.org; Fri, 27 Nov 2015 07:51:24 -0500 Received: from m199-177.yeah.net ([123.58.177.199]:50107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2IUi-0001ER-Da for qemu-devel@nongnu.org; Fri, 27 Nov 2015 07:51:21 -0500 References: <1448357149-17572-1-git-send-email-zhang.zhanghailiang@huawei.com> <1448357149-17572-39-git-send-email-zhang.zhanghailiang@huawei.com> From: Yang Hongyang Message-ID: <565851B9.9020506@easystack.cn> Date: Fri, 27 Nov 2015 20:51:05 +0800 MIME-Version: 1.0 In-Reply-To: <1448357149-17572-39-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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: zhanghailiang , 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=E5=B9=B411=E6=9C=8824=E6=97=A5 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 ? > } > > void colo_do_failover(MigrationState *s) > @@ -290,6 +293,8 @@ static int colo_do_checkpoint_transaction(Migration= State *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(); > --=20 Thanks, Yang