mirror of
https://git.proxmox.com/git/qemu-server
synced 2026-01-24 17:25:54 +00:00
correctly return and use device type in scsi_inquiry
This commit is contained in:
parent
f334aa3e6e
commit
09984754a0
@ -1017,9 +1017,12 @@ sub scsi_inquiry {
|
||||
}
|
||||
|
||||
my $res = {};
|
||||
($res->{device}, $res->{removable}, $res->{venodor},
|
||||
(my $byte0, my $byte1, $res->{vendor},
|
||||
$res->{product}, $res->{revision}) = unpack("C C x6 A8 A16 A4", $buf);
|
||||
|
||||
$res->{removable} = $byte1 & 128 ? 1 : 0;
|
||||
$res->{type} = $byte0 & 31;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -1060,7 +1063,13 @@ sub print_drivedevice_full {
|
||||
if($path =~ m/^iscsi\:\/\//){
|
||||
$devicetype = 'generic';
|
||||
} else {
|
||||
$devicetype = 'block' if path_is_scsi($path);
|
||||
if (my $info = path_is_scsi($path)) {
|
||||
if ($info->{type} == 0) {
|
||||
$devicetype = 'block';
|
||||
} elsif ($info->{type} == 1) { # tape
|
||||
$devicetype = 'generic';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user