From f76b809d08ef4081aec7a319c1f94cbd0426e4f5 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Wed, 5 Dec 2018 13:28:30 +0700 Subject: [PATCH] virt plugin: Fixed mistake in variable rename --- src/virt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/virt.c b/src/virt.c index bdb6445c..020cfd7b 100644 --- a/src/virt.c +++ b/src/virt.c @@ -2425,10 +2425,8 @@ static int refresh_lists(struct lv_read_instance *inst) { VIR_CONNECT_LIST_DOMAINS_INACTIVE); n = virConnectListAllDomains(conn, &domains, VIR_CONNECT_LIST_DOMAINS_ACTIVE); #else - int *domids; - /* Get list of domains. */ - domids = calloc(n, sizeof(*domids)); + int *domids = calloc(n, sizeof(*domids)); if (domids == NULL) { ERROR(PLUGIN_NAME " plugin: calloc failed."); return -1; @@ -2465,8 +2463,7 @@ static int refresh_lists(struct lv_read_instance *inst) { #ifdef HAVE_LIST_ALL_DOMAINS virDomainPtr dom = domains[i]; #else - virDomainPtr dom = NULL; - dom = virDomainLookupByID(conn, domids[i]); + virDomainPtr dom = virDomainLookupByID(conn, domids[i]); if (dom == NULL) { VIRT_ERROR(conn, "virDomainLookupByID"); /* Could be that the domain went away -- ignore it anyway. */ @@ -2503,7 +2500,7 @@ static int refresh_lists(struct lv_read_instance *inst) { } if (info.state != VIR_DOMAIN_RUNNING) { - DEBUG(PLUGIN_NAME " plugin: skipping inactive domain %s", name); + DEBUG(PLUGIN_NAME " plugin: skipping inactive domain %s", domname); continue; } -- 2.11.0