src/virt.c: State notifications for all persistent domains
When virt option PersistentNotification is enabled, the notifications of VMs
states are sent only for running VMs (whereas they should be sent for all
persistent VMs, including running, suspended, shut off VMs). This behaviour is
due to the fact that VM states are notified while fetching all other metrics,
which is executed only for running VMs.
This commit fixes this issue by decoupling the notifications of VMs states from
fetching and dispatching metrics values. In this purpose, a new function named
persistent_domains_state_notification is added to fetch the states (and reasons)
of persistent VMs and notify them. This function is called at each read interval
before fetching and dispatching the metrics from running VMs.
Unit Tests for the new functions are implemented.
Change-Id: Ic2befb3e7826184696344b037916bc603ec01341
Signed-off-by: Antoine Naud <antoinex.naud@intel.com>