mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: command: Use correct type for switch in qemuBuildDiskDeviceStr
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@redhat.com>
This commit is contained in:
parent
1dcba456fa
commit
6b67eeef8c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user