mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
qemu: hotplug: Use typecasted enum in qemuDomainDetachDeviceDiskLive
Use the correct type in switch and populate the missing cases. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
70d0689812
commit
afa15d78cb
@ -5375,7 +5375,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
|
||||
}
|
||||
disk = vm->def->disks[idx];
|
||||
|
||||
switch (disk->device) {
|
||||
switch ((virDomainDiskDevice) disk->device) {
|
||||
case VIR_DOMAIN_DISK_DEVICE_DISK:
|
||||
case VIR_DOMAIN_DISK_DEVICE_LUN:
|
||||
if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
|
||||
@ -5387,11 +5387,18 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("This type of disk cannot be hot unplugged"));
|
||||
break;
|
||||
default:
|
||||
|
||||
case VIR_DOMAIN_DISK_DEVICE_CDROM:
|
||||
case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("disk device type '%s' cannot be detached"),
|
||||
virDomainDiskDeviceTypeToString(disk->device));
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DISK_DEVICE_LAST:
|
||||
default:
|
||||
virReportEnumRangeError(virDomainDiskDevice, disk->device);
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user