[Libvirt-cim] [PATCH 1 of 2] Add vsss.py module

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri May 15 01:43:00 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1242082293 25200
# Node ID 6654874e72ccd2e71d252ad553a298bd15079c7d
# Parent  a6630ea580cb00e8d5ef4ab93f7b18bb42414109
Add vsss.py module

For keeping functions related to the VirtualSystemSnapshotService

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r a6630ea580cb -r 6654874e72cc suites/libvirt-cim/lib/XenKvmLib/vsss.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsss.py	Mon May 11 15:51:33 2009 -0700
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+#    Kaitlin Rupert <karupert at us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+#
+
+import pywbem
+from VirtLib.utils import run_remote 
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+
+#Path to snapshot save location
+snapshot_save_loc = '/var/lib/libvirt/'
+
+def remove_snapshot(ip, vm_name):
+    snapshot = "%s%s" % (snapshot_save_loc, vm_name)
+
+    cmd = "rm %s.save" % snapshot
+    ret, out = run_remote(ip, cmd)
+    if ret != 0:
+        logger.error("Failed to remove snapshot file for %s", vm_name)
+        return FAIL
+
+    return PASS




More information about the Libvirt-cim mailing list