From patchwork Thu Jan 4 06:01:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 10143905 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 942896034B for ; Thu, 4 Jan 2018 06:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 884E1283FD for ; Thu, 4 Jan 2018 06:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B80228417; Thu, 4 Jan 2018 06:12:15 +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 0EA78283FD for ; Thu, 4 Jan 2018 06:12:15 +0000 (UTC) Received: from localhost ([::1]:47508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWylC-0004Rp-Ap for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 Jan 2018 01:12:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWybq-00046q-1M for qemu-devel@nongnu.org; Thu, 04 Jan 2018 01:02:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWybp-0004WW-5l for qemu-devel@nongnu.org; Thu, 04 Jan 2018 01:02:34 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:39500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWybp-0004Vm-0r for qemu-devel@nongnu.org; Thu, 04 Jan 2018 01:02:33 -0500 Received: by mail-pl0-x243.google.com with SMTP id bi12so512225plb.6 for ; Wed, 03 Jan 2018 22:02:32 -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=0F7ZsDCObUtJ4lonLzJ/iStY50bir8SUcn4PW5uN+xE=; b=RB/YUe0J+Yay/0D42SwZUE5yeFfD1OvMy5wRG1VM7Ql9J0xA6oYMZf8dEFBmaMeQzP eCcgVgZlX4t4ioHS74iEQ50apq0j4sYGdm3XLi4V6ztleBURQg9x3L3tqN7X0o8O/FZo gHGJgWKoh8qD9dClh/HS8mO+Q9MtL1gW74tSBdlyZVw2gUioPSiPTXO21EQk0v8DjpkG VsCrVkFhSP6SRz3M0KFf3Tku8LJ2VruTu8udg+IG7sq20xqQ5pWkzij/Z6zKpt1CrpQx RHLzg2i0ELi3hBwQoqi1n2NifNX/C2G6TtTkk0d39Ao13kj2rAXuNz/GvTC0HcvaFDF+ 4xfA== 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=0F7ZsDCObUtJ4lonLzJ/iStY50bir8SUcn4PW5uN+xE=; b=Yjl1OlIHPAoTVLDnJNhq3NkvMnLQS3387V/qpA8TemzUWn8cYd6HPyS37yJCniJRW/ 8lXYeruRF4koeQW9aWoU9HxX7/gbST4R2AA2Ywd1JYBfC+gNlnTLCRXB61v6Kf2oO0Nw Ge3GtRFt0scnrhtxPqPGuHZ56iZOYkDUwE558P2CeswSpTirklO2B90RzkfkoMcxJANK YV054d74QjooLiJu2YfNheYKbs9yhXz0xi9ltYM92fd+Ii9mrsUrRFHbk8YE1iK+WGYH GttejdYfTKO62hTi+kScPyRubyQLiS8bt7SNSbUFHs/Yeel7JBxynGa48M02dq2qIXsj zGbg== X-Gm-Message-State: AKGB3mJFDvnyXy1QMf2WA8KiQ+m3cJe9GR8aOnejG8J6k6mdi8/Mgnu/ SpdtbLxAKZCTFP93zfpqHcbF0XG/ X-Google-Smtp-Source: ACJfBotJAIqwO5q4TajLu3zjlN3OKEznhLRWZFowA0SQ9piSOVn22LQUL+gF0HUNocDrRCtOW/MQgQ== X-Received: by 10.84.210.66 with SMTP id z60mr3652526plh.359.1515045751843; Wed, 03 Jan 2018 22:02:31 -0800 (PST) Received: from localhost.localdomain (120.236.201.35.bc.googleusercontent.com. [35.201.236.120]) by smtp.gmail.com with ESMTPSA id w5sm6214775pfi.74.2018.01.03.22.02.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Jan 2018 22:02:30 -0800 (PST) From: Zhang Chen To: qemu devel Date: Thu, 4 Jan 2018 14:01:14 +0800 Message-Id: <1515045675-6993-16-git-send-email-zhangckid@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515045675-6993-1-git-send-email-zhangckid@gmail.com> References: <1515045675-6993-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 RESEND V3 15/16] 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: Jason Wang , zhanghailiang 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. Cc: Jason Wang Signed-off-by: zhanghailiang --- migration/colo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 9eab4a3..10bc80c 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"); @@ -766,6 +771,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");