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

[Xen-changelog] [xen-unstable] tools/libxl: use qdisk if blktap2 is not available



# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1290540202 0
# Node ID 9ffd785319e09bc9a655d320f77d655ebec42514
# Parent  91143941c4926bd8e2c709b0924ed69dabf4437d
tools/libxl: use qdisk if blktap2 is not available

Whenever blktap2 is not available use qdisk as block backend instead.

[ This feature will only work with the relevant changesets from
  qemu-xen-unstable, recently applied.  -iwj ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c          |    5 ++++-
 tools/libxl/libxl_device.c   |    1 +
 tools/libxl/libxl_internal.h |    1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff -r 91143941c492 -r 9ffd785319e0 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Nov 23 19:21:22 2010 +0000
+++ b/tools/libxl/libxl.c       Tue Nov 23 19:23:22 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 91143941c492 -r 9ffd785319e0 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Tue Nov 23 19:21:22 2010 +0000
+++ b/tools/libxl/libxl_device.c        Tue Nov 23 19:23:22 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 91143941c492 -r 9ffd785319e0 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Tue Nov 23 19:21:22 2010 +0000
+++ b/tools/libxl/libxl_internal.h      Tue Nov 23 19:23:22 2010 +0000
@@ -82,6 +82,7 @@ typedef enum {
     DEVICE_VIF2,
     DEVICE_VBD,
     DEVICE_TAP,
+    DEVICE_QDISK,
     DEVICE_PCI,
     DEVICE_VFB,
     DEVICE_VKBD,

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