1
0

qemu: allow to run mutable

This commit is contained in:
dump_stack() 2023-02-15 09:48:13 +00:00
parent 063df192b4
commit 0529b30558
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -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)
}