]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
libxl: Don't use tapdisk for cd-roms
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 2 May 2013 11:03:09 +0000 (12:03 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 2 May 2013 15:19:04 +0000 (16:19 +0100)
blktap does not support the insert / eject commands, and so is not
suitable for cd-roms.

This fixes the bug where libxl uses tapdisk as a cdrom back-end, causing
subsequent eject / insert commands to fail.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
CC: Fabio Fantoni <fabio.fantoni@heliman.it>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_device.c

index a826ecef7572b7a46a0e2fe76c39b7dbb77e6c46..a5cf446a242a0a9ec77083d8fed139338043600a 100644 (file)
@@ -178,6 +178,12 @@ static int disk_try_backend(disk_try_backend_args *a,
     case LIBXL_DISK_BACKEND_TAP:
         if (a->disk->script) goto bad_script;
 
+        if (a->disk->is_cdrom) {
+            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
+                       " unsuitable for cdroms",
+                       a->disk->vdev);
+            return 0;
+        }
         if (!libxl__blktap_enabled(a->gc)) {
             LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
                        " unsuitable because blktap not available",