Revision 99c7cd5b lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
548 548
  _ENABLE_KVM_RE = re.compile(r"^-enable-kvm\s", re.M)
549 549
  _DISABLE_KVM_RE = re.compile(r"^-disable-kvm\s", re.M)
550 550
  _NETDEV_RE = re.compile(r"^-netdev\s", re.M)
551
  _DISPLAY_RE = re.compile(r"^-display\s", re.M)
551 552
  _NEW_VIRTIO_RE = re.compile(r"^name \"%s\"" % _VIRTIO_NET_PCI, re.M)
552 553
  # match  -drive.*boot=on|off on different lines, but in between accept only
553 554
  # dashes not preceeded by a new line (which would mean another option
......
1324 1325
      kvm_cmd.extend(["-spice", spice_arg])
1325 1326

  
1326 1327
    else:
1327
      kvm_cmd.extend(["-nographic"])
1328
      # From qemu 1.4 -nographic is incompatible with -daemonize. The new way
1329
      # also works in earlier versions though (tested with 1.1 and 1.3)
1330
      if self._DISPLAY_RE.search(kvmhelp):
1331
        kvm_cmd.extend(["-display", "none"])
1332
      else:
1333
        kvm_cmd.extend(["-nographic"])
1328 1334

  
1329 1335
    if hvp[constants.HV_USE_LOCALTIME]:
1330 1336
      kvm_cmd.extend(["-localtime"])

Also available in: Unified diff