@@ -1244,7 +1244,13 @@ static void initiate_domain_create(libxl__egc *egc,
ret = libxl__domain_config_setdefault(gc,d_config,domid);
if (ret) goto error_out;
- ret = libxl__domain_make(gc, d_config, dbs, &domid, dcs->soft_reset);
+ /* If no dm_restore_file is specified we are in the normal path */
+ if (!d_config->dm_restore_file)
+ ret = libxl__domain_make(gc, d_config, dbs, &domid, dcs->soft_reset);
+ else
+ ret = libxl__domain_make_xs_entries(gc, d_config, &dcs->build_state,
+ domid);
+
if (ret) {
LOGD(ERROR, domid, "cannot make domain: %d", ret);
dcs->guest_domid = domid;
@@ -2052,6 +2058,9 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
cdcs->dcs.domid = INVALID_DOMID;
cdcs->dcs.soft_reset = false;
+ if (d_config->dm_restore_file)
+ cdcs->dcs.domid = *domid;
+
if (cdcs->dcs.restore_params.checkpointed_stream ==
LIBXL_CHECKPOINTED_STREAM_COLO) {
cdcs->dcs.colo_proxy_script =
@@ -961,6 +961,7 @@ libxl_domain_config = Struct("domain_config", [
("on_watchdog", libxl_action_on_shutdown),
("on_crash", libxl_action_on_shutdown),
("on_soft_reset", libxl_action_on_shutdown),
+ ("dm_restore_file", string, {'const': True}),
], dir=DIR_IN)
libxl_diskinfo = Struct("diskinfo", [
No need to call libxl__domain_make since the domain already exists, only need to populate the xenstore entries via libxl__domain_make_xs_entries. Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com> --- tools/libxl/libxl_create.c | 11 ++++++++++- tools/libxl/libxl_types.idl | 1 + 2 files changed, 11 insertions(+), 1 deletion(-)