mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 14:35:18 +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))
|
if (disk->iothread && !qemuCheckIOThreads(def, disk))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
switch (disk->bus) {
|
switch ((virDomainDiskBus) disk->bus) {
|
||||||
case VIR_DOMAIN_DISK_BUS_IDE:
|
case VIR_DOMAIN_DISK_BUS_IDE:
|
||||||
if (disk->info.addr.drive.target != 0) {
|
if (disk->info.addr.drive.target != 0) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
@ -2132,6 +2132,10 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
|||||||
virBufferAsprintf(&opt, "floppy,unit=%d", disk->info.addr.drive.unit);
|
virBufferAsprintf(&opt, "floppy,unit=%d", disk->info.addr.drive.unit);
|
||||||
break;
|
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:
|
default:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unsupported disk bus '%s' with device setup"), bus);
|
_("unsupported disk bus '%s' with device setup"), bus);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user