From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fob0g-0005ai-JQ for qemu-devel@nongnu.org; Sat, 11 Aug 2018 17:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fob0d-0001fV-Im for qemu-devel@nongnu.org; Sat, 11 Aug 2018 17:01:18 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:35076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fob0d-0001f8-CS for qemu-devel@nongnu.org; Sat, 11 Aug 2018 17:01:15 -0400 Received: by mail-pf1-x444.google.com with SMTP id p12-v6so6017204pfh.2 for ; Sat, 11 Aug 2018 14:01:15 -0700 (PDT) From: Zhang Chen Date: Sun, 12 Aug 2018 04:59:22 +0800 Message-Id: <20180811205924.4113-19-zhangckid@gmail.com> In-Reply-To: <20180811205924.4113-1-zhangckid@gmail.com> References: <20180811205924.4113-1-zhangckid@gmail.com> Subject: [Qemu-devel] [PATCH V11 18/20] COLO: notify net filters about checkpoint/failover event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Paolo Bonzini , Juan Quintela , "Dr . David Alan Gilbert" , Jason Wang , Eric Blake , Markus Armbruster Cc: Zhang Chen , zhanghailiang , Li Zhijian From: zhanghailiang Notify all net filters about the checkpoint and failover event. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 688d6f40b2..8221a18add 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -31,6 +31,7 @@ #include "qapi/qapi-events-migration.h" #include "qapi/qmp/qerror.h" #include "sysemu/cpus.h" +#include "net/filter.h" static bool vmstate_loading; static Notifier packets_compare_notifier; @@ -83,6 +84,12 @@ static void secondary_vm_do_failover(void) error_report_err(local_err); } + /* Notify all filters of all NIC to do checkpoint */ + colo_notify_filters_event(COLO_EVENT_FAILOVER, &local_err); + if (local_err) { + error_report_err(local_err); + } + if (!autostart) { error_report("\"-S\" qemu option will be ignored in secondary side"); /* recover runstate to normal migration finish state */ @@ -781,6 +788,14 @@ void *colo_process_incoming_thread(void *opaque) goto out; } + /* Notify all filters of all NIC to do checkpoint */ + colo_notify_filters_event(COLO_EVENT_CHECKPOINT, &local_err); + + if (local_err) { + qemu_mutex_unlock_iothread(); + goto out; + } + vmstate_loading = false; vm_start(); trace_colo_vm_state_change("stop", "run"); -- 2.17.GIT