qemu: add debug logfile

When LogFile is specified, output debug log there.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2019-08-13 01:42:29 -07:00
parent aa341b005e
commit 30bfcaaa6d
2 changed files with 15 additions and 1 deletions

View File

@@ -712,7 +712,8 @@ func TestAppendQMPSocketServer(t *testing.T) {
}
var pidfile = "/run/vc/vm/iamsandboxid/pidfile"
var qemuString = "-name cc-qemu -cpu host -uuid " + agentUUID + " -pidfile " + pidfile
var logfile = "/run/vc/vm/iamsandboxid/logfile"
var qemuString = "-name cc-qemu -cpu host -uuid " + agentUUID + " -pidfile " + pidfile + " -D " + logfile
func TestAppendStrings(t *testing.T) {
config := Config{
@@ -721,12 +722,14 @@ func TestAppendStrings(t *testing.T) {
UUID: agentUUID,
CPUModel: "host",
PidFile: pidfile,
LogFile: logfile,
}
config.appendName()
config.appendCPUModel()
config.appendUUID()
config.appendPidFile()
config.appendLogFile()
result := strings.Join(config.qemuParams, " ")
if result != qemuString {