From patchwork Mon May 14 03:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 10396759 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 571A4601E7 for ; Mon, 14 May 2018 06:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451FA29096 for ; Mon, 14 May 2018 06:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39808290AE; Mon, 14 May 2018 06:17:52 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 D4FD929096 for ; Mon, 14 May 2018 06:17:51 +0000 (UTC) Received: from localhost ([::1]:41518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fI6nu-0007ou-Rq for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 May 2018 02:17:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fI6kx-00060s-7W for qemu-devel@nongnu.org; Mon, 14 May 2018 02:14:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fI477-0000zJ-DU for qemu-devel@nongnu.org; Sun, 13 May 2018 23:25:30 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:37404) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fI476-0000xq-Ja for qemu-devel@nongnu.org; Sun, 13 May 2018 23:25:28 -0400 Received: by mail-pl0-x241.google.com with SMTP id w19-v6so3895626plq.4 for ; Sun, 13 May 2018 20:25:28 -0700 (PDT) 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=W3Pb33nZV84BYKajEA+RBOCsx/y0k0R3XgNyV0JqEZ0=; b=Bgbip5EiqVatpmhRwi3vf/Chri0Yo5RPtzuG2aPapOoJS6jPU1mZ0nhrV4f23zaO6Z /v+GvKp0nVfZeFmWa/Ni4MgAzL1PSANGJSa1T+/HdtqI0l/OzFnPNaOiFQ3dVYK4fD5p ZyZ6J0A7dluhWmvBvtDFF/aAz9TbOGU58RghxMNkALSwLCHkByGemYe6YAkDcg6KAQNJ JyRlbYoQaT4p/LiMJJIwFCBGqGY+CYrHNVAZQn8M7/Krr5eDvmre2aDg57edp4bkFxiI 1MdqTXtcFaKCi3dPG4hEjDrwCFOnMGx/kzhfgbVfrfjraSuE/E3MZzZBCpLwHbueZTcr X7Cw== 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=W3Pb33nZV84BYKajEA+RBOCsx/y0k0R3XgNyV0JqEZ0=; b=Nt5C0wM1gFrXNFbvc4ao/JaSox6GiQxs4iiXRaLZoz7mtp4Y9dM0u2K9mYW6HagefL q5hudQSKCGmoKwXaRFpqZgcMKmn4f4Box3ebfxe3J2+umLh6GkTY5fybZnzdgBNAGwE5 vTh1LV3D6Ml4ZIz167zbbH7B4z0QGFGPwfRt+MMZ29uEScwD62AcvwQ/L0vJ90k+Kd99 qwtVK+YIu7T17go6z83ZEliyLGJoR1fm6tKjeceZV//cYjxUa6ycZX4lbnkZkSX3EnEN cTsFir36Xrr1g5qQELR7RgGGLyNUKzzRxa2P3sxocBqf6XumwiT85UF+MEJcXWHdqyp0 rnyA== X-Gm-Message-State: ALKqPwddgaqf3jKXirMmcM06YJjuY5AueNK493LAk+j4xT7w2O3MWqii yvnYBkjNz329xfkIOZGeQpCfLw== X-Google-Smtp-Source: AB8JxZqmRavX7FEpx+AVaXZ6fuMT02RiYRgfMABks+swfhR3rdQYvUbq6UJyvNCYrxlrQ36PTBh3lw== X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr7782053plb.99.1526268327522; Sun, 13 May 2018 20:25:27 -0700 (PDT) Received: from localhost.localdomain (109.227.199.104.bc.googleusercontent.com. [104.199.227.109]) by smtp.gmail.com with ESMTPSA id p6-v6sm17183532pfg.157.2018.05.13.20.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 May 2018 20:25:26 -0700 (PDT) From: Zhang Chen To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 11:23:47 +0800 Message-Id: <1526268228-27951-17-git-send-email-zhangckid@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526268228-27951-1-git-send-email-zhangckid@gmail.com> References: <1526268228-27951-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::241 Subject: [Qemu-devel] [PATCH V7 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 , Jason Wang , Markus Armbruster , "Dr . David Alan Gilbert" , 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 5e517dc..d67bdc2 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -88,6 +88,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"); @@ -799,6 +804,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");