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

[Xen-devel] [PATCH] libxl: remove impossible check for backend != DISK_BACKEND_QDISK



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.