summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-22 04:26:29 -0500
committerJeff Carr <[email protected]>2024-10-22 04:26:29 -0500
commitca0d4f423a7892f582eced971a31caab1add9c02 (patch)
treed56c015247d81b7b4cb7cba595b7c875b3cb49cd /helpers.go
parente256f02cf8caf7459269ebdba90c43936feb60bd (diff)
experiements
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/helpers.go b/helpers.go
index 81b5fb2..4148a23 100644
--- a/helpers.go
+++ b/helpers.go
@@ -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)
+}