[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: refactor libxl__domain_firmware to choose based on



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306258070 -3600
# Node ID 7dd5967b44b47f15678fa7163308e87b0cd74235
# Parent  a49b166232ec1b0916db897764bed76c453ea0a8
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r a49b166232ec -r 7dd5967b44b4 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Tue May 24 18:26:47 2011 +0100
+++ b/tools/libxl/libxl_dom.c   Tue May 24 18:27:50 2011 +0100
@@ -273,9 +273,28 @@
                                           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,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.