From c240335b88bdf7aec9efcbef55cfabe41ba816c5 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 2 May 2016 14:57:09 +0200 Subject: [PATCH] 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. --- src/qemu/qemu_command.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")); -- GitLab