Cast disk->bus to proper type and add missing values to the enum so it's more obvious what types are supported. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- 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 77018a2c4b..7c79223812 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1910,7 +1910,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, if (disk->iothread && !qemuCheckIOThreads(def, disk)) goto error; - switch (disk->bus) { + switch ((virDomainDiskBus) disk->bus) { case VIR_DOMAIN_DISK_BUS_IDE: if (disk->info.addr.drive.target != 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -2132,6 +2132,10 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virBufferAsprintf(&opt, "floppy,unit=%d", disk->info.addr.drive.unit); break; + case VIR_DOMAIN_DISK_BUS_XEN: + case VIR_DOMAIN_DISK_BUS_UML: + case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_LAST: default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported disk bus '%s' with device setup"), bus); -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list