From: Ruben Kerkhof Date: Fri, 23 Dec 2016 17:47:10 +0000 (+0100) Subject: virt plugin: fix a few build warnings X-Git-Tag: collectd-5.8.0~259 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4b05cf4141a735bcbc734ec8e68b905f16deef6c;p=collectd.git virt plugin: fix a few build warnings src/virt.c:939:13: warning: initializing 'char *' with an expression of type 'const char [34]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] char *bd_xmlpath = "/domain/devices/disk/target[@dev]"; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/virt.c:941:20: warning: assigning to 'char *' from 'const char [34]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] bd_xmlpath = "/domain/devices/disk/source[@dev]"; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/src/virt.c b/src/virt.c index 4dce6e03..830db513 100644 --- a/src/virt.c +++ b/src/virt.c @@ -936,10 +936,10 @@ static int refresh_lists(struct lv_read_instance *inst) { } /* Block devices. */ - char *bd_xmlpath = "/domain/devices/disk/target[@dev]"; + const char *bd_xmlpath = "/domain/devices/disk/target[@dev]"; if (blockdevice_format == source) bd_xmlpath = "/domain/devices/disk/source[@dev]"; - xpath_obj = xmlXPathEval((xmlChar *)bd_xmlpath, xpath_ctx); + xpath_obj = xmlXPathEval((const xmlChar *)bd_xmlpath, xpath_ctx); if (xpath_obj == NULL || xpath_obj->type != XPATH_NODESET || xpath_obj->nodesetval == NULL)