Revision e3b89628 lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
1643 1643
    return (v_all, v_maj, v_min, v_rev)
1644 1644

  
1645 1645
  @classmethod
1646
  def _GetKVMHelpOutput(cls):
1647
    """Return the KVM help output.
1648

  
1649
    @return: output of kvm --help
1650
    @raise errors.HypervisorError: when the KVM help output cannot be retrieved
1651

  
1652
    """
1653
    result = utils.RunCmd([constants.KVM_PATH, "--help"])
1654
    if result.failed:
1655
      raise errors.HypervisorError("Unable to get KVM help output")
1656
    return result.output
1657

  
1658
  @classmethod
1646 1659
  def _GetKVMVersion(cls):
1647 1660
    """Return the installed KVM version.
1648 1661

  
......
1650 1663
    @raise errors.HypervisorError: when the KVM version cannot be retrieved
1651 1664

  
1652 1665
    """
1653
    result = utils.RunCmd([constants.KVM_PATH, "--help"])
1654
    if result.failed:
1655
      raise errors.HypervisorError("Unable to get KVM version")
1656
    return cls._ParseKVMVersion(result.output)
1666
    return cls._ParseKVMVersion(cls._GetKVMHelpOutput())
1657 1667

  
1658 1668
  def StopInstance(self, instance, force=False, retry=False, name=None):
1659 1669
    """Stop an instance.

Also available in: Unified diff