[Kimchi-devel] [PATCH] issue #553: Use required parameter in "snapshotLookupByName"

Crístian Viana vianac at linux.vnet.ibm.com
Thu Dec 11 18:23:37 UTC 2014


The function "snapshotLookupByName" has a required parameter in
older versions of libvirt. On newer versions, however, this parameter
is optional and it was causing an error on RHEL because it uses an old
version of libvirt.

Always use the parameter in function "snapshotLookupByName" with its default
value (0).

Fix issue #553 ("Get snapshots of vm raise 500 error").

Signed-off-by: Crístian Viana <vianac at linux.vnet.ibm.com>
---
 src/kimchi/model/vmsnapshots.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kimchi/model/vmsnapshots.py b/src/kimchi/model/vmsnapshots.py
index bb9bfaa..725770d 100644
--- a/src/kimchi/model/vmsnapshots.py
+++ b/src/kimchi/model/vmsnapshots.py
@@ -165,7 +165,7 @@ class VMSnapshotModel(object):
         vir_dom = VMModel.get_vm(vm_name, self.conn)
 
         try:
-            return vir_dom.snapshotLookupByName(name)
+            return vir_dom.snapshotLookupByName(name, 0)
         except libvirt.libvirtError, e:
             code = e.get_error_code()
             if code == libvirt.VIR_ERR_NO_DOMAIN_SNAPSHOT:
-- 
1.9.3




More information about the Kimchi-devel mailing list