[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: fix compiler warning with fork_exec_bootloader



# HG changeset patch
# User Andre Przywara <andre.przywara@xxxxxxx>
# Date 1284655173 -3600
# Node ID a8026ce8fa38dad024f2be03808c620f90545739
# Parent  330c4d9010dae6103efb55de348a94c3e9211a3b
libxl: fix compiler warning with fork_exec_bootloader

At least one of my compilers complains about the broken const
qualifier in the fork_exec_bootloader() call (despite the cast).
Fix this properly by propagating the const attribute down the
call stack.

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_bootloader.c |    4 ++--
 tools/libxl/libxl_exec.c       |    3 ++-
 tools/libxl/libxl_internal.h   |    3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff -r 330c4d9010da -r a8026ce8fa38 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c    Thu Sep 16 17:20:22 2010 +0100
+++ b/tools/libxl/libxl_bootloader.c    Thu Sep 16 17:39:33 2010 +0100
@@ -118,7 +118,7 @@ static int open_xenconsoled_pty(int *mas
     return 0;
 }
 
-static pid_t fork_exec_bootloader(int *master, char *arg0, char **args)
+static pid_t fork_exec_bootloader(int *master, const char *arg0, char **args)
 {
     struct termios termattr;
     pid_t pid = forkpty(master, NULL, NULL, NULL);
@@ -386,7 +386,7 @@ int libxl_run_bootloader(libxl_ctx *ctx,
     dom_console_xs_path = libxl__sprintf(&gc, "%s/console/tty", 
libxl__xs_get_dompath(&gc, domid));
     libxl__xs_write(&gc, XBT_NULL, dom_console_xs_path, "%s", 
dom_console_slave_tty_path);
 
-    pid = fork_exec_bootloader(&bootloader_fd, (char *)info->u.pv.bootloader, 
args);
+    pid = fork_exec_bootloader(&bootloader_fd, info->u.pv.bootloader, args);
     if (pid < 0) {
         goto out_close;
     }
diff -r 330c4d9010da -r a8026ce8fa38 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c  Thu Sep 16 17:20:22 2010 +0100
+++ b/tools/libxl/libxl_exec.c  Thu Sep 16 17:39:33 2010 +0100
@@ -35,7 +35,8 @@ static int call_waitpid(pid_t (*waitpid_
     return (waitpid_cb) ? waitpid_cb(pid, status, options) : waitpid(pid, 
status, options);
 }
 
-void libxl__exec(int stdinfd, int stdoutfd, int stderrfd, char *arg0, char 
**args)
+void libxl__exec(int stdinfd, int stdoutfd, int stderrfd, const char *arg0,
+                char **args)
      /* call this in the child */
 {
     int i;
diff -r 330c4d9010da -r a8026ce8fa38 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Thu Sep 16 17:20:22 2010 +0100
+++ b/tools/libxl/libxl_internal.h      Thu Sep 16 17:39:33 2010 +0100
@@ -221,7 +221,8 @@ _hidden int libxl__spawn_check(libxl_ctx
 
  /* low-level stuff, for synchronous subprocesses etc. */
 
-_hidden void libxl__exec(int stdinfd, int stdoutfd, int stderrfd, char *arg0, 
char **args); // logs errors, never returns
+_hidden void libxl__exec(int stdinfd, int stdoutfd, int stderrfd,
+               const char *arg0, char **args); // logs errors, never returns
 _hidden void libxl__log_child_exitstatus(libxl__gc *gc,
                                 const char *what, pid_t pid, int status);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.