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

[Xen-changelog] [xen-unstable] libxl: use qemu-xen with PV guests by default


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 14 May 2012 16:31:52 +0000
  • Delivery-date: Mon, 14 May 2012 16:31:58 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1335278930 -3600
# Node ID a095e157f280d62562b9ee5a37d57add7c74ff65
# Parent  cd7e5479ed828cff4a17125367ddaad6d0a73039
libxl: use qemu-xen with PV guests by default

qemu-xen offers better disk performances than qemu-xen-traditional
because it supports Linux native AIO: use it for PV guests if it is
available.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r cd7e5479ed82 -r a095e157f280 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Tue Apr 24 14:31:36 2012 +0100
+++ b/tools/libxl/libxl_create.c        Tue Apr 24 15:48:50 2012 +0100
@@ -71,9 +71,34 @@ int libxl__domain_build_info_setdefault(
         b_info->type != LIBXL_DOMAIN_TYPE_PV)
         return ERROR_INVAL;
 
-    if (!b_info->device_model_version)
-        b_info->device_model_version =
-            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
+
+    if (!b_info->device_model_version) {
+        if (b_info->type == LIBXL_DOMAIN_TYPE_HVM)
+            b_info->device_model_version =
+                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+        else {
+            const char *dm;
+            int rc;
+
+            b_info->device_model_version =
+                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+            dm = libxl__domain_device_model(gc, b_info);
+            rc = access(dm, X_OK);
+            if (rc < 0) {
+                /* qemu-xen unavailable, use qemu-xen-traditional */
+                if (errno == ENOENT) {
+                    LIBXL__LOG_ERRNO(CTX, XTL_VERBOSE, "qemu-xen is 
unavailable"
+                            ", use qemu-xen-traditional instead");
+                    b_info->device_model_version =
+                        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+                } else {
+                    LIBXL__LOG_ERRNO(CTX, XTL_ERROR, "qemu-xen access error");
+                    return ERROR_FAIL;
+                }
+            }
+        }
+    }
 
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (!b_info->u.hvm.bios)
@@ -99,8 +124,6 @@ int libxl__domain_build_info_setdefault(
         }
     }
 
-    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
-
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
         b_info->device_model_version !=
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&

_______________________________________________
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®.