diff --git a/lib/constants.py b/lib/constants.py index e4dcd5781da03ed13f3ffcab37d8e354de18ac64..508d6088e6f214b7471ef58aed65f9f3e525e4bf 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 54191b7cdc8cd678c1250c6263fff7a87cafc77f..16f105a4dd307ee97826c36e7e9906955aaf6bb4 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 cdbba36710f2f1c8f455d1a4299946bfc2a79f6e..0d6b931ee4cd05961e9c1fc44acfb37c02c144eb 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.