From patchwork Mon May 14 16:54:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 10398965 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 2661B60216 for ; Mon, 14 May 2018 17:09:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 171082838F for ; Mon, 14 May 2018 17:09:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BE9C28396; Mon, 14 May 2018 17:09:05 +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 9B8052838F for ; Mon, 14 May 2018 17:09:04 +0000 (UTC) Received: from localhost ([::1]:47333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIGy7-0003xy-H9 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 May 2018 13:09:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIGlR-00005G-4D for qemu-devel@nongnu.org; Mon, 14 May 2018 12:55:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIGlQ-00066D-CN for qemu-devel@nongnu.org; Mon, 14 May 2018 12:55:57 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:41045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIGlQ-00065U-5K for qemu-devel@nongnu.org; Mon, 14 May 2018 12:55:56 -0400 Received: by mail-pl0-x244.google.com with SMTP id az12-v6so7706019plb.8 for ; Mon, 14 May 2018 09:55:55 -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=9neXvScEEfL9qiWRCyo9yJFqn66XsqhGjUPalXsacLs=; b=tOr44K6h719ni8ZCdz+n+5st5TfaqgjnZhXT5Ad3N3EWr8QgzCw+mlLIHZNeBbLQ/3 tFClRF2YppQ7kDSoXbmh9Cq+P88A+/JDM6EnN+/y0p5rTTDZRueHZwpWYs9KK0VHyQot rQ4at9g/pJDeLBfQXwMeuN8T6nVV6z1ayWpgGJ0iIjI5Ux48NLZvBNDhytgji5lZIqK5 0J5rqVYssIoFuK77ZufSws+E8QwNorYhTVyA3y1Gd1FD5SaSdVCTbiAtonHgZxhgbd4Y QAzJTTOOWfcJSGYIjTjW6Fc1h+slxjPhavOCN4pvdHW5GQUE4XtH61j1iIl1lBETJksa PlAw== 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=9neXvScEEfL9qiWRCyo9yJFqn66XsqhGjUPalXsacLs=; b=cH0k6rz3rRc97r4GxkdgrUfRO6f0E6A2tIhsd8GddR35ThyK6pUt85bRkYauaJGyJd xAaDtmuHfH2Qdffl9MNPHWaTplTKHrEHTi+VDC1cSKZOlbOWnEpjnFDIPpNj25NGE6xR SFNnZsj4iHqsJRV85LJYHftBNdTBsHoN9z8pQjdoj7XWVtX9953APw3XtrqPxTd2Ndj4 cxE7hjWMvANHgTvoe8UDJxdSBR7ILUkK5ErMykF7ErPWuBsz5oZdoMJBhSWGsSB1zpif 8QULYfSNTmY3/Waq4YsEOmbo6pJy5IoibJVLyjF6c5t0I2bi3lbffxBcoaz6C4UCFsfT VUYA== X-Gm-Message-State: ALKqPwevZPOrdv016ccT8gYC2Q1cHSyzU+olAkE0Sw00jc44urtah1E4 WBMRkvResoqc+wdsyqQDx/Avww== X-Google-Smtp-Source: AB8JxZqg618qqer0tu3TtP0Pmz5Se/wayKrbwYjsJD6mryhZd02Iaha+nSFlhYRR1kMCoocek5RFgg== X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr10875167plj.253.1526316954842; Mon, 14 May 2018 09:55:54 -0700 (PDT) Received: from localhost.localdomain (109.227.199.104.bc.googleusercontent.com. [104.199.227.109]) by smtp.gmail.com with ESMTPSA id u69-v6sm631448pgb.42.2018.05.14.09.55.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 09:55:53 -0700 (PDT) From: Zhang Chen To: qemu-devel@nongnu.org Date: Tue, 15 May 2018 00:54:23 +0800 Message-Id: <20180514165424.12884-17-zhangckid@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514165424.12884-1-zhangckid@gmail.com> References: <20180514165424.12884-1-zhangckid@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH V7 RESEND 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 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 3dfd84d897..15463e2823 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");