[pve-devel] [PATCH 2/3] use scsi-generic by default with libiscsi

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Tue Aug 28 14:12:54 CEST 2012


an alternative:

commit 91442a640b42d10ba2508b66cd043b11520e1980
Author: Stefan Priebe <s.priebe at profihost.ag>
Date:   Thu Aug 16 14:46:31 2012 +0200

     use scsi-generic if we have scsi with iscsi

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c7e9a07..47527da 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -965,6 +965,12 @@ sub path_is_scsi {
      return $res;
  }

+sub path_is_iscsi {
+    my ($path) = @_;
+
+    return ($path =~ m{^iscsi://}) ? 1 : 0;
+}
+
  sub print_drivedevice_full {
      my ($storecfg, $conf, $vmid, $drive, $bridges) = @_;

@@ -989,6 +995,7 @@ sub print_drivedevice_full {
                    $path = PVE::Storage::path($storecfg, $drive->{file});
                }
               $devicetype = 'block' if path_is_scsi($path);
+             $devicetype = 'generic' if path_is_iscsi($path);
           }

          if (!$conf->{scsihw} || $conf->{scsihw} eq 'lsi'){

Am 28.08.2012 12:46, schrieb Alexandre Derumier:
> This add scsi passthrough with libiscsi
>
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>   PVE/QemuServer.pm |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 74b8b65..8731d99 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -988,7 +988,13 @@ sub print_drivedevice_full {
>                 } else {
>                     $path = PVE::Storage::path($storecfg, $drive->{file});
>                 }
> -	      $devicetype = 'block' if path_is_scsi($path);
> +
> +	      if($path =~ m/^iscsi\:\/\//){
> +		 $devicetype = 'generic';
> +	      }
> +	      else {
> +		 $devicetype = 'block' if path_is_scsi($path);
> +	      }
>            }
>
>           if (!$conf->{scsihw} || $conf->{scsihw} eq 'lsi'){
>


More information about the pve-devel mailing list