parallels: process '/' mount point correctly for containers

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@parallels.com>
This commit is contained in:
Maxim Nestratov 2015-06-04 00:10:00 +03:00 committed by Dmitry Guryanov
parent 022ece9bdc
commit 0b7b76cc45

View File

@ -3080,6 +3080,13 @@ static int prlsdkAddDisk(PRL_HANDLE sdkdom,
if (prlsdkAddDeviceToBootList(sdkdom, devIndex, devType, 0) < 0) if (prlsdkAddDeviceToBootList(sdkdom, devIndex, devType, 0) < 0)
goto cleanup; 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; return 0;
@ -3314,6 +3321,13 @@ prlsdkDoApplyConfig(virConnectPtr conn,
goto error; 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++) { for (i = 0; i < def->ndisks; i++) {
bool bootDisk = false; bool bootDisk = false;
@ -3327,11 +3341,6 @@ prlsdkDoApplyConfig(virConnectPtr conn,
goto error; goto error;
} }
for (i = 0; i < def->nfss; i++) {
if (prlsdkAddFS(sdkdom, def->fss[i]) < 0)
goto error;
}
return 0; return 0;
error: error: