- #if COLLECT_DEBUG
- for (int i = 0; i < state->nr_domains; ++i)
- DEBUG(PLUGIN_NAME " plugin: domain %s",
- virDomainGetName(state->domains[i].ptr));
- for (int i = 0; i < state->nr_block_devices; ++i)
- DEBUG(PLUGIN_NAME " plugin: block device %d %s:%s",
- i, virDomainGetName(state->block_devices[i].dom),
- state->block_devices[i].path);
- for (int i = 0; i < state->nr_interface_devices; ++i)
- DEBUG(PLUGIN_NAME " plugin: interface device %d %s:%s",
- i, virDomainGetName(state->interface_devices[i].dom),
- state->interface_devices[i].path);
- #endif
+ /* persistent domains state notifications are handled by instance 0 */
+ if (inst->id == 0 && persistent_notification) {
+ int status = persistent_domains_state_notification();
+ if (status != 0)
+ DEBUG(PLUGIN_NAME " plugin: persistent_domains_state_notifications "
+ "returned with status %i",
+ status);
+ }
+
+#if COLLECT_DEBUG
+ for (int i = 0; i < state->nr_domains; ++i)
+ DEBUG(PLUGIN_NAME " plugin: domain %s",
+ virDomainGetName(state->domains[i].ptr));
+ for (int i = 0; i < state->nr_block_devices; ++i)
+ DEBUG(PLUGIN_NAME " plugin: block device %d %s:%s", i,
+ virDomainGetName(state->block_devices[i].dom),
+ state->block_devices[i].path);
+ for (int i = 0; i < state->nr_interface_devices; ++i)
+ DEBUG(PLUGIN_NAME " plugin: interface device %d %s:%s", i,
+ virDomainGetName(state->interface_devices[i].dom),
+ state->interface_devices[i].path);
+#endif