virtbuf/helpers.go

13 lines
243 B
Go

package virtbuf
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)
}