]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
libxl: don't try to rename dm save file for PVH
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 20 Mar 2017 18:03:10 +0000 (19:03 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 22 Mar 2017 11:28:25 +0000 (11:28 +0000)
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 <vkuznets@redhat.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_create.c

index 25389e13f8ae365aa5845ccd393e7e2cfc35e980..95fd96b29cce838a430a8fd58eac14b25ee0a5a9 100644 (file)
@@ -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);