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] libxl: remove impossible check for backend != DISK_B

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: remove impossible check for backend != DISK_BACKEND_QDISK
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 05 Apr 2011 17:34:35 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 05 Apr 2011 09:35:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302021247 -3600
# Node ID 281207ed3fb3e1bf49c91ff3bcd76af1a3ab00af
# Parent  403080639e20aaf8f5a768f8f583fe0700afe84e
libxl: remove impossible check for backend != DISK_BACKEND_QDISK

In this case we are already in the DISK_BACKEND_QDISK case of a switch
statement on the same variable.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

---

Maybe I'm mistaken here, since the DISK_BACKEND_TAP case can fall
through, but only if !libxl__blktap_enabled. I'm not sure I understand
the intention of this code to actually remove the fall-through case
though.

I'm not convinced DEVICE_TAP is even valid -- it seems to create a tap
entry in xenstore (e.g. is a blktap1 thing). The usage in
libxl_device_disk_del seems particularly dubious to me.

diff -r 403080639e20 -r 281207ed3fb3 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Apr 05 17:26:32 2011 +0100
+++ b/tools/libxl/libxl.c       Tue Apr 05 17:34:07 2011 +0100
@@ -1015,12 +1015,7 @@ int libxl_device_disk_add(libxl_ctx *ctx
             flexarray_append(back, "params");
             flexarray_append(back, libxl__sprintf(&gc, "%s:%s",
                           libxl__device_disk_string_of_format(disk->format), 
disk->pdev_path));
-
-            if (libxl__blktap_enabled(&gc) && 
-                 disk->backend != DISK_BACKEND_QDISK)
-                device.backend_kind = DEVICE_TAP;
-            else
-                device.backend_kind = DEVICE_QDISK;
+            device.backend_kind = DEVICE_QDISK;
             break;
         default:
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unrecognized disk backend type: 
%d\n", disk->backend);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: remove impossible check for backend != DISK_BACKEND_QDISK, Ian Campbell <=