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 <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2016-09-12 19:15:38 +02:00
parent 4892d041e7
commit d94b5af875

13
qemu.go
View File

@ -193,6 +193,9 @@ type Config struct {
// RTC is the qemu Real Time Clock configuration // RTC is the qemu Real Time Clock configuration
RTC RTC RTC RTC
// VGA is the qemu VGA mode.
VGA string
// UUID is the qemu process UUID. // UUID is the qemu process UUID.
UUID string UUID string
@ -445,6 +448,15 @@ func appendGlobalParam(params []string, config Config) []string {
return params 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 { func appendKernel(params []string, config Config) []string {
if config.Kernel.Path != "" { if config.Kernel.Path != "" {
params = append(params, "-kernel") params = append(params, "-kernel")
@ -485,6 +497,7 @@ func LaunchQemu(config Config, logger QMPLog) (string, error) {
params = appendRTC(params, config) params = appendRTC(params, config)
params = appendKernel(params, config) params = appendKernel(params, config)
params = appendGlobalParam(params, config) params = appendGlobalParam(params, config)
params = appendVGA(params, config)
params = append(params, config.ExtraParams...) params = append(params, config.ExtraParams...)