mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
qemu: hotplug: Use typecasted switch statement when plugging new devices
This commit is contained in:
parent
3d6c07f7f8
commit
3444fdefb1
@ -6805,7 +6805,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
|||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
switch (dev->type) {
|
switch ((virDomainDeviceType) dev->type) {
|
||||||
case VIR_DOMAIN_DEVICE_DISK:
|
case VIR_DOMAIN_DEVICE_DISK:
|
||||||
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, -1);
|
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, -1);
|
||||||
ret = qemuDomainAttachDeviceDiskLive(dom->conn, driver, vm, dev);
|
ret = qemuDomainAttachDeviceDiskLive(dom->conn, driver, vm, dev);
|
||||||
@ -6856,7 +6856,20 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
|||||||
dev->data.chr = NULL;
|
dev->data.chr = NULL;
|
||||||
break;
|
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,
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||||
_("live attach of device '%s' is not supported"),
|
_("live attach of device '%s' is not supported"),
|
||||||
virDomainDeviceTypeToString(dev->type));
|
virDomainDeviceTypeToString(dev->type));
|
||||||
|
Loading…
Reference in New Issue
Block a user