提交 2536b1b9 编写于 作者: P Peter Krempa

qemu: Convert qemuDomainAttachDeviceConfig to typecasted enum

上级 714dff93
...@@ -7074,7 +7074,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, ...@@ -7074,7 +7074,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
virDomainControllerDefPtr controller; virDomainControllerDefPtr controller;
virDomainFSDefPtr fs; virDomainFSDefPtr fs;
switch (dev->type) { switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK: case VIR_DOMAIN_DEVICE_DISK:
disk = dev->data.disk; disk = dev->data.disk;
if (virDomainDiskIndexByName(vmdef, disk->dst, true) >= 0) { if (virDomainDiskIndexByName(vmdef, disk->dst, true) >= 0) {
...@@ -7169,7 +7169,20 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, ...@@ -7169,7 +7169,20 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
dev->data.fs = NULL; dev->data.fs = NULL;
break; break;
default: 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_REDIRDEV:
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_LAST:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("persistent attach of device '%s' is not supported"), _("persistent attach of device '%s' is not supported"),
virDomainDeviceTypeToString(dev->type)); virDomainDeviceTypeToString(dev->type));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册