Ignore empty type attribute in driver element of virtual disks

Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578347
This commit is contained in:
Guido Günther 2010-04-19 18:08:19 +02:00
parent 84bc7ac06b
commit ce380b8e6f

View File

@ -2479,7 +2479,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
if (disk->readonly &&
qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)
virBufferAddLit(&opt, ",readonly=on");
if (disk->driverType &&
if (disk->driverType && *disk->driverType != '\0' &&
disk->type != VIR_DOMAIN_DISK_TYPE_DIR &&
qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_FORMAT)
virBufferVSprintf(&opt, ",format=%s", disk->driverType);