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.


** Patch added: "fix-qemu-1.0-compat.patch"
   
https://bugs.launchpad.net/ubuntu/+source/ganeti/+bug/932166/+attachment/2939877/+files/fix-qemu-1.0-compat.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/932166

Title:
  ganeti2 can not determine kvm version

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ganeti/+bug/932166/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to