Timothy Asir has uploaded a new change for review.

Change subject: Add an autobackup param in changelv and set the default value 
to false
......................................................................

Add an autobackup param in changelv and set the default value to false

Currently autobackup option is set to false is used forcely in
most of the lvm function in storage.lvm. This will not allow
any call to automatically back up metadata after a change.

This patch addes a parm to changelv and set the default value to
false. One can send true to change the option. However this change
should be done in manyplace of the storage.lvm module like
lvcreate, lvremove and so on.

Also currently most of the functions in lvm module accepts list
of params in a tuple format and have some mandatory options.
This will allow to break the lvm call if any thing called with
different option values in the tuple list which are now mandatory
to have some constant/'already defined' value.
ex:- changelv(vg, lvs, ('-autobackup', 'y'))

Change-Id: I8190878fe071fad46800e666795b94779d745abf
Signed-off-by: Timothy Asir <tjeya...@redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/38195/1

diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 2a85e39..e9d2f10 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -783,7 +783,7 @@
                 "vgchange on vg(s) %s failed. %d %s %s" % (vgs, rc, out, err))
 
 
-def changelv(vg, lvs, attrs):
+def changelv(vg, lvs, attrs, autobackup=False):
     """
     Change multiple attributes on multiple LVs.
 
@@ -802,7 +802,8 @@
     # so we invalidate cache to reload these volumes on first occasion
     lvnames = tuple("%s/%s" % (vg, lv) for lv in lvs)
     cmd = ["lvchange"]
-    cmd.extend(LVM_NOBACKUP)
+    if not autobackup:
+        cmd.extend(LVM_NOBACKUP)
     if isinstance(attrs[0], str):
         # ("--attribute", "value")
         cmd.extend(attrs)


-- 
To view, visit https://gerrit.ovirt.org/38195
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8190878fe071fad46800e666795b94779d745abf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeya...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to