[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v10 30/31] setup and control colo proxy on secondary side
setup and control colo proxy on secondary side Signed-off-by: Yang Hongyang <hongyang.yang@xxxxxxxxxxxx> Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx> --- tools/libxl/libxl_colo_restore.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl_colo_restore.c b/tools/libxl/libxl_colo_restore.c index eff80ca..c4b1fb4 100644 --- a/tools/libxl/libxl_colo_restore.c +++ b/tools/libxl/libxl_colo_restore.c @@ -50,9 +50,11 @@ static void libxl__colo_restore_domain_checkpoint_callback(void *data); static void libxl__colo_restore_domain_wait_checkpoint_callback(void *data); static void libxl__colo_restore_domain_suspend_callback(void *data); +extern const libxl__checkpoint_device_instance_ops colo_restore_device_nic; extern const libxl__checkpoint_device_instance_ops colo_restore_device_qdisk; static const libxl__checkpoint_device_instance_ops *colo_restore_ops[] = { + &colo_restore_device_nic, &colo_restore_device_qdisk, NULL, }; @@ -153,8 +155,14 @@ static int init_device_subkind(libxl__checkpoint_devices_state *cds) int rc; STATE_AO_GC(cds->ao); + rc = init_subkind_colo_nic(cds); + if (rc) goto out; + rc = init_subkind_qdisk(cds); - if (rc) goto out; + if (rc) { + cleanup_subkind_colo_nic(cds); + goto out; + } rc = 0; out: @@ -166,6 +174,7 @@ static void cleanup_device_subkind(libxl__checkpoint_devices_state *cds) /* cleanup device subkind-specific state in the libxl ctx */ STATE_AO_GC(cds->ao); + cleanup_subkind_colo_nic(cds); cleanup_subkind_qdisk(cds); } @@ -347,6 +356,8 @@ static void colo_restore_teardown_devices_done(libxl__egc *egc, if (crcs->teardown_devices) cleanup_device_subkind(cds); + colo_proxy_teardown(&crs->cps); + rc = crcs->saved_rc; if (!rc) { crcs->callback = do_failover_done; @@ -605,6 +616,8 @@ static void colo_restore_preresume_cb(libxl__egc *egc, } } + colo_proxy_preresume(&crs->cps); + colo_restore_resume_vm(egc, crcs); return; @@ -641,6 +654,8 @@ static void colo_resume_vm_done(libxl__egc *egc, crcs->status = LIBXL_COLO_RESUMED; + colo_proxy_postresume(&crs->cps); + /* avoid calling stream->completion_callback() more than once */ if (crs->saved_cb) { dcs->callback = crs->saved_cb; @@ -762,13 +777,20 @@ static void colo_setup_checkpoint_devices(libxl__egc *egc, STATE_AO_GC(crs->ao); - /* TODO: nic support */ - cds->device_kind_flags = (1 << LIBXL__DEVICE_KIND_VBD); + cds->device_kind_flags = (1 << LIBXL__DEVICE_KIND_VIF) | + (1 << LIBXL__DEVICE_KIND_VBD); cds->callback = colo_restore_setup_cds_done; cds->ao = ao; cds->domid = crs->domid; cds->ops = colo_restore_ops; + crs->cps.ao = ao; + if (colo_proxy_setup(&crs->cps)) { + LOG(ERROR, "COLO: failed to setup colo proxy for guest with domid %u", + cds->domid); + goto out; + } + if (init_device_subkind(cds)) goto out; -- 2.5.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |