tools/libs: guest: Fix Arm build after 8fc4916daf2a
authorJulien Grall <jgrall@amazon.com>
Tue, 18 May 2021 17:03:05 +0000 (18:03 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 19 May 2021 12:35:54 +0000 (13:35 +0100)
Gitlab CI spotted an issue when building the tools Arm:

xg_dom_arm.c: In function 'meminit':
xg_dom_arm.c:401:50: error: passing argument 3 of 'set_mode' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  401 |     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
      |                                               ~~~^~~~~~~~~~~~

This is because the const was not propagated in the Arm code. Fix it
by constifying the 3rd parameter of set_mode().

Fixes: 8fc4916daf2a ("tools/libs: guest: Use const whenever we point to literal strings")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/libs/guest/xg_dom_arm.c

index b4c24f15fb272f4721b41e567e30685f290957b2..01e85e0ea9c7b888bc3c64cf2b726bc8cd6c3b02 100644 (file)
@@ -195,7 +195,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
 
 /* ------------------------------------------------------------------------ */
 
-static int set_mode(xc_interface *xch, uint32_t domid, char *guest_type)
+static int set_mode(xc_interface *xch, uint32_t domid, const char *guest_type)
 {
     static const struct {
         char           *guest;