mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-09 18:24:26 +00:00
scsi-block auto detection
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
parent
0888fdce30
commit
231f2e13cb
@ -445,7 +445,7 @@ PVE::JSONSchema::register_standard_option("pve-qm-ide", $idedesc);
|
|||||||
my $scsidesc = {
|
my $scsidesc = {
|
||||||
optional => 1,
|
optional => 1,
|
||||||
type => 'string', format => 'pve-qm-drive',
|
type => 'string', format => 'pve-qm-drive',
|
||||||
typetext => '[volume=]volume,] [,media=cdrom|disk|block] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,aio=native|threads]',
|
typetext => '[volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,aio=native|threads]',
|
||||||
description => "Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).",
|
description => "Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).",
|
||||||
};
|
};
|
||||||
PVE::JSONSchema::register_standard_option("pve-qm-scsi", $scsidesc);
|
PVE::JSONSchema::register_standard_option("pve-qm-scsi", $scsidesc);
|
||||||
@ -880,10 +880,16 @@ sub print_drivedevice_full {
|
|||||||
my $controller = int($drive->{index} / $maxdev);
|
my $controller = int($drive->{index} / $maxdev);
|
||||||
my $unit = $drive->{index} % $maxdev;
|
my $unit = $drive->{index} % $maxdev;
|
||||||
my $devicetype = 'hd';
|
my $devicetype = 'hd';
|
||||||
if ($drive->{media}) {
|
my $path = '';
|
||||||
if($drive->{media} eq 'cdrom') {
|
if (drive_is_cdrom($drive)) {
|
||||||
$devicetype = 'cd';
|
$devicetype = 'cd';
|
||||||
} elsif ($drive->{media} eq 'block') {
|
} else {
|
||||||
|
if ($drive->{file} =~ m|^/|) {
|
||||||
|
$path = $drive->{file};
|
||||||
|
} else {
|
||||||
|
$path = PVE::Storage::path($storecfg, $drive->{file});
|
||||||
|
}
|
||||||
|
if ($path =~ m|^/dev/| ) {
|
||||||
$devicetype = 'block';
|
$devicetype = 'block';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user