mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 16:15:23 +00:00
qemuDomainRemoveChrDevice: Release device address
Instead of releasing address only sometimes in qemuDomainDetachChrDevice() let's release it whenever the device is actually removed from the domain definition. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
856fb16492
commit
aac088d998
@ -4337,6 +4337,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
|
||||
event = virDomainEventDeviceRemovedNewFromObj(vm, chr->info.alias);
|
||||
qemuDomainEventQueue(driver, event);
|
||||
|
||||
qemuDomainReleaseDeviceAddress(vm, &chr->info, NULL);
|
||||
qemuDomainChrRemove(vm->def, chr);
|
||||
virDomainChrDefFree(chr);
|
||||
ret = 0;
|
||||
@ -5620,10 +5621,8 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) {
|
||||
qemuDomainReleaseDeviceAddress(vm, &tmpChr->info, NULL);
|
||||
if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
|
||||
ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
qemuDomainResetDeviceRemoval(vm);
|
||||
|
Loading…
Reference in New Issue
Block a user