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: disks: Make LIBXL_DISK_BACKEND_UNK

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 08 Jul 2011 06:22:14 +0100
Delivery-date: Thu, 07 Jul 2011 22:23:49 -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 Jackson <ian.jackson@xxxxxxxxxxxxx>
# Date 1309259950 -3600
# Node ID 3173b68c8a945deaeb2642f8bdb97c52ca0eaec7
# Parent  598f1d9cfc8b972ab73412e9bd979004118de716
libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work

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.

For now, we do this by simply treating it the same as BACKEND_TAP,
which itself falls back to other methods.

More thorough fixes for the disk handling will follow.

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


diff -r 598f1d9cfc8b -r 3173b68c8a94 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Jun 28 09:26:24 2011 +0100
+++ b/tools/libxl/libxl.c       Tue Jun 28 12:19:10 2011 +0100
@@ -991,6 +991,21 @@
     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;
@@ -1124,6 +1139,20 @@
     char *dev = NULL;
     char *ret = NULL;
 
+    /*
+     * 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;
+
     switch (disk->backend) {
         case LIBXL_DISK_BACKEND_PHY:
             if (disk->format != LIBXL_DISK_FORMAT_RAW) {
@@ -1173,7 +1202,6 @@
                 disk->pdev_path);
             dev = disk->pdev_path;
             break;
-        case LIBXL_DISK_BACKEND_UNKNOWN:
         default:
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unrecognized disk backend "
                 "type: %d", disk->backend);

_______________________________________________
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: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work, Xen patchbot-unstable <=