cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [19/34] git commit: updated refs/heads/ui-restyle to 23093ed
Date Thu, 26 Sep 2013 18:03:20 GMT
CLOUDSTACK-4559: fix devcloud


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/88114350
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/88114350
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/88114350

Branch: refs/heads/ui-restyle
Commit: 88114350c7a126bd943f3841d0cfe79563525311
Parents: 2227eb1
Author: Edison Su <sudison@gmail.com>
Authored: Thu Aug 29 10:33:47 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Sep 25 16:17:46 2013 -0700

----------------------------------------------------------------------
 .../vm/hypervisor/xenserver/xcposs/vmopsSnapshot    | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88114350/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot
index 31f26ad..53f31a9 100644
--- a/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot
+++ b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot
@@ -372,8 +372,16 @@ def unmountSnapshotsDir(session, args):
 
     return "1"
 
-def getPrimarySRPath(primaryStorageSRUuid, isISCSI):
-    if isISCSI:
+def getPrimarySRPath(session, primaryStorageSRUuid, isISCSI):
+    sr = session.xenapi.SR.get_by_uuid(primaryStorageSRUuid)
+    srrec = session.xenapi.SR.get_record(sr)
+    srtype = srrec["type"]
+    if srtype == "file":
+        pbd = session.xenapi.SR.get_PBDs(sr)[0]
+        pbdrec = session.xenapi.PBD.get_record(pbd)
+        primarySRPath = pbdrec["device_config"]["location"]
+        return primarySRPath
+    elif isISCSI:
         primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
         return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
     else:
@@ -472,7 +480,7 @@ def getVhdParent(session, args):
     snapshotUuid              = args['snapshotUuid']
     isISCSI                   = getIsTrueString(args['isISCSI']) 
 
-    primarySRPath = getPrimarySRPath(primaryStorageSRUuid, isISCSI)
+    primarySRPath = getPrimarySRPath(session, primaryStorageSRUuid, isISCSI)
     util.SMlog("primarySRPath: " + primarySRPath)
 
     baseCopyUuid = getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI)
@@ -490,7 +498,7 @@ def backupSnapshot(session, args):
     isISCSI                   = getIsTrueString(args['isISCSI'])
     path = args['path']
     localMountPoint = args['localMountPoint']
-    primarySRPath = getPrimarySRPath(primaryStorageSRUuid, isISCSI)
+    primarySRPath = getPrimarySRPath(session, primaryStorageSRUuid, isISCSI)
     util.SMlog("primarySRPath: " + primarySRPath)
 
     baseCopyUuid = getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI)


Mime
View raw message