[node-patches] Change in ovirt-node[master]: functions: Improve virt capability detection

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Nov 21 11:02:34 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: functions: Improve virt capability detection
......................................................................

functions: Improve virt capability detection

Previously it was just searched for the term "kvm" in the capabilities
provided by libvirt to determin if kvm is enabled or not. This could
lead to false positives as the term "kvm" did not only appear as a
domain type (the information the logic is looking for) but also as part
of the emulator (qemu-kvm).
Now the search is more precise and kvm support is only detected if a kvm
domain is found.

rhbz#874377

Change-Id: I0f45a14c3de46c52f2f04b54af049872fb39280d
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirtnode/ovirtfunctions.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/80/9380/1

diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index a7035b6..399a85d 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -1327,7 +1327,8 @@
         libvirt_capabilities = conn.getCapabilities()
     except:
         return 0
-    if "kvm" in libvirt_capabilities:
+    # Look for a KVM mdomain
+    if re.search("domain type=.kvm", libvirt_capabilities):
         return 1
     else:
         return 2


--
To view, visit http://gerrit.ovirt.org/9380
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f45a14c3de46c52f2f04b54af049872fb39280d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list