Created
October 2, 2020 02:48
-
-
Save codegold79/e9426fa69832252c55e5342ba0733fc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func currentConfigs(ctx context.Context, moVM mo.VirtualMachine) []vmConfig { | |
| configs := make([]vmConfig, 6) | |
| configs[0] = vmConfig{name: "numCPU", valInt: int(moVM.Config.Hardware.NumCPU)} | |
| configs[1] = vmConfig{name: "memoryMB", valInt: int(moVM.Config.Hardware.MemoryMB)} | |
| configs[2] = vmConfig{name: "numCoresPerSocket", valInt: int(moVM.Config.Hardware.NumCoresPerSocket)} | |
| if moVM.Config.MemoryHotAddEnabled != nil { | |
| configs[3] = vmConfig{name: "memoryHotAddEnabled", valBool: *moVM.Config.MemoryHotAddEnabled} | |
| } | |
| if moVM.Config.CpuHotRemoveEnabled != nil { | |
| configs[4] = vmConfig{name: "cpuHotRemoveEnabled", valBool: *moVM.Config.CpuHotRemoveEnabled} | |
| } | |
| if moVM.Config.CpuHotAddEnabled != nil { | |
| configs[5] = vmConfig{name: "cpuHotRemoveEnabled", valBool: *moVM.Config.CpuHotAddEnabled} | |
| } | |
| if debug { | |
| log.Println("Current VM configurations:", configs) | |
| } | |
| return configs | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment