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

[Xen-changelog] [xen-unstable] libxl: Select BIOS using libxl_domain_build_info_setdefaults



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1330604775 0
# Node ID 6eac4a1ee6464e294c5c7310eb54f2566db4cf5e
# Parent  cb25f8d90f5f963a24b69dbb7e72dd3b33d7eb2b
libxl: Select BIOS using libxl_domain_build_info_setdefaults

Remove libxl__domain_bios -- it is no longer necessary.

Also we appear to have been setting the xenstore key even for device models for
PV guests -- stop doing that.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c        Thu Mar 01 12:26:15 2012 +0000
@@ -109,6 +109,26 @@
         b_info->device_model_version =
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
+    if (!b_info->u.hvm.bios)
+        switch (b_info->device_model_version) {
+        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+        default:return ERROR_INVAL;
+    }
+
+    /* Enforce BIOS<->Device Model version relationship */
+    switch (b_info->device_model_version) {
+    case 1:
+        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    case 2:
+        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    default:abort();
+    }
+
     if (!b_info->max_vcpus)
         b_info->max_vcpus = 1;
     if (!b_info->cur_vcpus)
diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Thu Mar 01 12:26:15 2012 +0000
@@ -63,18 +63,6 @@
     return dm;
 }
 
-static const char *libxl__domain_bios(libxl__gc *gc,
-                                const libxl_domain_build_info *info)
-{
-    if (info->u.hvm.bios)
-       return libxl_bios_type_to_string(info->u.hvm.bios);
-    switch (info->device_model_version) {
-    case 1: return "rombios";
-    case 2: return "seabios";
-    default:return NULL;
-    }
-}
-
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
@@ -933,10 +921,13 @@
         goto out;
     }
 
-    path = xs_get_domain_path(ctx->xsh, domid);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", 
path),
-                    "%s", libxl__domain_bios(gc, b_info));
-    free(path);
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        path = xs_get_domain_path(ctx->xsh, domid);
+        libxl__xs_write(gc, XBT_NULL,
+                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
+        free(path);
+    }
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.