qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: qemu-devel@nongnu.org, gilbert@redhat.com
Cc: quintela@redhat.com, lizhijian@cn.fujitsu.com,
	zhangchen.fnst@cn.fujitsu.com, xiecl.fnst@cn.fujitsu.com,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PATCH v2 18/18] COLO: notify net filters about checkpoint/failover event
Date: Sat, 22 Apr 2017 16:25:58 +0800	[thread overview]
Message-ID: <1492849558-17540-19-git-send-email-zhang.zhanghailiang@huawei.com> (raw)
In-Reply-To: <1492849558-17540-1-git-send-email-zhang.zhanghailiang@huawei.com>

Notify all net filters about the checkpoint and failover event.

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 migration/colo.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/migration/colo.c b/migration/colo.c
index 66bb5b2..62f58c6 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -26,6 +26,7 @@
 #include "qapi-event.h"
 #include "block/block.h"
 #include "replication.h"
+#include "net/filter.h"
 
 static bool vmstate_loading;
 static Notifier packets_compare_notifier;
@@ -82,6 +83,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_FAILOVER, &local_err);
+    if (local_err) {
+        error_report_err(local_err);
+    }
 
     if (!autostart) {
         error_report("\"-S\" qemu option will be ignored in secondary side");
@@ -794,6 +800,13 @@ void *colo_process_incoming_thread(void *opaque)
             goto out;
         }
 
+        /* Notify all filters of all NIC to do checkpoint */
+        colo_notify_filters_event(COLO_CHECKPOINT, &local_err);
+        if (local_err) {
+            qemu_mutex_unlock_iothread();
+            goto out;
+        }
+
         vmstate_loading = false;
         vm_start();
         trace_colo_vm_state_change("stop", "run");
-- 
1.8.3.1

      parent reply	other threads:[~2017-04-22  8:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  8:25 [Qemu-devel] [PATCH v2 00/18] COLO: integrate colo frame with block replication and net compare zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 01/18] net/colo: Add notifier/callback related helpers for filter zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 02/18] colo-compare: implement the process of checkpoint zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 03/18] colo-compare: use notifier to notify packets comparing result zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 04/18] COLO: integrate colo compare with colo frame zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 05/18] COLO: Handle shutdown command for VM in COLO state zhanghailiang
2017-04-24 14:51   ` Eric Blake
2017-04-26  7:38     ` Hailiang Zhang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 06/18] COLO: Add block replication into colo process zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 07/18] COLO: Load dirty pages into SVM's RAM cache firstly zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 08/18] ram/COLO: Record the dirty pages that SVM received zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 09/18] COLO: Flush memory data from ram cache zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 10/18] qmp event: Add COLO_EXIT event to notify users while exited COLO zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 11/18] savevm: split save/find loadvm_handlers entry into two helper functions zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 12/18] savevm: split the process of different stages for loadvm/savevm zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 13/18] COLO: Separate the process of saving/loading ram and device state zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 14/18] COLO: Split qemu_savevm_state_begin out of checkpoint process zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 15/18] COLO: flush host dirty ram from cache zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 16/18] filter: Add handle_event method for NetFilterClass zhanghailiang
2017-04-22  8:25 ` [Qemu-devel] [PATCH v2 17/18] filter-rewriter: handle checkpoint and failover event zhanghailiang
2017-04-22  8:25 ` zhanghailiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492849558-17540-19-git-send-email-zhang.zhanghailiang@huawei.com \
    --to=zhang.zhanghailiang@huawei.com \
    --cc=gilbert@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=zhangchen.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).