WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: make fallback from blktap2 to qdis

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: make fallback from blktap2 to qdisk more explicit.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 09 Apr 2011 09:20:27 +0100
Delivery-date: Sat, 09 Apr 2011 01:26:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: make fallback from blktap2 to qdisk more explicit., Xen patchbot-unstable <=