mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 09:23:23 +00:00
Add scsi controllers V2
only if scsi disk exists Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
parent
64e1340181
commit
941e0c42a5
@ -2095,6 +2095,7 @@ sub config_to_command {
|
||||
}
|
||||
|
||||
my $vollist = [];
|
||||
my $scsicontroller = {};
|
||||
|
||||
foreach_drive($conf, sub {
|
||||
my ($ds, $drive) = @_;
|
||||
@ -2105,6 +2106,12 @@ sub config_to_command {
|
||||
}; # ignore errors
|
||||
|
||||
$use_virtio = 1 if $ds =~ m/^virtio/;
|
||||
if ($drive->{interface} eq 'scsi') {
|
||||
my $maxdev = 7;
|
||||
my $controller = int ($drive->{index} / $maxdev);
|
||||
push @$cmd, '-device', "lsi,id=scsi$controller" if !$scsicontroller->{$controller};
|
||||
my $scsicontroller->{$controller}=1;
|
||||
}
|
||||
my $tmp = print_drive_full ($storecfg, $vmid, $drive);
|
||||
$tmp .= ",boot=on" if $conf->{bootdisk} && ($conf->{bootdisk} eq $ds);
|
||||
push @$cmd, '-drive', $tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user