From: Mikhail Feoktistov Date: Fri, 8 Apr 2016 07:41:33 +0000 (+0300) Subject: vz: handle sourceless cdroms X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=071fe092;p=libvirt.git vz: handle sourceless cdroms SDK handles empty cdroms all right. We just need to pass "" instead of NULL (not setting is good too). However we can get problems here. Disk detaching treats source as ids. Fortunately disk detaching is not supported for cdroms yet and for hard disks we can not get empty source - this is prohibitited by xml parsing code. Signed-off-by: Nikolay Shirokovskiy Signed-off-by: Maxim Nestratov --- diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index b321d39df0..e373748efe 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3216,11 +3216,13 @@ static int prlsdkAddDisk(vzDriverPtr driver, pret = PrlVmDev_SetEmulatedType(sdkdisk, emutype); prlsdkCheckRetGoto(pret, cleanup); - pret = PrlVmDev_SetSysName(sdkdisk, path); - prlsdkCheckRetGoto(pret, cleanup); + if (disk->src->path) { + pret = PrlVmDev_SetSysName(sdkdisk, path); + prlsdkCheckRetGoto(pret, cleanup); - pret = PrlVmDev_SetFriendlyName(sdkdisk, path); - prlsdkCheckRetGoto(pret, cleanup); + pret = PrlVmDev_SetFriendlyName(sdkdisk, path); + prlsdkCheckRetGoto(pret, cleanup); + } drive = &disk->info.addr.drive; if (drive->controller > 0) {