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>
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:
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,