[pve-devel] [RFC qemu-server 2/2] whitespace and indentation cleanup

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


---
 PVE/QemuServer.pm | 60 +++++++++++++++++++++++++++----------------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 016a418..56ce2ed 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1231,38 +1231,38 @@ sub print_drivedevice_full {
 	my ($maxdev, $controller, $controller_prefix) = scsihw_infos($conf, $drive);
 	my $unit = $drive->{index} % $maxdev;
 	my $devicetype = 'hd';
-        my $path = '';
-        if (drive_is_cdrom($drive)) {
-              $devicetype = 'cd';
+	my $path = '';
+	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';
-	      } elsif (!$is_lvm) {
-		  if (my $info = path_is_scsi($path)) {
-		      if ($info->{type} == 0) {
-			  $devicetype = 'block';
-		      } elsif ($info->{type} == 1) { # tape
-			  $devicetype = 'generic';
-		      }
-		  }
-	      }
-         }
+	    my $is_lvm = 0; # LVM reacts to scsi inquiry
 
-        if (!$conf->{scsihw} || ($conf->{scsihw} =~ m/^lsi/)){
-            $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,scsi-id=$unit,drive=drive-$drive->{interface}$drive->{index},id=$drive->{interface}$drive->{index}";
-        } else {
-            $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,channel=0,scsi-id=0,lun=$drive->{index},drive=drive-$drive->{interface}$drive->{index},id=$drive->{interface}$drive->{index}";
-        }
+	    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';
+	    } elsif (!$is_lvm) {
+		if (my $info = path_is_scsi($path)) {
+		    if ($info->{type} == 0) {
+			$devicetype = 'block';
+		    } elsif ($info->{type} == 1) { # tape
+			$devicetype = 'generic';
+		    }
+		}
+	    }
+	}
+
+	if (!$conf->{scsihw} || ($conf->{scsihw} =~ m/^lsi/)){
+	    $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,scsi-id=$unit,drive=drive-$drive->{interface}$drive->{index},id=$drive->{interface}$drive->{index}";
+	} else {
+	    $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,channel=0,scsi-id=0,lun=$drive->{index},drive=drive-$drive->{interface}$drive->{index},id=$drive->{interface}$drive->{index}";
+	}
 
     } elsif ($drive->{interface} eq 'ide'){
 	$maxdev = 2;
-- 
2.1.4





More information about the pve-devel mailing list