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 07/14] libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN

libxl callers should not be required to specify the backend if they
don't want to.  So LIBXL_DISK_BACKEND_UNKNOWN should instruct libxl to
choose the backend for itself.

More thorough fixes for the disk handling will follow.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fe012cb..73fc3e9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -989,6 +989,21 @@ int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, 
libxl_device_disk *dis
     device.domid = domid;
     device.kind = DEVICE_VBD;
 
+
+    /*
+     * Fixing the incoming backend type to try to decide on which
+     * backend to use.  Unfortunately at the moment this code is
+     * utterly broken, but it more or less works.
+     */
+
+    /*
+     * Backend type UNKNOWN should mean "caller does not want to specify",
+     * not "break pointlessely".  (Callers should not be required to
+     * specify the backend if they don't want to.)
+     */
+    if (disk->backend == LIBXL_DISK_BACKEND_UNKNOWN)
+        disk->backend = LIBXL_DISK_BACKEND_TAP;
+
     /* If blktap is not available then fallback to qdisk */
     if (disk->backend == LIBXL_DISK_BACKEND_TAP && !libxl__blktap_enabled(&gc))
         disk->backend = LIBXL_DISK_BACKEND_QDISK;
-- 
1.7.2.5


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

<Prev in Thread] Current Thread [Next in Thread>