8000 Fix exception when assigning xml memory bank entry to "memory" variable by slqa · Pull Request #13689 · hashicorp/vagrant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix exception when assigning xml memory bank entry to "memory" variable #13689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ function New-VagrantVMXML {
if($Gen -gt 1) {
if($SecureBoot -eq "True") {
Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot On
if (
if (
( ![System.String]::IsNullOrEmpty($SecureBootTemplate) )`
-and`
( (Get-Command Hyper-V\Set-VMFirmware).Parameters.Keys.Contains("secureboottemplate") )
( (Get-Command Hyper-V\Set-VMFirmware).Parameters.Keys.Contains("secureboottemplate") )
) {
Hyper-V\Set-VMFirmware -VM $VM -SecureBootTemplate $SecureBootTemplate
}
Expand Down Expand Up @@ -339,8 +339,8 @@ function New-VagrantVMXML {
$processors = $VMConfig.configuration.settings.processors.count."#text"
}
$notes = (Select-Xml -XML $VMConfig -XPath "//notes").node."#text"
$memory = (Select-Xml -XML $VMConfig -XPath "//memory").node.Bank
if ($memory.dynamic_memory_enabled."#text" -eq "True") {
$memory_entry = (Select-Xml -XML $VMConfig -XPath "//memory").node.Bank
if ($memory_entry.dynamic_memory_enabled."#text" -eq "True") {
$dynamicmemory = $True
}
else {
Expand All @@ -353,9 +353,9 @@ function New-VagrantVMXML {
$MemoryStartupBytes = $Memory * 1MB
$MemoryMinimumBytes = $Memory * 1MB
} else {
$MemoryMaximumBytes = ($memory.limit."#text" -as [int]) * 1MB
$MemoryStartupBytes = ($memory.size."#text" -as [int]) * 1MB
$MemoryMinimumBytes = ($memory.reservation."#text" -as [int]) * 1MB
4DB8 $MemoryMaximumBytes = ($memory_entry.limit."#text" -as [int]) * 1MB
$MemoryStartupBytes = ($memory_entry.size."#text" -as [int]) * 1MB
$MemoryMinimumBytes = ($memory_entry.reservation."#text" -as [int]) * 1MB
}

if($MaxMemory -ne $null) {
Expand Down
0