提交 baad90fb 编写于 作者: M Mikhail Feoktistov 提交者: Maxim Nestratov

vz: handle sourceless cdroms

libvirt handles empty source as NULL, while vz sdk as
"" thus we need a bit of conversion.
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 88c6c4ab
...@@ -565,7 +565,7 @@ prlsdkGetDiskInfo(vzDriverPtr driver, ...@@ -565,7 +565,7 @@ prlsdkGetDiskInfo(vzDriverPtr driver,
if (!(buf = prlsdkGetStringParamVar(PrlVmDev_GetFriendlyName, prldisk))) if (!(buf = prlsdkGetStringParamVar(PrlVmDev_GetFriendlyName, prldisk)))
goto cleanup; goto cleanup;
if (virDomainDiskSetSource(disk, buf) < 0) if (*buf != '\0' && virDomainDiskSetSource(disk, buf) < 0)
goto cleanup; goto cleanup;
if (prlsdkGetDiskId(prldisk, isCt, &disk->bus, &disk->dst) < 0) if (prlsdkGetDiskId(prldisk, isCt, &disk->bus, &disk->dst) < 0)
...@@ -3183,6 +3183,7 @@ static int prlsdkAddDisk(vzDriverPtr driver, ...@@ -3183,6 +3183,7 @@ static int prlsdkAddDisk(vzDriverPtr driver,
PRL_DEVICE_TYPE devType; PRL_DEVICE_TYPE devType;
PRL_CLUSTERED_DEVICE_SUBTYPE scsiModel; PRL_CLUSTERED_DEVICE_SUBTYPE scsiModel;
char *dst = NULL; char *dst = NULL;
const char *path = disk->src->path ? : "";
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
devType = PDE_HARD_DISK; devType = PDE_HARD_DISK;
...@@ -3206,10 +3207,10 @@ static int prlsdkAddDisk(vzDriverPtr driver, ...@@ -3206,10 +3207,10 @@ static int prlsdkAddDisk(vzDriverPtr driver,
pret = PrlVmDev_SetEmulatedType(sdkdisk, emutype); pret = PrlVmDev_SetEmulatedType(sdkdisk, emutype);
prlsdkCheckRetGoto(pret, cleanup); prlsdkCheckRetGoto(pret, cleanup);
pret = PrlVmDev_SetSysName(sdkdisk, disk->src->path); pret = PrlVmDev_SetSysName(sdkdisk, path);
prlsdkCheckRetGoto(pret, cleanup); prlsdkCheckRetGoto(pret, cleanup);
pret = PrlVmDev_SetFriendlyName(sdkdisk, disk->src->path); pret = PrlVmDev_SetFriendlyName(sdkdisk, path);
prlsdkCheckRetGoto(pret, cleanup); prlsdkCheckRetGoto(pret, cleanup);
drive = &disk->info.addr.drive; drive = &disk->info.addr.drive;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册