qemu: hotplug: Use typecasted switch statement when plugging new devices

This commit is contained in:
Peter Krempa 2014-09-22 13:42:02 +02:00
parent 3d6c07f7f8
commit 3444fdefb1

View File

@ -6805,7 +6805,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
virQEMUDriverPtr driver = dom->conn->privateData;
int ret = -1;
switch (dev->type) {
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, -1);
ret = qemuDomainAttachDeviceDiskLive(dom->conn, driver, vm, dev);
@ -6856,7 +6856,20 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
dev->data.chr = NULL;
break;
default:
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_WATCHDOG:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
case VIR_DOMAIN_DEVICE_SMARTCARD:
case VIR_DOMAIN_DEVICE_MEMBALLOON:
case VIR_DOMAIN_DEVICE_NVRAM:
case VIR_DOMAIN_DEVICE_RNG:
case VIR_DOMAIN_DEVICE_SHMEM:
case VIR_DOMAIN_DEVICE_LAST:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("live attach of device '%s' is not supported"),
virDomainDeviceTypeToString(dev->type));