[pve-devel] [RFC qemu-server 1/2] don't perform scsi-inquiry on LVM

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Feb 25 10:52:19 CET 2016


It can return the data of the underlying disk and so cause
us to provide wrong parameters to qemu.
---
 PVE/QemuServer.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 223c2b7..016a418 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1235,15 +1235,19 @@ sub print_drivedevice_full {
         if (drive_is_cdrom($drive)) {
               $devicetype = 'cd';
 	} else {
+              my $is_lvm = 0; # LVM reacts to scsi inquiry
+
               if ($drive->{file} =~ m|^/|) {
                   $path = $drive->{file};
               } else {
                   $path = PVE::Storage::path($storecfg, $drive->{file});
+                  my $storage_name = PVE::Storage::parse_volume_id($drive->{file});
+                  $is_lvm = ($storecfg->{ids}->{$storage_name}->{type} =~ /^lvm(?:thin)?$/);
               }
 
 	      if($path =~ m/^iscsi\:\/\//){
 		  $devicetype = 'generic';
-	      } else {
+	      } elsif (!$is_lvm) {
 		  if (my $info = path_is_scsi($path)) {
 		      if ($info->{type} == 0) {
 			  $devicetype = 'block';
-- 
2.1.4





More information about the pve-devel mailing list