https://bugzilla.redhat.com/show_bug.cgi?id=1639228 Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/qemu/qemu_driver.c | 7 ++++++- src/qemu/qemu_hotplug.c | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6eabcfce18..dad5fff6a8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7862,8 +7862,13 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, case VIR_DOMAIN_DEVICE_LEASE: ret = qemuDomainAttachLease(driver, vm, dev->data.lease); - if (ret == 0) + if (ret == 0) { + event = virDomainEventLeaseChangeNewFromObj(vm, + VIR_CONNECT_DOMAIN_EVENT_LEASE_ACTION_ATTACH, + dev->data.lease->lockspace, + dev->data.lease->key); dev->data.lease = NULL; + } break; case VIR_DOMAIN_DEVICE_NET: diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 34249bd030..10dee24724 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5934,6 +5934,7 @@ qemuDomainDetachDeviceLease(virQEMUDriverPtr driver, virDomainLeaseDefPtr lease) { virDomainLeaseDefPtr det_lease; + virObjectEventPtr event = NULL; int idx; if ((idx = virDomainLeaseIndex(vm->def, lease)) < 0) { @@ -5946,6 +5947,12 @@ qemuDomainDetachDeviceLease(virQEMUDriverPtr driver, if (virDomainLockLeaseDetach(driver->lockManager, vm, lease) < 0) return -1; + event = virDomainEventLeaseChangeNewFromObj(vm, + VIR_CONNECT_DOMAIN_EVENT_LEASE_ACTION_DETACH, + lease->lockspace, + lease->key); + virObjectEventStateQueue(driver->domainEventState, event); + det_lease = virDomainLeaseRemoveAt(vm->def, idx); virDomainLeaseDefFree(det_lease); return 0; -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list