Skip to contentSkip to conversation

Don't use tapdisk for cd-roms

PATCH In review George Dunlap 3 participants 4 messages May 2, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't use tapdisk for cd-roms

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.

CC Fabio Fantoni <[email protected]>
CC Ian Jackson <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Ian Campbell <[email protected]>
---
 tools/libxl/libxl_device.c |    6 ++++++
 1 file changed, 6 insertions(+)
tools/libxl/libxl_device.c +6 -0
index a826ece..a5cf446 100644
@@ -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",
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 5 lines · George Dunlap

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.

This is also a candidate for backport to 4.2, as the same issue is present there.

-George

Tested-by on v1 1/1
#2 lore raw
In reply to George Dunlap

Il 02/05/2013 13:03, George Dunlap ha scritto:

Quoted 7 lines

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.

Quoted 15 lines
CC Fabio Fantoni <[email protected]>
CC Ian Jackson <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Ian Campbell <[email protected]>
---
  tools/libxl/libxl_device.c |    6 ++++++
  1 file changed, 6 insertions(+)
tools/libxl/libxl_device.c +0 -0
index a826ece..a5cf446 100644
@@ -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;

tools/libxl/libxl_device.c static int disk_try_backend(disk_try_backend_args *a, · line 189

Quoted 10 lines
tools/libxl/libxl_device.c +6 -0
 
+        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",

Tested with xen unstable and qemu upstream, domU windows 7 pro 64 bit with GPLPV and it is working! :-) Thanks! I waited cd hotswap working for a long time.

The only thing to fix it seems the help that actually shows:

xl cd-insert --help
Usage: xl [-vfN] cd-insert <Domain> <VirtualDevice> <type:path>

While the command is working removing "type:", for example:

xl cd-insert W7 hdb /mnt/vm/iso/Clonezilla.iso
is working.

Acked-by on v1 1/1
#3 lore raw
In reply to George Dunlap

George Dunlap writes ("[PATCH] Don't use tapdisk for cd-roms"):

Quoted 11 lines

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.

CC Fabio Fantoni <[email protected]>
CC Ian Jackson <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Ian Campbell <[email protected]>