From: Peter Krempa Date: Mon, 2 May 2016 12:57:09 +0000 (+0200) Subject: qemu: command: Use more appropriate checking function for block devices X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c240335b88bdf7aec9efcbef55cfabe41ba816c5;p=libvirt.git qemu: command: Use more appropriate checking function for block devices In qemuCheckDiskConfig would now use virDomainDiskSourceIsBlockType just as a glorified version of virStorageSourceIsBlockLocal that reports error messages. Replace it with the latter including the message for clarity. --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b45ee0d4d6..a88bd11f87 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -980,9 +980,13 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk) virStorageNetProtocolTypeToString(disk->src->protocol)); goto error; } - } else if (!virDomainDiskSourceIsBlockType(disk->src, true)) { + } else if (!virStorageSourceIsBlockLocal(disk->src)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk device='lun' is only valid for block " + "type disk source")); goto error; } + if (disk->wwn) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Setting wwn is not supported for lun device"));