diff mbox

[V4,5/8] COLO-Proxy: Add secondary userspace colo-proxy start args

Message ID 1488769166-28738-6-git-send-email-zhangchen.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang Chen March 6, 2017, 2:59 a.m. UTC
Qemu need this args to start userspace colo-proxy.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 tools/libxl/libxl_dm.c      | 34 ++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_nic.c     | 27 +++++++++++++++++++++++++++
 tools/libxl/libxl_types.idl | 15 ++++++++++++++-
 tools/xl/xl_parse.c         | 27 +++++++++++++++++++++++++++
 4 files changed, 102 insertions(+), 1 deletion(-)

Comments

Wei Liu March 14, 2017, 11:24 a.m. UTC | #1
On Mon, Mar 06, 2017 at 10:59:23AM +0800, Zhang Chen wrote:
> Qemu need this args to start userspace colo-proxy.
> 
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
> index 88ef1c6..d2bbe26 100644
> --- a/tools/xl/xl_parse.c
> +++ b/tools/xl/xl_parse.c
> @@ -516,6 +516,33 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
>          replace_string(&nic->colo_compare_sec_in, oparg);
>      } else if (MATCH_OPTION("colo_compare_out", token, oparg)) {
>          replace_string(&nic->colo_compare_out, oparg);
> +

Stray blank line -- will try to fix it up while committing.
Wei Liu March 14, 2017, 11:39 a.m. UTC | #2
On Tue, Mar 14, 2017 at 11:24:12AM +0000, Wei Liu wrote:
> On Mon, Mar 06, 2017 at 10:59:23AM +0800, Zhang Chen wrote:
> > Qemu need this args to start userspace colo-proxy.
> > 
> > Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> > diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
> > index 88ef1c6..d2bbe26 100644
> > --- a/tools/xl/xl_parse.c
> > +++ b/tools/xl/xl_parse.c
> > @@ -516,6 +516,33 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
> >          replace_string(&nic->colo_compare_sec_in, oparg);
> >      } else if (MATCH_OPTION("colo_compare_out", token, oparg)) {
> >          replace_string(&nic->colo_compare_out, oparg);
> > +
> 
> Stray blank line -- will try to fix it up while committing.

Actually, removing this will cause rebase error for the next patch. I
will just send another patch to remove this blank line when I get around
to it.

Wei.
Zhang Chen March 15, 2017, 1:53 a.m. UTC | #3
On 03/14/2017 07:39 PM, Wei Liu wrote:
> On Tue, Mar 14, 2017 at 11:24:12AM +0000, Wei Liu wrote:
>> On Mon, Mar 06, 2017 at 10:59:23AM +0800, Zhang Chen wrote:
>>> Qemu need this args to start userspace colo-proxy.
>>>
>>> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
>> Acked-by: Wei Liu <wei.liu2@citrix.com>
>>
>>> diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
>>> index 88ef1c6..d2bbe26 100644
>>> --- a/tools/xl/xl_parse.c
>>> +++ b/tools/xl/xl_parse.c
>>> @@ -516,6 +516,33 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
>>>           replace_string(&nic->colo_compare_sec_in, oparg);
>>>       } else if (MATCH_OPTION("colo_compare_out", token, oparg)) {
>>>           replace_string(&nic->colo_compare_out, oparg);
>>> +
>> Stray blank line -- will try to fix it up while committing.
> Actually, removing this will cause rebase error for the next patch. I
> will just send another patch to remove this blank line when I get around
> to it.

Don't need to bother you, I will send a patch for it.

Thanks
Zhang Chen

> Wei.
>
>
> .
>
diff mbox

Patch

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index abd4edd..0fabd64 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1274,6 +1274,40 @@  static int libxl__build_device_model_args_new(libxl__gc *gc,
 
                 if (state->saved_state) {
                     /* secondary colo run */
+
+                    APPEND_COLO_SOCK_CLIENT(sock_sec_redirector0_id,
+                                            sock_sec_redirector0_ip,
+                                            sock_sec_redirector0_port);
+
+                    APPEND_COLO_SOCK_CLIENT(sock_sec_redirector1_id,
+                                            sock_sec_redirector1_ip,
+                                            sock_sec_redirector1_port);
+
+                    if (nics[i].colo_filter_sec_redirector0_queue &&
+                        nics[i].colo_filter_sec_redirector0_indev) {
+                        flexarray_append(dm_args, "-object");
+                        flexarray_append(dm_args,
+                           GCSPRINTF("filter-redirector,id=rs1,netdev=net%d,queue=%s,indev=%s",
+                                     nics[i].devid,
+                                     nics[i].colo_filter_sec_redirector0_queue,
+                                     nics[i].colo_filter_sec_redirector0_indev));
+                    }
+                    if (nics[i].colo_filter_sec_redirector1_queue &&
+                        nics[i].colo_filter_sec_redirector1_indev) {
+                        flexarray_append(dm_args, "-object");
+                        flexarray_append(dm_args,
+                           GCSPRINTF("filter-redirector,id=rs2,netdev=net%d,queue=%s,outdev=%s",
+                                     nics[i].devid,
+                                     nics[i].colo_filter_sec_redirector1_queue,
+                                     nics[i].colo_filter_sec_redirector1_outdev));
+                    }
+                    if (nics[i].colo_filter_sec_rewriter0_queue) {
+                        flexarray_append(dm_args, "-object");
+                        flexarray_append(dm_args,
+                           GCSPRINTF("filter-rewriter,id=rs3,netdev=net%d,queue=%s",
+                                     nics[i].devid,
+                                     nics[i].colo_filter_sec_rewriter0_queue));
+                    }
                 } else {
                     /* primary colo run */
 
diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c
index 7c57bcf..5e1fecd 100644
--- a/tools/libxl/libxl_nic.c
+++ b/tools/libxl/libxl_nic.c
@@ -233,6 +233,20 @@  static void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     MAYBE_ADD_COLO_ARGS(compare_sec_in);
     MAYBE_ADD_COLO_ARGS(compare_out);
 
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_id);
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_ip);
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_port);
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_id);
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_ip);
+    MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_port);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_queue);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_indev);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_outdev);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_queue);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_indev);
+    MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_outdev);
+    MAYBE_ADD_COLO_ARGS(filter_sec_rewriter0_queue);
+
 #undef MAYBE_ADD_COLO_ARGS
 
     flexarray_append(back, "mac");
