From: Vincent Hanquez Subject: [PATCH 5/6] remove ctx argument to exec Date: Mon, 11 Jan 2010 21:48:25 +0000 Message-ID: <1263246506-5488-6-git-send-email-vincent.hanquez@eu.citrix.com> References: <1263246506-5488-1-git-send-email-vincent.hanquez@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.6.6" Return-path: In-Reply-To: <1263246506-5488-1-git-send-email-vincent.hanquez@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Vincent Hanquez List-Id: xen-devel@lists.xenproject.org --------------1.6.6 Content-Type: text/plain; charset="UTF-8"; format=fixed Content-Transfer-Encoding: quoted-printable Signed-off-by: Vincent Hanquez --- tools/libxl/libxl.c | 4 ++-- tools/libxl/libxl_exec.c | 4 +--- tools/libxl/libxl_internal.h | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) --------------1.6.6 Content-Type: text/x-patch; name="0005-remove-ctx-argument-to-exec.patch" Content-Disposition: attachment; filename="0005-remove-ctx-argument-to-exec.patch" Content-Transfer-Encoding: quoted-printable diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 518064e..36e72cf 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -974,7 +974,7 @@ int libxl_create_device_model(struct libxl_ctx *ctx, rc =3D libxl_spawn_spawn(ctx, p, "device model", dm_xenstore_record_= pid); if (rc < 0) goto xit; if (!rc) { /* inner child */ - libxl_exec(ctx, null, logfile_w, logfile_w, + libxl_exec(null, logfile_w, logfile_w, info->device_model, args); } =20 @@ -1118,7 +1118,7 @@ int libxl_device_disk_add(struct libxl_ctx *ctx, ui= nt32_t domid, libxl_device_di =20 null_r =3D open("/dev/null", O_RDONLY); null_w =3D open("/dev/null", O_WRONLY); - libxl_exec(ctx, null_r, p[1], null_w, "/usr/sbin= /tapdisk2", args); + libxl_exec(null_r, p[1], null_w, "/usr/sbin/tapd= isk2", args); XL_LOG(ctx, XL_LOG_ERROR, "Error execing tapdisk= 2"); } close(p[1]); diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c index 1588a1f..011ed84 100644 --- a/tools/libxl/libxl_exec.c +++ b/tools/libxl/libxl_exec.c @@ -48,8 +48,7 @@ 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); } =20 -void libxl_exec(struct libxl_ctx *ctx, int stdinfd, int stdoutfd, int st= derrfd, - char *arg0, char **args) +void libxl_exec(int stdinfd, int stdoutfd, int stderrfd, char *arg0, cha= r **args) /* call this in the child */ { int i; @@ -63,7 +62,6 @@ void libxl_exec(struct libxl_ctx *ctx, int stdinfd, int= stdoutfd, int stderrfd, for (i =3D 4; i < 256; i++) close(i); execv(arg0, args); - XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "exec %s failed", arg0); _exit(-1); } =20 diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 44e97d1..14952ca 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -203,8 +203,7 @@ int libxl_spawn_check(struct libxl_ctx *ctx, =20 /* low-level stuff, for synchronous subprocesses etc. */ =20 -void libxl_exec(struct libxl_ctx *ctx, int stdinfd, int stdoutfd, int st= derrfd, - char *arg0, char **args); // logs errors, never returns +void libxl_exec(int stdinfd, int stdoutfd, int stderrfd, char *arg0, cha= r **args); // logs errors, never returns void libxl_log_child_exitstatus(struct libxl_ctx *ctx, const char *what, pid_t pid, int status)= ; =20 --------------1.6.6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------1.6.6--