From: Vitaly Kuznetsov Date: Mon, 20 Mar 2017 18:03:10 +0000 (+0100) Subject: libxl: don't try to rename dm save file for PVH X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cfb0cfb27d25e6f4ae81c13f201367ab9a350611;p=people%2Froyger%2Fxen.git libxl: don't try to rename dm save file for PVH Guests with LIBXL_DEVICE_MODEL_VERSION_NONE don't have a device model running so there is no save file to rename. Signed-off-by: Vitaly Kuznetsov Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 25389e13f8..95fd96b29c 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1664,12 +1664,16 @@ static void domain_soft_reset_cb(libxl__egc *egc, goto error; } - savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", dds->domid); - restorefile = GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", dds->domid); - rc = rename(savefile, restorefile); - if (rc) { - LOGD(ERROR, dds->domid, "failed to rename dm save file."); - goto error; + if (cdcs->dcs.guest_config->b_info.device_model_version != + LIBXL_DEVICE_MODEL_VERSION_NONE) { + savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", dds->domid); + restorefile = GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", + dds->domid); + rc = rename(savefile, restorefile); + if (rc) { + LOGD(ERROR, dds->domid, "failed to rename dm save file."); + goto error; + } } initiate_domain_create(egc, &cdcs->dcs);