[NEW PATCH] Add getDevUuid() to device mapper (via gerrit-bot)
Saggi Mizrahi
smizrahi at redhat.com
Sun Jul 31 13:46:06 UTC 2011
New patch submitted by Saggi Mizrahi (smizrahi at redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/768
commit 3030224e2d30415d58939e7e49f8912495316120
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date: Sun Jul 31 16:44:17 2011 +0300
Add getDevUuid() to device mapper
This method though unused is pretty useful and I wouldn't want people
misimplementing it. This is a small part in making the device mapper
volume complete and useful outside of vdsm.
Change-Id: I4fe339f8cb03e0b3cb2c05fabd358bcfd58ade3e
diff --git a/vdsm/storage/devicemapper.py b/vdsm/storage/devicemapper.py
index 78e44a0..bb6b7e0 100644
--- a/vdsm/storage/devicemapper.py
+++ b/vdsm/storage/devicemapper.py
@@ -60,6 +60,11 @@ def getDevName(dmId):
with open(nameFilePath, "r") as f:
return f.readline().rstrip("\n")
+def getDevUuid(dmId):
+ nameFilePath = os.path.join(getSysfsPath(dmId), "dm", "uuid")
+ with open(nameFilePath, "r") as f:
+ return f.readline().rstrip("\n")
+
def resolveDevName(devName):
try:
if os.path.exists(getSysfsPath(devName)):
More information about the vdsm-patches
mailing list