提交 ec75b0cf 编写于 作者: C Chris Lalancette

Fix crash when detaching devices from qemu domains.

Make sure to *not* call qemuDomainPCIAddressReleaseAddr if
QEMUD_CMD_FLAG_DEVICE is *not* set (for older qemu).  This
prevents a crash when trying to do device detachment from
a qemu guest.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 53a1db4d
......@@ -8567,9 +8567,9 @@ static int qemudDomainDetachPciControllerDevice(struct qemud_driver *driver,
vm->def->ncontrollers = 0;
}
if (qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0) {
if ((qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) &&
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
VIR_WARN0("Unable to release PCI address on controller");
}
virDomainControllerDefFree(detach);
......@@ -8775,9 +8775,9 @@ static int qemudDomainDetachHostPciDevice(struct qemud_driver *driver,
pciFreeDevice(pci);
}
if (qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0) {
if ((qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) &&
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
VIR_WARN0("Unable to release PCI address on controller");
}
if (vm->def->nhostdevs > 1) {
memmove(vm->def->hostdevs + i,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册