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

[Xen-changelog] [xen-unstable] libxl: make fallback from blktap2 to qdisk more explicit.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302277116 -3600
# Node ID 67b8c2a99f4cce523905cea52cd48ae02421fa27
# Parent  bad528ba2791392f7ffc9ff4bce0021a536a02b6
libxl: make fallback from blktap2 to qdisk more explicit.

When blktap2 is not present we fallback to qdisk, instead of falling
through a switch statement instead make this explicit, with a comment,
prior to the switch statement.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r bad528ba2791 -r 67b8c2a99f4c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Apr 08 16:38:06 2011 +0100
+++ b/tools/libxl/libxl.c       Fri Apr 08 16:38:36 2011 +0100
@@ -979,6 +979,10 @@
     device.domid = domid;
     device.kind = DEVICE_VBD;
 
+    /* If blktap is not available then fallback to qdisk */
+    if (disk->backend == DISK_BACKEND_TAP && !libxl__blktap_enabled(&gc))
+        disk->backend = DISK_BACKEND_QDISK;
+
     switch (disk->backend) {
         case DISK_BACKEND_PHY: 
             libxl__device_physdisk_major_minor(disk->pdev_path, &major, 
&minor);
@@ -991,7 +995,7 @@
             device.backend_kind = DEVICE_VBD;
             break;
         case DISK_BACKEND_TAP:
-            if (libxl__blktap_enabled(&gc) && disk->format != 
DISK_FORMAT_EMPTY) {
+            if (disk->format != DISK_FORMAT_EMPTY) {
                 const char *dev = libxl__blktap_devpath(&gc,
                                                disk->pdev_path, disk->format);
                 if (!dev) {
@@ -1012,7 +1016,8 @@
 
                 break;
             }
-        case DISK_BACKEND_QDISK: 
+            break;
+        case DISK_BACKEND_QDISK:
             flexarray_append(back, "params");
             flexarray_append(back, libxl__sprintf(&gc, "%s:%s",
                           libxl__device_disk_string_of_format(disk->format), 
disk->pdev_path));

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