All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
To: Xen devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>
Cc: "eddie . dong" <eddie.dong@intel.com>,
	Yang Hongyang <imhy.yang@gmail.com>,
	Bian Naimeng <biannm@cn.fujitsu.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>,
	Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Subject: [PATCH RFC 6/6] COLO-Proxy: Use socket to get checkpoint event.
Date: Thu, 26 Jan 2017 14:36:09 +0800	[thread overview]
Message-ID: <1485412569-7431-7-git-send-email-zhangchen.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1485412569-7431-1-git-send-email-zhangchen.fnst@cn.fujitsu.com>

We use old kernel colo proxy way to get the checkpoint event from qemu.
This patch have some TODO job.
Qemu compare need add a API to support this(I will add this in qemu).

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 tools/libxl/libxl_colo.h       |  2 ++
 tools/libxl/libxl_colo_proxy.c | 12 ++++++++++++
 tools/libxl/libxl_nic.c        |  8 ++++++++
 tools/libxl/libxl_types.idl    |  4 +++-
 tools/libxl/xl_cmdimpl.c       |  4 ++++
 5 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_colo.h b/tools/libxl/libxl_colo.h
index 4746d8c..6c01b55 100644
--- a/tools/libxl/libxl_colo.h
+++ b/tools/libxl/libxl_colo.h
@@ -69,6 +69,8 @@ struct libxl__colo_proxy_state {
      *          False means use kernel colo proxy.
      */
     bool is_userspace_proxy;
+    const char *checkpoint_host;
+    const char *checkpoint_port;
 };
 
 struct libxl__colo_save_state {
diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libxl/libxl_colo_proxy.c
index 348484d..a3c05f7 100644
--- a/tools/libxl/libxl_colo_proxy.c
+++ b/tools/libxl/libxl_colo_proxy.c
@@ -153,6 +153,11 @@ int colo_proxy_setup(libxl__colo_proxy_state *cps)
     STATE_AO_GC(cps->ao);
 
     if (cps->is_userspace_proxy) {
+        /*
+         * TODO: Get userspace colo proxy checkpoint socket fd.
+         * use cps->checkpoint_host and cps->checkpoint_host.
+         */
+
         /* If enable userspace proxy mode, we don't need setup kernel proxy */
         return 0;
     }
@@ -231,6 +236,8 @@ void colo_proxy_teardown(libxl__colo_proxy_state *cps)
         /*
          * If enable userspace proxy mode,
          * we don't need teardown kernel proxy
+         *
+         * TODO: close userspace colo proxy sock fd.
          */
         return;
     }
@@ -286,6 +293,11 @@ int colo_proxy_checkpoint(libxl__colo_proxy_state *cps,
      * then we will add qemu API support this func.
      */
     if (cps->is_userspace_proxy) {
+        /*
+         * TODO:
+         * colo_userspace_proxy_recv(cps, &buff, timeout_us);
+         * to get checkpoint event.
+         */
         sleep(timeout_us / 1000000);
         return 0;
     }
diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c
index 08e749f..fb5dfdb 100644
--- a/tools/libxl/libxl_nic.c
+++ b/tools/libxl/libxl_nic.c
@@ -646,6 +646,14 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc,
                                 GCSPRINTF("%s/filter_sec_rewriter0_queue", libxl_path),
                                 (const char **)(&nic->filter_sec_rewriter0_queue));
     if (rc) goto out;
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
+                                GCSPRINTF("%s/colo_checkpoint_host", libxl_path),
+                                (const char **)(&nic->colo_checkpoint_host));
+    if (rc) goto out;
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
+                                GCSPRINTF("%s/colo_checkpoint_port", libxl_path),
+                                (const char **)(&nic->colo_checkpoint_port));
+    if (rc) goto out;
 
     /* vif_ioemu nics use the same xenstore entries as vif interfaces */
     rc = libxl__xs_read_checked(gc, XBT_NULL,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9063ca9..41e7d38 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -671,7 +671,9 @@ libxl_device_nic = Struct("device_nic", [
     ("filter_sec_redirector1_queue", string),
     ("filter_sec_redirector1_indev", string),
     ("filter_sec_redirector1_outdev", string),
-    ("filter_sec_rewriter0_queue", string)
+    ("filter_sec_rewriter0_queue", string),
+    ("colo_checkpoint_host", string),
+    ("colo_checkpoint_port", string)
     ])
 
 libxl_device_pci = Struct("device_pci", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index e587ab3..53ab561 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1144,6 +1144,10 @@ static int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *to
         replace_string(&nic->filter_sec_redirector1_outdev, oparg);
     } else if (MATCH_OPTION("filter_sec_rewriter0_queue", token, oparg)) {
         replace_string(&nic->filter_sec_rewriter0_queue, oparg);
+    } else if (MATCH_OPTION("colo_checkpoint_host", token, oparg)) {
+        replace_string(&nic->colo_checkpoint_host, oparg);
+    } else if (MATCH_OPTION("colo_checkpoint_port", token, oparg)) {
+        replace_string(&nic->colo_checkpoint_port, oparg);
     } else if (MATCH_OPTION("accel", token, oparg)) {
         fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
     } else {
-- 
2.7.4




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-01-26  6:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  6:36 [PATCH RFC 0/6] COLO-Proxy: Make Xen COLO use userspace colo-proxy Zhang Chen
2017-01-26  6:36 ` [PATCH RFC 1/6] COLO-Proxy: Add remus command to open userspace proxy Zhang Chen
2017-01-27 17:05   ` Wei Liu
2017-02-06  6:01     ` Zhang Chen
2017-01-26  6:36 ` [PATCH RFC 2/6] COLO-Proxy: Setup userspace colo-proxy on primary side Zhang Chen
2017-01-27 17:05   ` Wei Liu
2017-02-06  6:32     ` Zhang Chen
2017-01-26  6:36 ` [PATCH RFC 3/6] COLO-Proxy: Setup userspace colo-proxy on secondary side Zhang Chen
2017-01-27 17:05   ` Wei Liu
2017-02-06  9:27     ` Zhang Chen
2017-02-06 11:25       ` Wei Liu
2017-02-07  1:39         ` Zhang Chen
2017-01-26  6:36 ` [PATCH RFC 4/6] COLO-Proxy: Add primary userspace colo proxy start args Zhang Chen
2017-01-27 17:05   ` Wei Liu
2017-02-08  8:53     ` Zhang Chen
2017-01-26  6:36 ` [PATCH RFC 5/6] COLO-Proxy: Add secondary userspace colo-proxy " Zhang Chen
2017-01-27 17:05   ` Wei Liu
2017-02-08  8:53     ` Zhang Chen
2017-01-26  6:36 ` Zhang Chen [this message]
2017-01-27 17:05   ` [PATCH RFC 6/6] COLO-Proxy: Use socket to get checkpoint event Wei Liu
2017-02-08  8:54     ` Zhang Chen
2017-01-27 17:08 ` [PATCH RFC 0/6] COLO-Proxy: Make Xen COLO use userspace colo-proxy Wei Liu
2017-02-08  8:54   ` Zhang Chen

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=1485412569-7431-7-git-send-email-zhangchen.fnst@cn.fujitsu.com \
    --to=zhangchen.fnst@cn.fujitsu.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=biannm@cn.fujitsu.com \
    --cc=eddie.dong@intel.com \
    --cc=imhy.yang@gmail.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.