[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC v3 RESEND 06/12] Migration with Local Disks Mirroring: Added 'mirror_disks' field to domain_create_state
A new field 'mirror_disks' is added to the libxl struct libxl__domain_create_state to record if QEMU drives should be mirrored during migration. This variable is used to setup the sequence of calls and streams in libxl and libxc. Signed-off-by: Bruno Alvisio <bruno.alvisio@xxxxxxxxx> --- tools/libxl/libxl.h | 4 ++-- tools/libxl/libxl_create.c | 8 +++++--- tools/libxl/libxl_internal.h | 1 + tools/ocaml/libs/xl/xenlight_stubs.c | 2 +- tools/xl/xl_vmcontrol.c | 5 +++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 7828ba8..25245cc 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1371,7 +1371,7 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, uint32_t *domid, int restore_fd, - int send_back_fd, + int send_back_fd, int mirror_disks, const libxl_domain_restore_params *params, const libxl_asyncop_how *ao_how, const libxl_asyncprogress_how *aop_console_how) @@ -1412,7 +1412,7 @@ static inline int libxl_domain_create_restore_0x040400( LIBXL_EXTERNAL_CALLERS_ONLY { return libxl_domain_create_restore(ctx, d_config, domid, restore_fd, - -1, params, ao_how, aop_console_how); + -1, 0, params, ao_how, aop_console_how); } #define libxl_domain_create_restore libxl_domain_create_restore_0x040400 diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index f15fb21..95978a8 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1639,6 +1639,7 @@ static void domain_create_cb(libxl__egc *egc, static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config, uint32_t *domid, int restore_fd, int send_back_fd, + int mirror_disks, const libxl_domain_restore_params *params, const libxl_asyncop_how *ao_how, const libxl_asyncprogress_how *aop_console_how) @@ -1654,6 +1655,7 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_domain_config_copy(ctx, &cdcs->dcs.guest_config_saved, d_config); cdcs->dcs.restore_fd = cdcs->dcs.libxc_fd = restore_fd; cdcs->dcs.send_back_fd = send_back_fd; + cdcs->dcs.mirror_disks = mirror_disks; if (restore_fd > -1) { cdcs->dcs.restore_params = *params; rc = libxl__fd_flags_modify_save(gc, cdcs->dcs.restore_fd, @@ -1881,13 +1883,13 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, const libxl_asyncprogress_how *aop_console_how) { unset_disk_colo_restore(d_config); - return do_domain_create(ctx, d_config, domid, -1, -1, NULL, + return do_domain_create(ctx, d_config, domid, -1, -1, 0, NULL, ao_how, aop_console_how); } int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, uint32_t *domid, int restore_fd, - int send_back_fd, + int send_back_fd, int mirror_disks, const libxl_domain_restore_params *params, const libxl_asyncop_how *ao_how, const libxl_asyncprogress_how *aop_console_how) @@ -1899,7 +1901,7 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, } return do_domain_create(ctx, d_config, domid, restore_fd, send_back_fd, - params, ao_how, aop_console_how); + mirror_disks, params, ao_how, aop_console_how); } int libxl_domain_soft_reset(libxl_ctx *ctx, diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index e8a4dc2..ee62bfb 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -3757,6 +3757,7 @@ struct libxl__domain_create_state { int restore_fd, libxc_fd; int restore_fdfl; /* original flags of restore_fd */ int send_back_fd; + int mirror_disks; libxl_domain_restore_params restore_params; uint32_t domid_soft_reset; libxl__domain_create_cb *callback; diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c index a757782..900d7f1 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -538,7 +538,7 @@ value stub_libxl_domain_create_restore(value ctx, value domain_config, value par caml_enter_blocking_section(); ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, restore_fd, - -1, &c_params, ao_how, NULL); + -1, 0, &c_params, ao_how, NULL); caml_leave_blocking_section(); free(ao_how); diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index 89c2b25..c22c6fd 100644 --- a/tools/xl/xl_vmcontrol.c +++ b/tools/xl/xl_vmcontrol.c @@ -882,8 +882,9 @@ start: ret = libxl_domain_create_restore(ctx, &d_config, &domid, restore_fd, - send_back_fd, ¶ms, - 0, autoconnect_console_how); + send_back_fd, + dom_info->mirror_disks, + ¶ms, 0, autoconnect_console_how); libxl_domain_restore_params_dispose(¶ms); -- 2.3.2 (Apple Git-55) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |