Export qemu arguments
This commit is contained in:
parent
21daac4fbc
commit
bb319a9ff6
@ -208,14 +208,16 @@ func (q System) cmdline() (s string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start qemu process
|
func (q System) Executable() string {
|
||||||
func (q *System) Start() (err error) {
|
return "qemu-system-" + string(q.arch)
|
||||||
rand.Seed(time.Now().UnixNano()) // Are you sure?
|
}
|
||||||
|
|
||||||
|
func (q *System) Args() (qemuArgs []string) {
|
||||||
if q.sshAddrPort == "" {
|
if q.sshAddrPort == "" {
|
||||||
q.sshAddrPort = getFreeAddrPort()
|
q.sshAddrPort = getFreeAddrPort()
|
||||||
}
|
}
|
||||||
hostfwd := fmt.Sprintf("hostfwd=tcp:%s-:22", q.sshAddrPort)
|
hostfwd := fmt.Sprintf("hostfwd=tcp:%s-:22", q.sshAddrPort)
|
||||||
qemuArgs := []string{"-nographic",
|
qemuArgs = []string{"-nographic",
|
||||||
"-hda", q.drivePath,
|
"-hda", q.drivePath,
|
||||||
"-kernel", q.kernel.KernelPath,
|
"-kernel", q.kernel.KernelPath,
|
||||||
"-smp", fmt.Sprintf("%d", q.Cpus),
|
"-smp", fmt.Sprintf("%d", q.Cpus),
|
||||||
@ -245,8 +247,14 @@ func (q *System) Start() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
qemuArgs = append(qemuArgs, "-append", q.cmdline())
|
qemuArgs = append(qemuArgs, "-append", q.cmdline())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
q.cmd = exec.Command("qemu-system-"+string(q.arch), qemuArgs...)
|
// Start qemu process
|
||||||
|
func (q *System) Start() (err error) {
|
||||||
|
rand.Seed(time.Now().UnixNano()) // Are you sure?
|
||||||
|
|
||||||
|
q.cmd = exec.Command(q.Executable(), q.Args()...)
|
||||||
q.log.Debug().Msgf("%v", q.cmd)
|
q.log.Debug().Msgf("%v", q.cmd)
|
||||||
|
|
||||||
if q.pipe.stdin, err = q.cmd.StdinPipe(); err != nil {
|
if q.pipe.stdin, err = q.cmd.StdinPipe(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user