From e555f565f46c0bb8f7841b01246860b36fb3589f Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 30 Sep 2016 15:42:59 +0200 Subject: [PATCH] qemu: Add support for socket based consoles When we get no virtual console to plug into, we may want qemu to create a socket where we can asynchronously connect to. Signed-off-by: Samuel Ortiz --- qemu.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu.go b/qemu.go index 15cb20c1a0..974ebfb934 100644 --- a/qemu.go +++ b/qemu.go @@ -305,7 +305,11 @@ func (cdev CharDevice) QemuParams(config *Config) []string { cdevParams = append(cdevParams, string(cdev.Backend)) cdevParams = append(cdevParams, fmt.Sprintf(",id=%s", cdev.ID)) - cdevParams = append(cdevParams, fmt.Sprintf(",path=%s", cdev.Path)) + if cdev.Backend == Socket { + cdevParams = append(cdevParams, fmt.Sprintf(",path=%s,server,nowait", cdev.Path)) + } else { + cdevParams = append(cdevParams, fmt.Sprintf(",path=%s", cdev.Path)) + } qemuParams = append(qemuParams, "-device") qemuParams = append(qemuParams, strings.Join(deviceParams, ""))