mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libxl: refactor libxl__domain_firmware to choose based on
device_model_version Note that the default remains "hvmloader" in both cases, this just clarifies the intent for now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
e15103060d
commit
879dea3e17
1 file changed
+22
-3
+22
-3
@@ -273,9 +273,28 @@ static const char *libxl__domain_firmware(libxl__gc *gc,
|
||||
libxl_domain_build_info *info,
|
||||
libxl_device_model_info *dm_info)
|
||||
{
|
||||
return libxl__abs_path(gc,
|
||||
info->u.hvm.firmware ? : "hvmloader",
|
||||
libxl_xenfirmwaredir_path());
|
||||
libxl_ctx *ctx = libxl__gc_owner(gc);
|
||||
const char *firmware;
|
||||
|
||||
if (info->u.hvm.firmware)
|
||||
firmware = info->u.hvm.firmware;
|
||||
else {
|
||||
switch (dm_info->device_model_version)
|
||||
{
|
||||
case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
|
||||
firmware = "hvmloader";
|
||||
break;
|
||||
case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
|
||||
firmware = "hvmloader";
|
||||
break;
|
||||
default:
|
||||
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "invalid device model version %d",
|
||||
dm_info->device_model_version);
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return libxl__abs_path(gc, firmware, libxl_xenfirmwaredir_path());
|
||||
}
|
||||
|
||||
int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
|
||||
|
||||