qemu: allow to run mutable
This commit is contained in:
parent
063df192b4
commit
0529b30558
@ -66,6 +66,8 @@ type System struct {
|
||||
kernel Kernel
|
||||
drivePath string
|
||||
|
||||
Mutable bool
|
||||
|
||||
Cpus int
|
||||
Memory int
|
||||
|
||||
@ -215,7 +217,7 @@ func (q *System) Start() (err error) {
|
||||
rand.Seed(time.Now().UnixNano()) // Are you sure?
|
||||
q.sshAddrPort = getFreeAddrPort()
|
||||
hostfwd := fmt.Sprintf("hostfwd=tcp:%s-:22", q.sshAddrPort)
|
||||
qemuArgs := []string{"-snapshot", "-nographic",
|
||||
qemuArgs := []string{"-nographic",
|
||||
"-hda", q.drivePath,
|
||||
"-kernel", q.kernel.KernelPath,
|
||||
"-smp", fmt.Sprintf("%d", q.Cpus),
|
||||
@ -224,6 +226,10 @@ func (q *System) Start() (err error) {
|
||||
"-netdev", "user,id=n1," + hostfwd,
|
||||
}
|
||||
|
||||
if !q.Mutable {
|
||||
qemuArgs = append(qemuArgs, "-snapshot")
|
||||
}
|
||||
|
||||
if q.debug {
|
||||
qemuArgs = append(qemuArgs, "-gdb", q.gdb)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user