From: Guido Trotter Date: Fri, 11 Jan 2013 18:11:13 +0000 (+0100) Subject: kvm: Add -vga option X-Git-Tag: v2.7.0beta1~122 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/7589346f092ba7940c4bf0cf4b0cf3f2669774cf kvm: Add -vga option As requested in Issue 69. Signed-off-by: Guido Trotter Reviewed-by: Michael Hanselmann --- diff --git a/lib/constants.py b/lib/constants.py index e4dcd57..508d608 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -832,6 +832,7 @@ HV_CPU_THREADS = "cpu_threads" HV_CPU_SOCKETS = "cpu_sockets" HV_SOUNDHW = "soundhw" HV_USB_DEVICES = "usb_devices" +HV_VGA = "vga" HV_KVM_EXTRA = "kvm_extra" @@ -898,6 +899,7 @@ HVS_PARAMETER_TYPES = { HV_CPU_SOCKETS: VTYPE_INT, HV_SOUNDHW: VTYPE_STRING, HV_USB_DEVICES: VTYPE_STRING, + HV_VGA: VTYPE_STRING, HV_KVM_EXTRA: VTYPE_STRING, } @@ -1968,6 +1970,7 @@ HVC_DEFAULTS = { HV_CPU_SOCKETS: 0, HV_SOUNDHW: "", HV_USB_DEVICES: "", + HV_VGA: "", HV_KVM_EXTRA: "", }, HT_FAKE: {}, diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 54191b7..16f105a 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -537,6 +537,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): constants.HV_CPU_SOCKETS: hv_base.OPT_NONNEGATIVE_INT_CHECK, constants.HV_SOUNDHW: hv_base.NO_CHECK, constants.HV_USB_DEVICES: hv_base.NO_CHECK, + constants.HV_VGA: hv_base.NO_CHECK, constants.HV_KVM_EXTRA: hv_base.NO_CHECK, } @@ -1321,9 +1322,6 @@ class KVMHypervisor(hv_base.BaseHypervisor): logging.info("KVM: SPICE will listen on port %s", instance.network_port) kvm_cmd.extend(["-spice", spice_arg]) - # Tell kvm to use the paravirtualized graphic card, optimized for SPICE - kvm_cmd.extend(["-vga", "qxl"]) - else: kvm_cmd.extend(["-nographic"]) @@ -1341,6 +1339,13 @@ class KVMHypervisor(hv_base.BaseHypervisor): if hvp[constants.HV_SOUNDHW]: kvm_cmd.extend(["-soundhw", hvp[constants.HV_SOUNDHW]]) + # Pass a -vga option if requested, or if spice is used, for backwards + # compatibility. + if hvp[constants.HV_VGA]: + kvm_cmd.extend(["-vga", hvp[constants.HV_VGA]]) + elif spice_bind: + kvm_cmd.extend(["-vga", "qxl"]) + # Various types of usb devices, comma separated if hvp[constants.HV_USB_DEVICES]: for dev in hvp[constants.HV_USB_DEVICES].split(","): diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index cdbba36..0d6b931 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -663,6 +663,11 @@ usb\_devices ``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax of the possible components. +vga + Valid for the KVM hypervisor. + + Emulated vga mode, passed the the kvm -vga option. + kvm\_extra Valid for the KVM hypervisor.