Eduardo has uploaded a new change for review.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Add lvm.lvPhysDev() to get the physical LV device.
Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Signed-off-by: Eduardo ewarszaw@redhat.com --- M vdsm/storage/lvm.py 1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/8751/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py index 78c846a..094569d 100644 --- a/vdsm/storage/lvm.py +++ b/vdsm/storage/lvm.py @@ -1156,6 +1156,16 @@ def lvPath(vgName, lvName): return os.path.join("/dev", vgName, lvName)
+def lvPhysDev(vgName, lvName): + """Return the LV physical device. + + returns: dm-X + The LV should be active. + """ + + lvp = lvPath(vgName, lvName) + return os.path.basename(os.readlink(lvp)) +
def _isLVActive(vgName, lvName): """Active volumes have a mp link.
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com
Adam Litke has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Mark Wu has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File vdsm/storage/lvm.py Line 1156: def lvPath(vgName, lvName): Line 1157: return os.path.join("/dev", vgName, lvName) Line 1158: Line 1159: def lvPhysDev(vgName, lvName): Line 1160: """Return the LV physical device. I think the function name and comment are a little confusing. This function returns device mapper device. It's a kind of virtual block device built on the real physical device. Why do you call it physical device? How about lvDmDev? Line 1161: Line 1162: returns: dm-X Line 1163: The LV should be active. Line 1164: """
Line 1159: def lvPhysDev(vgName, lvName): Line 1160: """Return the LV physical device. Line 1161: Line 1162: returns: dm-X Line 1163: The LV should be active. Does it mean the caller should validate it's active? If yes, I think we should clarify it more clearly. Line 1164: """ Line 1165: Line 1166: lvp = lvPath(vgName, lvName) Line 1167: return os.path.basename(os.readlink(lvp))
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Eduardo has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/storage/lvm.py Line 1159: def lvPhysDev(vgName, lvName): Line 1160: """Return the LV physical device. Line 1161: Line 1162: returns: dm-X Line 1163: The LV should be active. f the LV is inactive there is no dm device. Calling this function will raise OSError. Line 1164: """ Line 1165: Line 1166: lvp = lvPath(vgName, lvName) Line 1167: return os.path.basename(os.readlink(lvp))
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Shu Ming has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Adam Litke has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Mark Wu has posted comments on this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
The commit message also needs an update. Sorry for not pointing out in previous comment. Except that, it looks good to me.
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
Eduardo has abandoned this change.
Change subject: Add lvm.lvPhysDev() to get the physical LV device. ......................................................................
Patch Set 2: Abandoned
This change is actually in.
-- To view, visit http://gerrit.ovirt.org/8751 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon Gerrit-Change-Id: I6d3286589ea02025713d10d85a9892024f586b73 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com
vdsm-patches@lists.fedorahosted.org