[pve-devel] [PATCH] Allow SCSI pass through for medium changers (ie. tape libraries)

hannes.nagel at itp.uni-leipzig.de hannes.nagel at itp.uni-leipzig.de
Mon Sep 29 15:53:19 CEST 2014


From: Hannes Nagel <hannes.nagel at itp.uni-leipzig.de>

Medium changers have SCSI device type 8 and were passed through as 'scsi-hd' type devices by qemu-server (vm startup fails). By assigning 'scsi-generic' kvm device type, pass through works as expected. It would in principle be sensible to explicitly handle other SCSI device types as well (right now they probably get passed through as scsi-hd as well).

Signed-off-by: Hannes Nagel <hannes.nagel at itp.uni-leipzig.de>
---
 PVE/QemuServer.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 2058131..65edf5f 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1111,7 +1111,9 @@ sub print_drivedevice_full {
 		  if (my $info = path_is_scsi($path)) {
 		      if ($info->{type} == 0) {
 			  $devicetype = 'block';
-		      } elsif ($info->{type} == 1) { # tape
+		      } elsif ($info->{type} == 1) { # sequential access, ie tape
+			  $devicetype = 'generic';
+		      } elsif ($info->{type} == 8) { # medium changer, ie for tapes
 			  $devicetype = 'generic';
 		      }
 		  }
-- 
2.1.0




More information about the pve-devel mailing list