diff options
| author | Jeff Carr <[email protected]> | 2024-10-22 04:26:29 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-22 04:26:29 -0500 |
| commit | ca0d4f423a7892f582eced971a31caab1add9c02 (patch) | |
| tree | d56c015247d81b7b4cb7cba595b7c875b3cb49cd /helpers.go | |
| parent | e256f02cf8caf7459269ebdba90c43936feb60bd (diff) | |
experiements
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'helpers.go')
| -rw-r--r-- | helpers.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,12 @@ package virtbuf -func (x *Hypervisor) SetMemory(gb int) { +import "fmt" + +func (x *Hypervisor) SetMemoryGB(gb int) { x.Memory = int64(gb * 1024 * 1024 * 1024) } + +func (x *Hypervisor) GetMemoryPrintable() string { + i := x.Memory / (1024 * 1024 * 1024) + return fmt.Sprintf("%d GB", i) +} |
