From patchwork Sun Jun 3 05:05:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 10445141 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 2403160234 for ; Sun, 3 Jun 2018 05:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 123B128989 for ; Sun, 3 Jun 2018 05:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 054AF289D4; Sun, 3 Jun 2018 05:19: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 83D3628989 for ; Sun, 3 Jun 2018 05:19:51 +0000 (UTC) Received: from localhost ([::1]:33693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPLQk-0001Ge-NP for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Jun 2018 01:19:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPLEj-0000gF-5J for qemu-devel@nongnu.org; Sun, 03 Jun 2018 01:07:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPLEf-0001BM-UA for qemu-devel@nongnu.org; Sun, 03 Jun 2018 01:07:25 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:36919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPLEf-0001Aq-OD for qemu-devel@nongnu.org; Sun, 03 Jun 2018 01:07:21 -0400 Received: by mail-pg0-x244.google.com with SMTP id a13-v6so12987705pgu.4 for ; Sat, 02 Jun 2018 22:07:21 -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=3gki9G147bx6x33sgLsCMxxLRFBF8jp0rqP+wTdMSuo=; b=pUDn9NOCXbeYkwnsLgV5Nshk8PxgzYsaLYQM6yQk8YUmxJrRbSjTGaBVPc+P8yE6mP in0U9DZ9LgIv6Mx57dohMctN3wYEfu2OCoVVdh4Yu5XKvSrSulIDEGDDrZWU7swvfbmU BboHHhwa8HRGO3tF112TOYb23CyVOroo7mafwOSt6UM+jVBX8gVOqor69C5PEukOjeE8 GUMSxd3xetZ+2HPQoLkxfLuO/p57d2SUea3Uw65TFtGXLRvl4kTcDRzNmoNL59vICn0h XnLQ2FqKOj0bB3pNPVo6w6m7aCVPDdST0vPG7xOtBsNZvMrxvr8rG+zkIWTzrl85N/lX WOLw== 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=3gki9G147bx6x33sgLsCMxxLRFBF8jp0rqP+wTdMSuo=; b=ZPmHT9pGJJTw9mIjSW5QykFwa/r7Zf5P58/MSszKvIRJSf+nkF+vF3piw1GKr9Gzbf NgnXQxs3XKbZfuVg7ROkX66oWJ5tr+WA3aLQB1i8mFkIoxW3Ek/p4++0kjKxIarp1SpU HfOjCkil4obw/zzCep2Q41UkC6Khv7aL7cDWQZOHc0pqaQe2l5WN70kyDVLIpbJA5DpO qg//Bnf2KZhi4OWK13jHv29gQMo4ULU3a/OP5Z+qUU34U88R06XP3w5oUBoKVia8Ru0I CPZHXyKPN+g5CgzOAAFTXREglVgDWJEPZmZNKsMp1yrRg7vX3mknz7PwxyZP6CL2oPFn Vh6g== X-Gm-Message-State: ALKqPwfkblttD82/GRh/agPBTklhrucvOtm54pUg8vAewPJ0knUHesfE X8TbSQbDGq5QP2dHmcA31g3LTQ== X-Google-Smtp-Source: ADUXVKKF34bcgdceJm0S6nQDEbT+wDquWHU7DiL0TuSp6yhmASWvJ6theWMo7Ep3qx81ovQGOWK+EA== X-Received: by 2002:a63:9843:: with SMTP id l3-v6mr13723870pgo.208.1528002440637; Sat, 02 Jun 2018 22:07:20 -0700 (PDT) Received: from localhost.localdomain (197.225.229.35.bc.googleusercontent.com. [35.229.225.197]) by smtp.gmail.com with ESMTPSA id 10-v6sm45841595pgb.40.2018.06.02.22.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 22:07:19 -0700 (PDT) From: Zhang Chen To: qemu-devel@nongnu.org, Paolo Bonzini , Juan Quintela , "Dr . David Alan Gilbert" , Jason Wang , Eric Blake , Markus Armbruster Date: Sun, 3 Jun 2018 13:05:45 +0800 Message-Id: <20180603050546.6827-17-zhangckid@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180603050546.6827-1-zhangckid@gmail.com> References: <20180603050546.6827-1-zhangckid@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH V8 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 , Zhang Chen 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 Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 0bff21d9e5..e3824d139a 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"); @@ -813,6 +818,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");