Make use of the new libxl_*_path functions to specify the correct
absolute path of qemu-dm, hvmloader and ioemu-stubdom.gz.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
diff -r ccae861f52f7 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Thu May 06 11:59:55 2010 +0100
+++ b/tools/libxl/libxl.c Thu May 06 14:17:16 2010 +0100
@@ -981,7 +981,7 @@
b_info.max_vcpus = 1;
b_info.max_memkb = 32 * 1024;
b_info.target_memkb = b_info.max_memkb;
- b_info.kernel = "/usr/lib/xen/boot/ioemu-stubdom.gz";
+ b_info.kernel = libxl_abs_path(ctx, "ioemu-stubdom.gz",
libxl_xenfirmwaredir_path());
b_info.u.pv.cmdline = libxl_sprintf(ctx, " -d %d", info->domid);
b_info.u.pv.ramdisk = "";
b_info.u.pv.features = "";
@@ -1122,7 +1122,8 @@
if (rc < 0) goto xit;
if (!rc) { /* inner child */
libxl_exec(null, logfile_w, logfile_w,
- info->device_model, args);
+ libxl_abs_path(ctx, info->device_model,
libxl_private_bindir_path()),
+ args);
}
rc = 0;
@@ -1702,7 +1703,7 @@
}
info->domid = vfb->domid;
info->dom_name = libxl_domid_to_name(ctx, vfb->domid);
- info->device_model = "/usr/lib/xen/bin/qemu-dm";
+ info->device_model = libxl_abs_path(ctx, "qemu-dm",
libxl_private_bindir_path());
info->type = XENPV;
return 0;
}
diff -r ccae861f52f7 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Thu May 06 11:59:55 2010 +0100
+++ b/tools/libxl/libxl_dom.c Thu May 06 14:17:16 2010 +0100
@@ -171,7 +171,7 @@
{
int ret;
- ret = xc_hvm_build_target_mem(ctx->xch, domid, (info->max_memkb -
info->video_memkb) / 1024, (info->target_memkb - info->video_memkb) / 1024,
info->kernel);
+ ret = xc_hvm_build_target_mem(ctx->xch, domid, (info->max_memkb -
info->video_memkb) / 1024, (info->target_memkb - info->video_memkb) / 1024,
libxl_abs_path(ctx, (char *)info->kernel, libxl_xenfirmwaredir_path()));
if (ret) {
XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, ret, "hvm building failed");
return ERROR_FAIL;
diff -r ccae861f52f7 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c Thu May 06 11:59:55 2010 +0100
+++ b/tools/libxl/libxl_internal.c Thu May 06 14:17:16 2010 +0100
@@ -194,3 +194,13 @@
xl_logv(ctx, loglevel, errnoval, file, line, func, fmt, ap);
va_end(ap);
}
+
+char *libxl_abs_path(struct libxl_ctx *ctx, char *s, const char *path)
+{
+ if (s && s[0] != '/') {
+ return libxl_sprintf(ctx, "%s/%s", path, s);
+ } else {
+ return s;
+ }
+}
+
diff -r ccae861f52f7 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Thu May 06 11:59:55 2010 +0100
+++ b/tools/libxl/libxl_internal.h Thu May 06 14:17:16 2010 +0100
@@ -202,6 +202,8 @@
void libxl_log_child_exitstatus(struct libxl_ctx *ctx,
const char *what, pid_t pid, int status);
+char *libxl_abs_path(struct libxl_ctx *ctx, char *s, const char *path);
+
/* libxl_paths.c */
const char *libxl_sbindir_path(void);
const char *libxl_bindir_path(void);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|