From d94b5af8755b88a2081015a5bb6785bce9e3df00 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 12 Sep 2016 19:15:38 +0200 Subject: [PATCH] qemu: Add a VGA parameter field to the Config structure The VGA string represents the type of VGA card qemu should emulate. Signed-off-by: Samuel Ortiz --- qemu.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qemu.go b/qemu.go index 0013e6a44..dbc120a0d 100644 --- a/qemu.go +++ b/qemu.go @@ -193,6 +193,9 @@ type Config struct { // RTC is the qemu Real Time Clock configuration RTC RTC + // VGA is the qemu VGA mode. + VGA string + // UUID is the qemu process UUID. UUID string @@ -445,6 +448,15 @@ func appendGlobalParam(params []string, config Config) []string { return params } +func appendVGA(params []string, config Config) []string { + if config.VGA != "" { + params = append(params, "-vga") + params = append(params, config.VGA) + } + + return params +} + func appendKernel(params []string, config Config) []string { if config.Kernel.Path != "" { params = append(params, "-kernel") @@ -485,6 +497,7 @@ func LaunchQemu(config Config, logger QMPLog) (string, error) { params = appendRTC(params, config) params = appendKernel(params, config) params = appendGlobalParam(params, config) + params = appendVGA(params, config) params = append(params, config.ExtraParams...)