mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
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: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
parent
53a1db4dfc
commit
ec75b0cf59
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user