mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 22:03:49 +03:00
qemu: Prevent two threshold events when it was registered with index
Remember whether the user passed an explicit index when registering the event so that we can avoid the top level event when it isn't needed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2ddff1cc40
commit
a3edda6b9e
@ -19623,6 +19623,10 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
goto endjob;
|
||||
|
||||
/* we need to remember whether the threshold was registered with an explicit
|
||||
* index to fire the correct event */
|
||||
src->thresholdEventWithIndex = !!strchr(dev, '[');
|
||||
|
||||
ret = 0;
|
||||
|
||||
endjob:
|
||||
|
@ -1487,7 +1487,8 @@ qemuProcessHandleBlockThreshold(qemuMonitor *mon G_GNUC_UNUSED,
|
||||
if (virStorageSourceIsLocalStorage(src))
|
||||
path = src->path;
|
||||
|
||||
if (src == disk->src) {
|
||||
if (src == disk->src &&
|
||||
!src->thresholdEventWithIndex) {
|
||||
g_autofree char *dev = qemuDomainDiskBackingStoreGetName(disk, 0);
|
||||
|
||||
eventDevice = virDomainEventBlockThresholdNewFromObj(vm, dev, path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user