aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorJeremyHuang <jeremy.huang@suse.com>2016-06-20 17:37:29 +0800
committerJeremyHuang <jeremy.huang@suse.com>2016-06-20 17:54:25 +0800
commit6691f801bf97bd6423f17e3f70a6ce0222e1e151 (patch)
tree166ba2acacde3e298ec1025d27f996c92742b73b /vm
parent54b31a67e6a9f49fc2cda38a79c5adfe68fe9d21 (diff)
add a initrd flag for qemu type and display the qemu command.
Diffstat (limited to 'vm')
-rw-r--r--vm/qemu/qemu.go6
-rw-r--r--vm/vm.go1
2 files changed, 6 insertions, 1 deletions
diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go
index ab669b9b1..97ec1850d 100644
--- a/vm/qemu/qemu.go
+++ b/vm/qemu/qemu.go
@@ -5,6 +5,7 @@ package qemu
import (
"fmt"
+ "log"
"math/rand"
"net"
"os"
@@ -142,14 +143,17 @@ func (inst *instance) Boot() error {
"-smp", "sockets=2,cores=2,threads=1",
"-usb", "-usbdevice", "mouse", "-usbdevice", "tablet",
"-soundhw", "all",
+ "-initrd", inst.cfg.Initrd,
}
if inst.cfg.Kernel != "" {
args = append(args,
"-kernel", inst.cfg.Kernel,
- "-append", "console=ttyS0 root=/dev/sda debug earlyprintk=serial slub_debug=UZ "+inst.cfg.Cmdline,
+ "-append", "\"console=ttyS0 root=/dev/sda debug earlyprintk=serial slub_debug=UZ\" "+inst.cfg.Cmdline,
)
}
qemu := exec.Command(inst.cfg.Bin, args...)
+
+ log.Printf("qemu command : ", qemu.Args)
qemu.Stdout = inst.wpipe
qemu.Stderr = inst.wpipe
if err := qemu.Start(); err != nil {
diff --git a/vm/vm.go b/vm/vm.go
index 8ac190264..49bec49a6 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -33,6 +33,7 @@ type Config struct {
Index int
Workdir string
Bin string
+ Initrd string
Kernel string
Cmdline string
Image string