From patchwork Sun Mar 11 07:45:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 10274557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CB8360211 for ; Sun, 11 Mar 2018 07:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F388928ED5 for ; Sun, 11 Mar 2018 07:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E536528EDD; Sun, 11 Mar 2018 07:59:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C81128ED5 for ; Sun, 11 Mar 2018 07:59:58 +0000 (UTC) Received: from localhost ([::1]:53418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euvtd-0000sy-I8 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 11 Mar 2018 03:59:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euvgn-0006nC-Be for qemu-devel@nongnu.org; Sun, 11 Mar 2018 03:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euvgm-00018h-Ji for qemu-devel@nongnu.org; Sun, 11 Mar 2018 03:46:41 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:40874) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1euvgm-00018M-Db for qemu-devel@nongnu.org; Sun, 11 Mar 2018 03:46:40 -0400 Received: by mail-pl0-x243.google.com with SMTP id x3-v6so1087412plo.7 for ; Sat, 10 Mar 2018 23:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0tTQpIVyCNzXoNXHf3yDuCTrarUzSq9WY7LvOpdkSRM=; b=LxJ1hL8Bc3irdKR+Bb2FXigE99fzRykJle0B32qnAuEarZJC3JnvsPWJIfcKrxKG7c xoZ8+youpmioY65/Pq1Ntf95MpnVESQ3O8acSpfIduVftMDErHGirB0CBc01vY4uTZrf qz5IMlS/y1l/BBJc2VHrajHpk90l8ggBj8qbP4S0NjxOzpMHEaX/aXh8W1j5DGpwivzi xmiKbrs7dOm+NIF9LKbrH+tdneMvKiHteFMUur6ZwDkxtkoiLdP8Oqgcx8+nGOzt2XN3 c+dzN6iUfxKqbW3u+pjTFiAV7/0RyWC6FcShUa5wfVvS1yFpr81qsOaav8ZD2gzP6uav hFOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0tTQpIVyCNzXoNXHf3yDuCTrarUzSq9WY7LvOpdkSRM=; b=fiMI7XhRlZAksqXTsdnSbG2MJW01FLiRLyW209uEqj9i47aBvZxgt7U7z4GyT1hBVq b5WPMFKXutwAxO0LUzrJEiedmQxNzCreLdOXrNGhCmf/6Q3TiyN6j6BkuPohE8MVNLt+ mRPjZG2W/hZIh6KNcW2CerIcVyV0Nt5C1AucT3ULjcGN2/tsEX4EQmkIteOpD3JWBhQs P1cOyLbyu4OC7z3UMSAx4uaa4Iga++9cefJpoOcuYxMwqQqKZWVQP8HEq0beZNheIxY9 A5njdex8Kk/Oxc0zALxut4uRCwZdVX/SUA8eihI4Fud0OYcyTn1EF0JxikXHuBRU1ozE cdBQ== X-Gm-Message-State: AElRT7EQeIx+N/U+9o3FYmzfxLjN0hD49yk9WbxaQGnJiOij+vAJmrAV BVkg9jSl4oG9uacL/DWM25xWzrwA X-Google-Smtp-Source: AG47ELtmJ+D10x5VusHbqItT57kfsHcjPomAPjWdE1oGExCzDwVoXYQIaOIAYrikdGMaf7fUwW3pEA== X-Received: by 2002:a17:902:6b82:: with SMTP id p2-v6mr4300319plk.326.1520754399149; Sat, 10 Mar 2018 23:46:39 -0800 (PST) Received: from localhost.localdomain (120.236.201.35.bc.googleusercontent.com. [35.201.236.120]) by smtp.gmail.com with ESMTPSA id t16sm10917037pfm.69.2018.03.10.23.46.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Mar 2018 23:46:38 -0800 (PST) From: Zhang Chen To: qemu-devel@nongnu.org Date: Sun, 11 Mar 2018 15:45:13 +0800 Message-Id: <1520754314-5969-18-git-send-email-zhangckid@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520754314-5969-1-git-send-email-zhangckid@gmail.com> References: <1520754314-5969-1-git-send-email-zhangckid@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [PATCH V6 16/17] COLO: notify net filters about checkpoint/failover event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhanghailiang , Li Zhijian , Juan Quintela , Jason Wang , "Dr . David Alan Gilbert" , Markus Armbruster , Zhang Chen , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: zhanghailiang Notify all net filters about the checkpoint and failover event. Signed-off-by: zhanghailiang --- migration/colo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index f3d588e..1a59baa 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -87,6 +87,11 @@ static void secondary_vm_do_failover(void) if (local_err) { 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"); @@ -796,6 +801,13 @@ 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");