提交 9e155e1d 编写于 作者: M Michal Privoznik

qemuDomainDetachDeviceConfig: Allow cold unplug of redirdevs

This is fairly simple. We lookup the device in the array of
devices and remove it. No magic.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 34412740
......@@ -8064,6 +8064,18 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
virDomainMemoryDefFree(virDomainMemoryRemove(vmdef, idx));
break;
case VIR_DOMAIN_DEVICE_REDIRDEV:
if ((idx = virDomainRedirdevDefFind(vmdef,
dev->data.redirdev)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("no matching redirdev was not found"));
return -1;
}
virDomainRedirdevDefFree(virDomainRedirdevDefRemove(vmdef, idx));
break;
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
......@@ -8074,7 +8086,6 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_MEMBALLOON:
case VIR_DOMAIN_DEVICE_NVRAM:
case VIR_DOMAIN_DEVICE_SHMEM:
case VIR_DOMAIN_DEVICE_REDIRDEV:
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册