This patch fixes it: http://groups.google.com/group/ganeti/attach/95e8de340d1b4b70/fix-qemu-1.0-compat.patch?part=2
--- a/lib/hypervisor/hv_kvm.py 2012-02-01 13:14:28.556767386 +0000 +++ b/lib/hypervisor/hv_kvm.py 2012-02-01 13:17:02.431087060 +0000 @@ -199,7 +199,7 @@ _MIGRATION_INFO_MAX_BAD_ANSWERS = 5 _MIGRATION_INFO_RETRY_DELAY = 2
- _VERSION_RE = re.compile(r"\b(\d+)\.(\d+)\.(\d+)\b") + _VERSION_RE = re.compile(r"\b(\d+)\.(\d+)(\.(\d+))?\b")
ANCILLARY_FILES = [ _KVM_NETWORK_SCRIPT, @@ -924,21 +924,40 @@ return result
@classmethod + def _ParseKVMVersion(cls, text): + """Parse the KVM version from the --help output. + + @type text: string + @param text: output of kvm --help + @return: (version, v_maj, v_min, v_rev) + @raise L{errors.HypervisorError}: when the KVM version cannot be retrieved + + """ + match = cls._VERSION_RE.search(text.splitlines()[0]) + if not match: + raise errors.HypervisorError("Unable to get KVM version") + + v_all = match.group(0) + v_maj = int(match.group(1)) + v_min = int(match.group(2)) + if match.group(4): + v_rev = int(match.group(4)) + else: + v_rev = 0 + return (v_all, v_maj, v_min, v_rev) + + @classmethod def _GetKVMVersion(cls): """Return the installed KVM version
@return: (version, v_maj, v_min, v_rev), or None + @raise L{errors.HypervisorError}: when the KVM version cannot be retrieved
""" result = utils.RunCmd([constants.KVM_PATH, "--help"]) if result.failed: - return None - match = cls._VERSION_RE.search(result.output.splitlines()[0]) - if not match: - return None - - return (match.group(0), int(match.group(1)), int(match.group(2)), - int(match.group(3))) + raise errors.HypervisorError("Unable to get KVM version") + return cls._ParseKVMVersion(result.output)
def StopInstance(self, instance, force=False, retry=False, name=None): """Stop an instance.
This patch fixes it: groups. google. com/group/ ganeti/ attach/ 95e8de340d1b4b7 0/fix-qemu- 1.0-compat. patch?part= 2
http://
--- a/lib/hyperviso r/hv_kvm. py 2012-02-01 13:14:28.556767386 +0000 r/hv_kvm. py 2012-02-01 13:17:02.431087060 +0000 INFO_MAX_ BAD_ANSWERS = 5 INFO_RETRY_ DELAY = 2
+++ b/lib/hyperviso
@@ -199,7 +199,7 @@
_MIGRATION_
_MIGRATION_
- _VERSION_RE = re.compile( r"\b(\d+ )\.(\d+ )\.(\d+ )\b") r"\b(\d+ )\.(\d+ )(\.(\d+ ))?\b")
+ _VERSION_RE = re.compile(
ANCILLARY_FILES = [ NETWORK_ SCRIPT,
_KVM_
@@ -924,21 +924,40 @@
return result
@classmethod n(cls, text): HypervisorError }: when the KVM version cannot be retrieved RE.search( text.splitlines ()[0]) HypervisorError ("Unable to get KVM version") cls):
+ def _ParseKVMVersio
+ """Parse the KVM version from the --help output.
+
+ @type text: string
+ @param text: output of kvm --help
+ @return: (version, v_maj, v_min, v_rev)
+ @raise L{errors.
+
+ """
+ match = cls._VERSION_
+ if not match:
+ raise errors.
+
+ v_all = match.group(0)
+ v_maj = int(match.group(1))
+ v_min = int(match.group(2))
+ if match.group(4):
+ v_rev = int(match.group(4))
+ else:
+ v_rev = 0
+ return (v_all, v_maj, v_min, v_rev)
+
+ @classmethod
def _GetKVMVersion(
"""Return the installed KVM version
@return: (version, v_maj, v_min, v_rev), or None HypervisorError }: when the KVM version cannot be retrieved
+ @raise L{errors.
""" [constants. KVM_PATH, "--help"]) RE.search( result. output. splitlines( )[0]) group(1) ), int(match. group(2) ), group(3) )) HypervisorError ("Unable to get KVM version") rsion(result. output)
result = utils.RunCmd(
if result.failed:
- return None
- match = cls._VERSION_
- if not match:
- return None
-
- return (match.group(0), int(match.
- int(match.
+ raise errors.
+ return cls._ParseKVMVe
def StopInstance(self, instance, force=False, retry=False, name=None):
"""Stop an instance.