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-devel

[Xen-devel] [PATCH] xl: fix compiler warning with fork_exec_bootloader

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xl: fix compiler warning with fork_exec_bootloader
From: Andre Przywara <andre.przywara@xxxxxxx>
Date: Wed, 15 Sep 2010 15:51:07 +0200
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 15 Sep 2010 06:53:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090820)
Hi,

this is an updated version of a patch I sent some weeks ago, I suppose it has somehow been dropped accidentally.
---------------

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>

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12
commit f904f43b058dce94853106a5e919eb56da081890
Author: Andre Przywara <andre.przywara@xxxxxxx>
Date:   Fri Aug 20 01:00:17 2010 +0200

    xl: 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>

diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 0f884e4..6c0408a 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -118,7 +118,7 @@ static int open_xenconsoled_pty(int *master, int *slave, 
char *slave_path, size_
     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 --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c
index 56d738e..31980fb 100644
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -35,7 +35,8 @@ static int call_waitpid(pid_t (*waitpid_cb)(pid_t, int *, 
int), pid_t pid, int *
     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 --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7ddb980..ba6041f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -221,7 +221,8 @@ _hidden int libxl__spawn_check(libxl_ctx *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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xl: fix compiler warning with fork_exec_bootloader, Andre Przywara <=