1
0

refactor: set qemu default values as constants

This commit is contained in:
dump_stack() 2024-02-25 18:02:39 +00:00
parent 29f4821320
commit 6a9bfb503f
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB

View File

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