Re: [libvirt] [PATCH v2 04/12] qemuDomainRemoveChrDevice: Release device address

2018-05-26 Thread Ján Tomko

On Thu, May 24, 2018 at 01:13:31PM +0200, Michal Privoznik wrote:

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 
---
src/qemu/qemu_hotplug.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2 04/12] qemuDomainRemoveChrDevice: Release device address

2018-05-24 Thread Michal Privoznik
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 
---
 src/qemu/qemu_hotplug.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index b35594be5f..cddd700af8 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4337,6 +4337,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
 event = virDomainEventDeviceRemovedNewFromObj(vm, chr->info.alias);
 qemuDomainEventQueue(driver, event);
 
+qemuDomainReleaseDeviceAddress(vm, >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, >info, NULL);
+if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
 ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr);
-}
 
  cleanup:
 qemuDomainResetDeviceRemoval(vm);
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list