Commit 99c7cd5b authored by Guido Trotter's avatar Guido Trotter
Browse files

kvm: Use -display none rather than -nographic



Newer versions of kvm (from 1.4) don't support -nographic with
-daemonize. When -display exists, use -display none instead.

This fixes Issue 389.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent db0e97f0
......@@ -548,6 +548,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
_ENABLE_KVM_RE = re.compile(r"^-enable-kvm\s", re.M)
_DISABLE_KVM_RE = re.compile(r"^-disable-kvm\s", re.M)
_NETDEV_RE = re.compile(r"^-netdev\s", re.M)
_DISPLAY_RE = re.compile(r"^-display\s", re.M)
_NEW_VIRTIO_RE = re.compile(r"^name \"%s\"" % _VIRTIO_NET_PCI, re.M)
# match -drive.*boot=on|off on different lines, but in between accept only
# dashes not preceeded by a new line (which would mean another option
......@@ -1324,7 +1325,12 @@ class KVMHypervisor(hv_base.BaseHypervisor):
kvm_cmd.extend(["-spice", spice_arg])
else:
kvm_cmd.extend(["-nographic"])
# From qemu 1.4 -nographic is incompatible with -daemonize. The new way
# also works in earlier versions though (tested with 1.1 and 1.3)
if self._DISPLAY_RE.search(kvmhelp):
kvm_cmd.extend(["-display", "none"])
else:
kvm_cmd.extend(["-nographic"])
if hvp[constants.HV_USE_LOCALTIME]:
kvm_cmd.extend(["-localtime"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment