[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] tools/libxl: Add iothread support for COLO



From: Zhang Chen <chen.zhang@xxxxxxxxx>

Xen COLO and KVM COLO shared lots of code in Qemu.
KVM COLO has added the iothread support, so we add it on Xen.

Detail:
https://wiki.qemu.org/Features/COLO

Signed-off-by: Zhang Chen <chen.zhang@xxxxxxxxx>
---
 tools/libxl/libxl_dm.c      | 14 +++++++++++---
 tools/libxl/libxl_types.idl |  2 ++
 tools/xl/xl_parse.c         |  4 ++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index f4fc96415d..6bb400efdf 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1629,17 +1629,25 @@ static int libxl__build_device_model_args_new(libxl__gc 
*gc,
                                      nics[i].colo_filter_redirector1_queue,
                                      nics[i].colo_filter_redirector1_outdev));
                     }
+                    if (nics[i].colo_iothread) {
+                        flexarray_append(dm_args, "-object");
+                        flexarray_append(dm_args,
+                           GCSPRINTF("iothread,id=%s",
+                                     nics[i].colo_iothread));
+                    }
                     if (nics[i].colo_compare_pri_in &&
                         nics[i].colo_compare_sec_in &&
                         nics[i].colo_compare_out &&
-                        nics[i].colo_compare_notify_dev) {
+                        nics[i].colo_compare_notify_dev &&
+                        nics[i].colo_compare_iothread) {
                         flexarray_append(dm_args, "-object");
                         flexarray_append(dm_args,
-                           
GCSPRINTF("colo-compare,id=c1,primary_in=%s,secondary_in=%s,outdev=%s,notify_dev=%s",
+                           
GCSPRINTF("colo-compare,id=c1,primary_in=%s,secondary_in=%s,outdev=%s,notify_dev=%s,iothread=%s",
                                      nics[i].colo_compare_pri_in,
                                      nics[i].colo_compare_sec_in,
                                      nics[i].colo_compare_out,
-                                     nics[i].colo_compare_notify_dev));
+                                     nics[i].colo_compare_notify_dev,
+                                     nics[i].colo_compare_iothread));
                     }
                 }
                 ioemu_nics++;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index b61399ce36..f0435a5177 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -727,10 +727,12 @@ libxl_device_nic = Struct("device_nic", [
     ("colo_filter_redirector1_queue", string),
     ("colo_filter_redirector1_indev", string),
     ("colo_filter_redirector1_outdev", string),
+    ("colo_iothread", string),
     ("colo_compare_pri_in", string),
     ("colo_compare_sec_in", string),
     ("colo_compare_out", string),
     ("colo_compare_notify_dev", string),
+    ("colo_compare_iothread", string),
     ("colo_sock_sec_redirector0_id", string),
     ("colo_sock_sec_redirector0_ip", string),
     ("colo_sock_sec_redirector0_port", string),
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index e105bda2bb..cd16856910 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -521,6 +521,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config 
**config, char *token)
         replace_string(&nic->colo_filter_redirector1_indev, oparg);
     } else if (MATCH_OPTION("colo_filter_redirector1_outdev", token, oparg)) {
         replace_string(&nic->colo_filter_redirector1_outdev, oparg);
+    } else if (MATCH_OPTION("colo_iothread", token, oparg)) {
+        replace_string(&nic->colo_iothread, oparg);
     } else if (MATCH_OPTION("colo_compare_pri_in", token, oparg)) {
         replace_string(&nic->colo_compare_pri_in, oparg);
     } else if (MATCH_OPTION("colo_compare_sec_in", token, oparg)) {
@@ -529,6 +531,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config 
**config, char *token)
         replace_string(&nic->colo_compare_out, oparg);
     } else if (MATCH_OPTION("colo_compare_notify_dev", token, oparg)) {
         replace_string(&nic->colo_compare_notify_dev, oparg);
+    } else if (MATCH_OPTION("colo_compare_iothread", token, oparg)) {
+        replace_string(&nic->colo_compare_iothread, oparg);
     } else if (MATCH_OPTION("colo_sock_sec_redirector0_id", token, oparg)) {
         replace_string(&nic->colo_sock_sec_redirector0_id, oparg);
     } else if (MATCH_OPTION("colo_sock_sec_redirector0_ip", token, oparg)) {
-- 
2.17.GIT


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.