[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1 of 3] libxl: Look for bootloader in libexec path
If the full path for a bootloader (such as pygrub or xenpvnetboot) is not given, look for it in the libexec path. Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx> diff -r b4cbf273b1cb -r b810908dea7d tools/libxl/libxl_bootloader.c --- a/tools/libxl/libxl_bootloader.c Wed Feb 29 16:30:34 2012 +0000 +++ b/tools/libxl/libxl_bootloader.c Thu Apr 26 15:09:35 2012 +0100 @@ -333,6 +333,7 @@ int libxl_run_bootloader(libxl_ctx *ctx, char tempdir_template[] = "/var/run/libxl/bl.XXXXXX"; char *tempdir; + const char *bootloader = NULL; char *dom_console_xs_path; char dom_console_slave_tty_path[PATH_MAX]; @@ -397,6 +398,13 @@ int libxl_run_bootloader(libxl_ctx *ctx, goto out_close; } + bootloader = libxl__abs_path(gc, info->u.pv.bootloader, + libxl__libexec_path()); + if ( bootloader == NULL ) { + rc = ERROR_NOMEM; + goto out_close; + } + /* * We need to present the bootloader's tty as a pty slave that xenconsole * can access. Since the bootloader itself needs a pty slave, @@ -417,7 +425,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, info->u.pv.bootloader, args); + pid = fork_exec_bootloader(&bootloader_fd, bootloader, args); if (pid < 0) { goto out_close; } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |