From 4c68d7ec6e49f3ff1138a75676b6806644861d72 Mon Sep 17 00:00:00 2001 From: Antoine Naud Date: Fri, 25 May 2018 15:42:51 +0100 Subject: [PATCH] src/virt.c: Fix one -Wshadow type warning This commit fixes: src/virt.c:1827:76: warning: declaration shadows a variable in the global scope [-Wshadow] static int domain_lifecycle_event_cb(__attribute__((unused)) virConnectPtr conn, ^ src/virt.c:471:22: note: previous declaration is here static virConnectPtr conn; Change-Id: I5303f834c5f13802909f8bd03afba0f4a23934d4 Signed-off-by: Antoine Naud --- src/virt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/virt.c b/src/virt.c index 1ce376cb..87ab8fdc 100644 --- a/src/virt.c +++ b/src/virt.c @@ -1024,7 +1024,8 @@ static void domain_state_submit_notif(virDomainPtr dom, int state, int reason) { char msg[DATA_MAX_NAME_LEN]; const char *state_str = domain_states[state]; #ifdef HAVE_DOM_REASON - if ((reason < 0) || ((size_t)reason >= STATIC_ARRAY_SIZE(domain_reasons[0]))) { + if ((reason < 0) || + ((size_t)reason >= STATIC_ARRAY_SIZE(domain_reasons[0]))) { ERROR(PLUGIN_NAME ": Array index out of bounds: reason=%d", reason); return; } @@ -1584,7 +1585,7 @@ static int get_block_stats(struct block_device *block_dev) { #define NM_ADD_STR_ITEMS(_items, _size) \ do { \ - for (size_t _i = 0; _i < _size; ++_i) { \ + for (size_t _i = 0; _i < _size; ++_i) { \ DEBUG(PLUGIN_NAME \ " plugin: Adding notification metadata name=%s value=%s", \ _items[_i].name, _items[_i].value); \ @@ -1824,7 +1825,7 @@ static int get_if_dev_stats(struct interface_device *if_dev) { return 0; } -static int domain_lifecycle_event_cb(__attribute__((unused)) virConnectPtr conn, +static int domain_lifecycle_event_cb(__attribute__((unused)) virConnectPtr con_, virDomainPtr dom, int event, int detail, __attribute__((unused)) void *opaque) { int domain_state = map_domain_event_to_state(event); -- 2.11.0