[pve-devel] [RFC v2 qemu-server 1/2] only perform scsi inquiry on device nodes

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Feb 25 11:43:00 CET 2016


We don't have any storage types other than LVM which react
to scsi inquiry, and we don't want to treat LVM as a scsi
device, so now we only query devices added as actual /dev
path. This was originally intended to be a pass-through
feature anyway, so this makes sense.
---
Note that using /dev/some/lv in a config now still calls path_is_scsi()
and will get the wrong result. But this at least makes sure none of our
regular storages run into this.

 PVE/QemuServer.pm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 223c2b7..d998877 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1237,13 +1237,6 @@ sub print_drivedevice_full {
 	} else {
               if ($drive->{file} =~ m|^/|) {
                   $path = $drive->{file};
-              } else {
-                  $path = PVE::Storage::path($storecfg, $drive->{file});
-              }
-
-	      if($path =~ m/^iscsi\:\/\//){
-		  $devicetype = 'generic';
-	      } else {
 		  if (my $info = path_is_scsi($path)) {
 		      if ($info->{type} == 0) {
 			  $devicetype = 'block';
@@ -1251,6 +1244,12 @@ sub print_drivedevice_full {
 			  $devicetype = 'generic';
 		      }
 		  }
+              } else {
+                  $path = PVE::Storage::path($storecfg, $drive->{file});
+              }
+
+	      if($path =~ m/^iscsi\:\/\//){
+		  $devicetype = 'generic';
 	      }
          }
 
-- 
2.1.4





More information about the pve-devel mailing list