Since we are going to add block devices as root disks we have
to specify root mount point for boot block devices. But we
shouldn't do this if a filesystem disk with such
target mount point already exists.
Signed-off-by: Maxim Nestratov <mnestratov(a)parallels.com>
---
src/parallels/parallels_sdk.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 874638f..e4d69f4 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -3047,6 +3047,13 @@ static int prlsdkAddDisk(PRL_HANDLE sdkdom,
if (prlsdkAddDeviceToBootList(sdkdom, devIndex, devType, 0) < 0)
goto cleanup;
+
+ /* If we add physical device as a boot disk to container
+ * we have to specify mount point for it */
+ if (isCt) {
+ pret = PrlVmDevHd_SetMountPoint(sdkdisk, "/");
+ prlsdkCheckRetGoto(pret, cleanup);
+ }
}
return 0;
@@ -3281,6 +3288,13 @@ prlsdkDoApplyConfig(virConnectPtr conn,
goto error;
}
+ for (i = 0; i < def->nfss; i++) {
+ if (STREQ(def->fss[i]->dst, "/"))
+ needBoot = false;
+ if (prlsdkAddFS(sdkdom, def->fss[i]) < 0)
+ goto error;
+ }
+
for (i = 0; i < def->ndisks; i++) {
bool bootDisk = false;
@@ -3294,11 +3308,6 @@ prlsdkDoApplyConfig(virConnectPtr conn,
goto error;
}
- for (i = 0; i < def->nfss; i++) {
- if (prlsdkAddFS(sdkdom, def->fss[i]) < 0)
- goto error;
- }
-
return 0;
error:
--
2.1.0