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-devel

[Xen-devel] [PATCH 4/4] xl: use qdisk if blktap2 is not available

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4/4] xl: use qdisk if blktap2 is not available
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Thu, 18 Nov 2010 13:02:05 +0000
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 18 Nov 2010 05:05:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1011181248170.2373@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1011181248170.2373@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Whenever blktap2 is not available use qdisk as block backend instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff -r 388c44a63613 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Wed Nov 10 14:56:06 2010 +0000
+++ b/tools/libxl/libxl.c       Thu Nov 18 12:45:03 2010 +0000
@@ -1856,7 +1856,10 @@ int libxl_device_disk_add(libxl_ctx *ctx
             flexarray_set(back, boffset++, libxl__sprintf(&gc, "%s:%s",
                           
libxl__device_disk_string_of_phystype(disk->phystype), disk->physpath));
 
-            device.backend_kind = DEVICE_TAP;
+            if (libxl__blktap_enabled(&gc))
+                device.backend_kind = DEVICE_TAP;
+            else
+                device.backend_kind = DEVICE_QDISK;
             break;
 
         default:
diff -r 388c44a63613 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Wed Nov 10 14:56:06 2010 +0000
+++ b/tools/libxl/libxl_device.c        Thu Nov 18 12:45:03 2010 +0000
@@ -33,6 +33,7 @@ static const char *string_of_kinds[] = {
     [DEVICE_VIF2] = "vif2",
     [DEVICE_VBD] = "vbd",
     [DEVICE_TAP] = "tap",
+    [DEVICE_QDISK] = "qdisk",
     [DEVICE_PCI] = "pci",
     [DEVICE_VFB] = "vfb",
     [DEVICE_VKBD] = "vkbd",
diff -r 388c44a63613 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Wed Nov 10 14:56:06 2010 +0000
+++ b/tools/libxl/libxl_internal.h      Thu Nov 18 12:45:03 2010 +0000
@@ -82,6 +82,7 @@ typedef enum {
     DEVICE_VIF2,
     DEVICE_VBD,
     DEVICE_TAP,
+    DEVICE_QDISK,
     DEVICE_PCI,
     DEVICE_VFB,
     DEVICE_VKBD,

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