Load iPXE ROM from a file pointed to by IPXE_PATH. If --with-system-ipxe is not specified default Xen firmware directory is picked up as IPXE_PATH
Signed-off-by: Anoob Soman <anoob.so...@citrix.com> --- tools/libxl/libxl_dom.c | 12 ++++++++++++ tools/libxl/libxl_internal.h | 1 + tools/libxl/libxl_paths.c | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 2e29b52..104d6a0 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -1003,6 +1003,7 @@ static int libxl__domain_firmware(libxl__gc *gc, int datalen = 0; void *data; const char *bios_filename = NULL; + const char *ipxe_filename = NULL; if (info->type == LIBXL_DOMAIN_TYPE_HVM) { if (info->u.hvm.firmware) { @@ -1094,6 +1095,17 @@ static int libxl__domain_firmware(libxl__gc *gc, assert(info->type == LIBXL_DOMAIN_TYPE_HVM); rc = xc_dom_kernel_file(dom, libxl__abs_path(gc, firmware, libxl__xenfirmwaredir_path())); + if (rc) { + LOGE(ERROR, "xc_dom_kernel_file failed"); + goto out; + } + if ((ipxe_filename = libxl__ipxe_path())) { + rc = xc_dom_module_file(dom, ipxe_filename, "ipxe"); + if (rc) { + LOGE(ERROR, "xc_dom_ipxe_module_file failed"); + goto out; + } + } } if (rc != 0) { diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 506687f..f649696 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2359,6 +2359,7 @@ _hidden const char *libxl__lock_dir_path(void); _hidden const char *libxl__run_dir_path(void); _hidden const char *libxl__seabios_path(void); _hidden const char *libxl__ovmf_path(void); +_hidden const char *libxl__ipxe_path(void); /*----- subprocess execution with timeout -----*/ diff --git a/tools/libxl/libxl_paths.c b/tools/libxl/libxl_paths.c index 0643c1b..3f6a336 100644 --- a/tools/libxl/libxl_paths.c +++ b/tools/libxl/libxl_paths.c @@ -53,6 +53,15 @@ const char *libxl__ovmf_path(void) #endif } +const char *libxl__ipxe_path(void) +{ +#ifdef IPXE_PATH + return IPXE_PATH; +#else + return NULL; +#endif +} + /* * Local variables: * mode: C -- 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel