# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306253547 -3600
# Node ID ba8da39c67298b19c2c277e5794981b7f23bedf2
# Parent 2e4d29c1c585208cb4e768e4e34c570542de3d72
libxl: libxl__xs_write format string should be const.
George Dunlap reports that gcc 4.4.3 complains:
libxl_dm.c: In function libxl__create_device_mode:
libxl_dm.c:776: error: format not a string literal and no format arguments
And indeed the format argument here is a char * from libxl__domain_bios().
Make the argument to libxl__xs_write a const char * and change
libxl__domain_bios to return a const char too.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
diff -r 2e4d29c1c585 -r ba8da39c6729 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Tue May 24 16:18:19 2011 +0100
+++ b/tools/libxl/libxl_dm.c Tue May 24 17:12:27 2011 +0100
@@ -68,12 +68,12 @@
return dm;
}
-static char *libxl__domain_bios(libxl__gc *gc,
+static const char *libxl__domain_bios(libxl__gc *gc,
libxl_device_model_info *info)
{
switch (info->device_model_version) {
- case 1: return libxl__strdup(gc, "rombios");
- case 2: return libxl__strdup(gc, "seabios");
+ case 1: return "rombios";
+ case 2: return "seabios";
default:return NULL;
}
}
diff -r 2e4d29c1c585 -r ba8da39c6729 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Tue May 24 16:18:19 2011 +0100
+++ b/tools/libxl/libxl_internal.h Tue May 24 17:12:27 2011 +0100
@@ -153,7 +153,7 @@
_hidden int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
char *dir, char **kvs);
_hidden int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
- char *path, char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
+ char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
/* Each fn returns 0 on success.
* On error: returns -1, sets errno (no logging) */
diff -r 2e4d29c1c585 -r ba8da39c6729 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c Tue May 24 16:18:19 2011 +0100
+++ b/tools/libxl/libxl_xshelp.c Tue May 24 17:12:27 2011 +0100
@@ -69,7 +69,7 @@
}
int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
- char *path, char *fmt, ...)
+ char *path, const char *fmt, ...)
{
libxl_ctx *ctx = libxl__gc_owner(gc);
char *s;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|