File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -768,24 +768,28 @@ function Get-VirtIODrivers {
768768 )
769769
770770 Write-Log " Getting Virtual IO Drivers: $BasePath ..."
771- $driverPaths = @ ()
772- foreach ($driver in $VirtioDrivers ) {
773- foreach ($osVersion in $VirtIODriverMappings.Keys ) {
774- $map = $VirtIODriverMappings [$osVersion ]
771+ $osVersion = $null
772+ foreach ($entry in $VirtIODriverMappings.Keys ) {
773+ $map = $VirtIODriverMappings [$entry ]
775774 $minBuildNumber = $map [0 ]
776775 $maxBuildNumber = $map [1 ]
777776 $isServerVersion = $map [2 ]
778- if (! (($BuildNumber -ge $minBuildNumber -and $BuildNumber -le $maxBuildNumber ) `
779- -and ($isServerVersion -eq $isServer ))) {
780- continue
777+ if (($BuildNumber -ge $minBuildNumber -and $BuildNumber -le $maxBuildNumber ) `
778+ -and ($isServerVersion -eq $isServer )) {
779+ $osVersion = $entry
780+ break
781781 }
782+ }
783+
784+ $driverPaths = @ ()
785+ if ($osVersion ) {
786+ foreach ($driver in $VirtioDrivers ) {
782787 $driverPath = " {0}\{1}\{2}\{3}" -f @ ($basePath ,
783788 $driver ,
784789 $osVersion ,
785790 $architecture )
786791 if (Test-Path $driverPath ) {
787792 $driverPaths += $driverPath
788- break
789793 }
790794 }
791795 }
You can’t perform that action at this time.
0 commit comments