提交 04695f48 编写于 作者: M Michal Privoznik

qemuDomainDetachChrDevice: Fix chardev hot-unplug

Not every chardev is plugged onto virtio-serial bus. However, the
code introduced in 89e991a2 assumes that. Incorrectly.
With previous patches we have three options where a chardev can
be plugged: virtio-serial, USB and PCI. This commit fixes the
detach part. However, since we are not auto allocating USB
addresses yet, I'm just marking the place where appropriate code
should go.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 9807c471
......@@ -4164,7 +4164,13 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
rc = qemuDomainWaitForDeviceRemoval(vm);
if (rc == 0 || rc == 1) {
virDomainVirtioSerialAddrRelease(priv->vioserialaddrs, &tmpChr->info);
if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI) {
qemuDomainReleaseDeviceAddress(vm, &tmpChr->info, NULL);
} else if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB) {
/* XXX */
} else {
virDomainVirtioSerialAddrRelease(priv->vioserialaddrs, &tmpChr->info);
}
ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr);
} else {
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册