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 <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2016-09-30 15:42:59 +02:00
parent eae8fae0e7
commit e555f565f4

View File

@ -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, ""))