From 4b05cf4141a735bcbc734ec8e68b905f16deef6c Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 23 Dec 2016 18:47:10 +0100 Subject: [PATCH] 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]"; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.30.2