]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
parallels: fix home directory for VMs
authorMaxim Nestratov <mnestratov@parallels.com>
Fri, 13 Mar 2015 15:40:42 +0000 (18:40 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 17 Mar 2015 14:42:49 +0000 (15:42 +0100)
Failures of parallelsStorageOpen occured because we incorrectly treated
path to VM' configuration file as a directory. Now initialization of
parallels VM domains home directory is fixed.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
src/parallels/parallels_sdk.c

index 3a7efe378014694bd186cb551270c6a322853086..ee71bd6967b6669fe21f65a394617edb71d37837 100644 (file)
@@ -1245,6 +1245,14 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
     pret = PrlVmCfg_GetHomePath(sdkdom, pdom->home, &buflen);
     prlsdkCheckRetGoto(pret, error);
 
+    /* For VMs pdom->home is actually /directory/config.pvs */
+    if (!IS_CT(def)) {
+        /* Get rid of /config.pvs in path string */
+        char *s = strrchr(pdom->home, '/');
+        if (s)
+            *s = '\0';
+    }
+
     if (olddom) {
         /* assign new virDomainDef without any checks */
         /* we can't use virDomainObjAssignDef, because it checks