提交 224456fc 编写于 作者: J Ján Tomko

qemu: properly free addresses on non-serial chardev unplug

The target type comparison in qemuDomainDetachChrDevice
used the VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE enum, so virtio-serial
addresses were not freed properly for channel devices.

Call qemuDomainReleaseDeviceAddress uncoditionally and decide
based on the address type instead of the target/device types.
上级 f967e7a6
......@@ -4169,13 +4169,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
rc = qemuDomainWaitForDeviceRemoval(vm);
if (rc == 0 || rc == 1) {
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);
}
qemuDomainReleaseDeviceAddress(vm, &tmpChr->info, NULL);
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.
先完成此消息的编辑!
想要评论请 注册