Signed-off-by: Maxim Nestratov <mnestratov(a)parallels.com>
---
src/parallels/parallels_sdk.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 05f11b0..874638f 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -452,7 +452,8 @@ prlsdkAddDomainVideoInfo(PRL_HANDLE sdkdom, virDomainDefPtr def)
static int
prlsdkGetDiskInfo(PRL_HANDLE prldisk,
virDomainDiskDefPtr disk,
- bool isCdrom)
+ bool isCdrom,
+ bool isCt)
{
char *buf = NULL;
PRL_UINT32 buflen = 0;
@@ -627,7 +628,7 @@ prlsdkAddDomainHardDisksInfo(PRL_HANDLE sdkdom, virDomainDefPtr def)
if (!(disk = virDomainDiskDefNew(NULL)))
goto error;
- if (prlsdkGetDiskInfo(hdd, disk, false) < 0)
+ if (prlsdkGetDiskInfo(hdd, disk, false, IS_CT(def)) < 0)
goto error;
if (VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk) < 0)
@@ -667,7 +668,7 @@ prlsdkAddDomainOpticalDisksInfo(PRL_HANDLE sdkdom, virDomainDefPtr
def)
if (!(disk = virDomainDiskDefNew(NULL)))
goto error;
- if (prlsdkGetDiskInfo(cdrom, disk, true) < 0)
+ if (prlsdkGetDiskInfo(cdrom, disk, true, IS_CT(def)) < 0)
goto error;
PrlHandle_Free(cdrom);
@@ -2882,7 +2883,10 @@ static int prlsdkDelDisk(PRL_HANDLE sdkdom, int idx)
return ret;
}
-static int prlsdkAddDisk(PRL_HANDLE sdkdom, virDomainDiskDefPtr disk, bool bootDisk)
+static int prlsdkAddDisk(PRL_HANDLE sdkdom,
+ virDomainDiskDefPtr disk,
+ bool bootDisk,
+ bool isCt)
{
PRL_RESULT pret;
PRL_HANDLE sdkdisk = PRL_INVALID_HANDLE;
@@ -3063,7 +3067,7 @@ prlsdkAttachVolume(virDomainObjPtr dom, virDomainDiskDefPtr disk)
if (PRL_FAILED(waitJob(job)))
goto cleanup;
- ret = prlsdkAddDisk(privdom->sdkdom, disk, false);
+ ret = prlsdkAddDisk(privdom->sdkdom, disk, false, IS_CT(dom->def));
if (ret == 0) {
job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE);
if (PRL_FAILED(waitJob(job))) {
@@ -3286,7 +3290,7 @@ prlsdkDoApplyConfig(virConnectPtr conn,
needBoot = false;
bootDisk = true;
}
- if (prlsdkAddDisk(sdkdom, def->disks[i], bootDisk) < 0)
+ if (prlsdkAddDisk(sdkdom, def->disks[i], bootDisk, IS_CT(def)) < 0)
goto error;
}
--
2.1.0