@@ -424,6 +438,19 @@  static int libxl__device_nic_from_xenstore(libxl__gc *gc,
     CHECK_COLO_ARGS(compare_pri_in);
     CHECK_COLO_ARGS(compare_sec_in);
     CHECK_COLO_ARGS(compare_out);
+    CHECK_COLO_ARGS(sock_sec_redirector0_id);
+    CHECK_COLO_ARGS(sock_sec_redirector0_ip);
+    CHECK_COLO_ARGS(sock_sec_redirector0_port);
+    CHECK_COLO_ARGS(sock_sec_redirector1_id);
+    CHECK_COLO_ARGS(sock_sec_redirector1_ip);
+    CHECK_COLO_ARGS(sock_sec_redirector1_port);
+    CHECK_COLO_ARGS(filter_sec_redirector0_queue);
+    CHECK_COLO_ARGS(filter_sec_redirector0_indev);
+    CHECK_COLO_ARGS(filter_sec_redirector0_outdev);
+    CHECK_COLO_ARGS(filter_sec_redirector1_queue);
+    CHECK_COLO_ARGS(filter_sec_redirector1_indev);
+    CHECK_COLO_ARGS(filter_sec_redirector1_outdev);
+    CHECK_COLO_ARGS(filter_sec_rewriter0_queue);
 
 #undef CHECK_COLO_ARGS
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 07ce345..47e96b1 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -658,7 +658,20 @@  libxl_device_nic = Struct("device_nic", [
     ("colo_filter_redirector1_outdev", string),
     ("colo_compare_pri_in", string),
     ("colo_compare_sec_in", string),
-    ("colo_compare_out", string)
+    ("colo_compare_out", string),
+    ("colo_sock_sec_redirector0_id", string),
+    ("colo_sock_sec_redirector0_ip", string),
+    ("colo_sock_sec_redirector0_port", string),
+    ("colo_sock_sec_redirector1_id", string),
+    ("colo_sock_sec_redirector1_ip", string),
+    ("colo_sock_sec_redirector1_port", string),
+    ("colo_filter_sec_redirector0_queue", string),
+    ("colo_filter_sec_redirector0_indev", string),
+    ("colo_filter_sec_redirector0_outdev", string),
+    ("colo_filter_sec_redirector1_queue", string),
+    ("colo_filter_sec_redirector1_indev", string),
+    ("colo_filter_sec_redirector1_outdev", string),
+    ("colo_filter_sec_rewriter0_queue", string)
     ])
 
 libxl_device_pci = Struct("device_pci", [
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 88ef1c6..d2bbe26 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -516,6 +516,33 @@  int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
         replace_string(&nic->colo_compare_sec_in, oparg);
     } else if (MATCH_OPTION("colo_compare_out", token, oparg)) {
         replace_string(&nic->colo_compare_out, 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)) {
+        replace_string(&nic->colo_sock_sec_redirector0_ip, oparg);
+    } else if (MATCH_OPTION("colo_sock_sec_redirector0_port", token, oparg)) {
+        replace_string(&nic->colo_sock_sec_redirector0_port, oparg);
+    } else if (MATCH_OPTION("colo_sock_sec_redirector1_id", token, oparg)) {
+        replace_string(&nic->colo_sock_sec_redirector1_id, oparg);
+    } else if (MATCH_OPTION("colo_sock_sec_redirector1_ip", token, oparg)) {
+        replace_string(&nic->colo_sock_sec_redirector1_ip, oparg);
+    } else if (MATCH_OPTION("colo_sock_sec_redirector1_port", token, oparg)) {
+        replace_string(&nic->colo_sock_sec_redirector1_port, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector0_queue", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector0_queue, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector0_indev", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector0_indev, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector0_outdev", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector0_outdev, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector1_queue", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector1_queue, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector1_indev", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector1_indev, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_redirector1_outdev", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_redirector1_outdev, oparg);
+    } else if (MATCH_OPTION("colo_filter_sec_rewriter0_queue", token, oparg)) {
+        replace_string(&nic->colo_filter_sec_rewriter0_queue, oparg);
     } else if (MATCH_OPTION("accel", token, oparg)) {
         fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
     } else if (MATCH_OPTION("devid", token, oparg)) {