From f8fee9337b33ac0e9da56fb50e1adf5b8894f9ef Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 2 Feb 2016 09:43:36 +0100 Subject: [PATCH] qemu: hotplug: Use typecasted switch Remove the default case since all cases are covered. --- src/qemu/qemu_hotplug.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f8db960e04..b456fedd5a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -795,7 +795,7 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) goto end; - switch (disk->device) { + switch ((virDomainDiskDevice) disk->device) { case VIR_DOMAIN_DISK_DEVICE_CDROM: case VIR_DOMAIN_DISK_DEVICE_FLOPPY: if (!(orig_disk = virDomainDiskFindByBusAndDst(vm->def, @@ -837,10 +837,8 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, virDomainDiskBusTypeToString(disk->bus)); } break; - default: - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("disk device type '%s' cannot be hotplugged"), - virDomainDiskDeviceTypeToString(disk->device)); + + case VIR_DOMAIN_DISK_DEVICE_LAST: break; } -- GitLab