From: Andre Przywara <andre.przywara@amd.com>
To: eric.chanudet@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
Keir Fraser <keir.fraser@eu.citrix.com>
Subject: [PATCH] xl: fix compiler warning with fork_exec_bootloader
Date: Fri, 20 Aug 2010 13:55:27 +0200 [thread overview]
Message-ID: <4C6E6D2F.7020005@amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 386 bytes --]
Hi,
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.
Regards,
Andre.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12
[-- Attachment #2: xl-fix-compiler-warning-with-fork_exec_bootloader.patch --]
[-- Type: text/x-patch, Size: 2984 bytes --]
>From ad5d2d401741c3e23796072a3304f46ae0a4832e Mon Sep 17 00:00:00 2001
From: Andre Przywara <andre.przywara@amd.com>
Date: Fri, 20 Aug 2010 01:00:17 +0200
Subject: [PATCH 1/4] 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@amd.com>
---
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 --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index e7e88ce..50b9b17 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/serial/0/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 5210c4f..0796f49 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 2f81acc..bab576c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -228,7 +228,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);
--
1.6.4
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2010-08-20 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-20 11:55 Andre Przywara [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-15 13:51 [PATCH] xl: fix compiler warning with fork_exec_bootloader Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C6E6D2F.7020005@amd.com \
--to=andre.przywara@amd.com \
--cc=eric.chanudet@citrix.com \
--cc=keir.fraser@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.