mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 22:03:49 +03:00
vz: handle sourceless cdroms
libvirt handles empty source as NULL, while vz sdk as "" thus we need a bit of conversion. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
parent
88c6c4ab96
commit
baad90fb1c
@ -565,7 +565,7 @@ prlsdkGetDiskInfo(vzDriverPtr driver,
|
||||
if (!(buf = prlsdkGetStringParamVar(PrlVmDev_GetFriendlyName, prldisk)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDiskSetSource(disk, buf) < 0)
|
||||
if (*buf != '\0' && virDomainDiskSetSource(disk, buf) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (prlsdkGetDiskId(prldisk, isCt, &disk->bus, &disk->dst) < 0)
|
||||
@ -3183,6 +3183,7 @@ static int prlsdkAddDisk(vzDriverPtr driver,
|
||||
PRL_DEVICE_TYPE devType;
|
||||
PRL_CLUSTERED_DEVICE_SUBTYPE scsiModel;
|
||||
char *dst = NULL;
|
||||
const char *path = disk->src->path ? : "";
|
||||
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
|
||||
devType = PDE_HARD_DISK;
|
||||
@ -3206,10 +3207,10 @@ static int prlsdkAddDisk(vzDriverPtr driver,
|
||||
pret = PrlVmDev_SetEmulatedType(sdkdisk, emutype);
|
||||
prlsdkCheckRetGoto(pret, cleanup);
|
||||
|
||||
pret = PrlVmDev_SetSysName(sdkdisk, disk->src->path);
|
||||
pret = PrlVmDev_SetSysName(sdkdisk, path);
|
||||
prlsdkCheckRetGoto(pret, cleanup);
|
||||
|
||||
pret = PrlVmDev_SetFriendlyName(sdkdisk, disk->src->path);
|
||||
pret = PrlVmDev_SetFriendlyName(sdkdisk, path);
|
||||
prlsdkCheckRetGoto(pret, cleanup);
|
||||
|
||||
drive = &disk->info.addr.drive;
|
||||
|
Loading…
x
Reference in New Issue
Block a user