WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: libxl__xs_write format string shou

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: libxl__xs_write format string should be const.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 16 Jun 2011 11:11:33 +0100
Delivery-date: Thu, 16 Jun 2011 03:13:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: libxl__xs_write format string should be const., Xen patchbot-unstable <=