Skip to content

Commit

Permalink
virt plugin: Properly reset the lists
Browse files Browse the repository at this point in the history
If all the libvirt domains are shutdown between two refresh cycles,
the code failed to clean the lists.
Thus, the last detected libvirt domains are kept forever, leading
to failures in the data collection.
This leads to messages like

Nov 24 15:34:57 benji.rokugan.lan collectd[15083]: libvirt: QEMU Driver
error : Domain not found: no domain with matching uuid
'bc324fee-5707-4ac6-a650-6037562d4632' (nano_C010)

In the logs.
This bug was also present in collectd 5.6.1.

Signed-off-by: Francesco Romani <fromani@redhat.com>
  • Loading branch information
ffromani committed Nov 30, 2016
1 parent 6188d7d commit 0936a9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/virt.c
Expand Up @@ -836,6 +836,8 @@ static int refresh_lists(struct lv_read_instance *inst) {
return -1;
}

lv_clean_read_state(state);

if (n > 0) {
int *domids;

Expand All @@ -853,8 +855,6 @@ static int refresh_lists(struct lv_read_instance *inst) {
return -1;
}

lv_clean_read_state(state);

/* Fetch each domain and add it to the list, unless ignore. */
for (int i = 0; i < n; ++i) {
virDomainPtr dom = NULL;
Expand Down

0 comments on commit 0936a9e

Please sign in to comment.