@@ -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 {
@@ -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;
}
@@ -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,
@@ -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", [
@@ -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 {
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(-)