mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
bdf5d45995
commit
048e71cd85
3 files changed
+5
-5
No files matched your search
@@ -68,12 +68,12 @@ const char *libxl__domain_device_model(libxl__gc *gc,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ _hidden char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, int
|
||||
_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) */
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||