1
0
Fork 0

refactor: set qemu default values as constants

timestamps
dump_stack() 2024-02-25 18:02:39 +00:00
parent 29f4821320
commit 6a9bfb503f
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
1 changed files with 11 additions and 5 deletions

View File

@ -37,6 +37,13 @@ const (
unsupported = "unsupported" // for test purposes
)
const (
DefaultCPUs = 1
DefaultMemory = 512 // megabytes
DefaultSSHRetries = 4
DefaultSSHRetryTimeout = time.Second / 4
)
// Kernel describe kernel parameters for qemu
type Kernel struct {
Name string
@ -123,11 +130,10 @@ func NewSystem(arch arch, kernel Kernel, drivePath string) (q *System, err error
}
q.drivePath = drivePath
// Default values
q.Cpus = 1
q.Memory = 512 // megabytes
q.SSH.Retries = 4
q.SSH.RetryTimeout = time.Second / 4
q.Cpus = DefaultCPUs
q.Memory = DefaultMemory
q.SSH.Retries = DefaultSSHRetries
q.SSH.RetryTimeout = DefaultSSHRetryTimeout
return
}