]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Use more appropriate checking function for block devices
authorPeter Krempa <pkrempa@redhat.com>
Mon, 2 May 2016 12:57:09 +0000 (14:57 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 May 2016 11:16:26 +0000 (13:16 +0200)
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

index b45ee0d4d642b5d74085902f28b1a05e636e6a66..a88bd11f87ef481e05a5933c688f24125e33b6a8 100644 (file)
@@ -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"));