Block API will be using restore, not revert thus changing this
to match for snapshots.
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 10 +++++-----
.../include/libstoragemgmt/libstoragemgmt_plug_interface.h | 6 +++---
c_binding/lsm_mgmt.cpp | 4 ++--
c_binding/lsm_plugin_ipc.cpp | 8 ++++----
plugin/nstor/nstor.py | 2 +-
plugin/ontap/ontap.py | 8 ++++----
plugin/sim/simarray.py | 10 +++++-----
plugin/sim/simulator.py | 4 ++--
plugin/simc/simc_lsmplugin.c | 4 ++--
python_binding/lsm/_client.py | 14 +++++++-------
python_binding/lsm/_cmdline.py | 2 +-
python_binding/lsm/_iplugin.py | 4 ++--
test/plugin_test.py | 2 +-
test/tester.c | 14 +++++++-------
14 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index 3c922c8..96be652 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -903,20 +903,20 @@ extern "C" {
char **job, lsm_flag flags);
/**
- * Reverts a file system or files to a previous state as specified in the
+ * Restores a file system or files to a previous state as specified in the
* snapshot.
* @param c Valid connection
* @param fs File system which contains the snapshot
- * @param ss Snapshot to revert to
- * @param files Optional list of files to revert
- * @param restore_files Optional list of file names to revert to
+ * @param ss Snapshot to restore to
+ * @param files Optional list of files to restore
+ * @param restore_files Optional list of file names to restore to
* @param all_files 0 = False else True
* @param job Job id if operation is async.
* @param[in] flags Reserved for future use, must be zero.
* @return LSM_ERR_OK on success, LSM_ERR_JOB_STARTED if async.,
* else error code
*/
- int LSM_DLL_EXPORT lsm_fs_ss_revert(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss,
+ int LSM_DLL_EXPORT lsm_fs_ss_restore(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss,
lsm_string_list *files,
lsm_string_list *restore_files,
int all_files, char **job, lsm_flag flags);
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 1970985..dc18fa4 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -805,11 +805,11 @@ typedef int (*lsm_plug_fs_ss_delete)(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss
* @param[in] fs File system of interest
* @param[in] files Optional list of files
* @param[in] restore_files Optional path and name of restored files
- * @param[in] all_files boolean to indicate all files should be reverted
+ * @param[in] all_files boolean to indicate all files should be restored
* @param[out] job Job ID
* @return LSM_ERR_OK, else error reason
*/
-typedef int (*lsm_plug_fs_ss_revert)(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss,
+typedef int (*lsm_plug_fs_ss_restore)(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss,
lsm_string_list *files,
lsm_string_list *restore_files,
int all_files, char **job, lsm_flag flags);
@@ -927,7 +927,7 @@ struct lsm_fs_ops_v1 {
lsm_plug_fs_ss_list fs_ss_list; /**< list snapshots */
lsm_plug_fs_ss_create fs_ss_create; /**< create a snapshot */
lsm_plug_fs_ss_delete fs_ss_delete; /**< delete a snapshot */
- lsm_plug_fs_ss_revert fs_ss_revert; /**< revert a snapshot */
+ lsm_plug_fs_ss_restore fs_ss_restore; /**< restore a snapshot */
};
/** \struct lsm_nas_ops_v1
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index 5df3048..61c8ce2 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -2242,7 +2242,7 @@ int lsm_fs_ss_delete(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss, char **job,
return jobCheck(c, rc, response, job);
}
-int lsm_fs_ss_revert(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss,
+int lsm_fs_ss_restore(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss,
lsm_string_list *files,
lsm_string_list *restore_files,
int all_files, char **job, lsm_flag flags)
@@ -2284,7 +2284,7 @@ int lsm_fs_ss_revert(lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss,
Value parameters(p);
Value response;
- int rc = rpc(c, "fs_snapshot_revert", parameters, response);
+ int rc = rpc(c, "fs_snapshot_restore", parameters, response);
return jobCheck(c, rc, response, job);
}
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 8d1acb7..a9ff530 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1976,10 +1976,10 @@ static int ss_delete(lsm_plugin_ptr p, Value ¶ms, Value &response)
return rc;
}
-static int ss_revert(lsm_plugin_ptr p, Value ¶ms, Value &response)
+static int ss_restore(lsm_plugin_ptr p, Value ¶ms, Value &response)
{
int rc = LSM_ERR_NO_SUPPORT;
- if( p && p->san_ops && p->fs_ops->fs_ss_revert ) {
+ if( p && p->san_ops && p->fs_ops->fs_ss_restore ) {
Value v_fs = params["fs"];
Value v_ss = params["snapshot"];
@@ -2003,7 +2003,7 @@ static int ss_revert(lsm_plugin_ptr p, Value ¶ms, Value &response)
int all_files = (v_all_files.asBool()) ? 1 : 0;
if( fs && ss && files && restore_files ) {
- rc = p->fs_ops->fs_ss_revert(p, fs, ss, files, restore_files,
+ rc = p->fs_ops->fs_ss_restore(p, fs, ss, files, restore_files,
all_files, &job,
LSM_FLAG_GET_VALUE(params));
@@ -2382,7 +2382,7 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("fs_resize", fs_resize)
("fs_snapshot_create", ss_create)
("fs_snapshot_delete", ss_delete)
- ("fs_snapshot_revert", ss_revert)
+ ("fs_snapshot_restore", ss_restore)
("fs_snapshots", ss_list)
("time_out_get", handle_get_time_out)
("initiators", handle_initiators)
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index 57a8191..479af78 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -305,7 +305,7 @@ class NexentaStor(INfs, IStorageAreaNetwork):
flags=0):
return
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
+ def fs_snapshot_restore(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
self._request("rollback", "snapshot", [snapshot.name, '-r'])
return
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index 1a9acab..229e609 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -641,7 +641,7 @@ class Ontap(IStorageAreaNetwork, INfs):
self._na_volume_resize_restore(na_vol, diff)
try:
- #if this raises an exception we need to revert the volume
+ #if this raises an exception we need to restore the volume
self.f.lun_resize(volume.name, new_size_bytes)
except Exception as e:
#Put the volume back to previous size
@@ -922,7 +922,7 @@ class Ontap(IStorageAreaNetwork, INfs):
def fs_snapshot_delete(self, fs, snapshot, flags=0):
self.f.snapshot_delete(fs.name, snapshot.name)
- def _ss_revert_files(self, volume_name, snapshot_name, files,
+ def _ss_restore_files(self, volume_name, snapshot_name, files,
restore_files):
for i in range(len(files)):
src = Ontap.build_name(volume_name, files[i])
@@ -932,7 +932,7 @@ class Ontap(IStorageAreaNetwork, INfs):
self.f.snapshot_restore_file(snapshot_name, src, dest)
@handle_ontap_errors
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
+ def fs_snapshot_restore(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
"""
Restores a FS or files on a FS.
@@ -948,7 +948,7 @@ class Ontap(IStorageAreaNetwork, INfs):
raise LsmError(ErrorNumber.INVALID_ARGUMENT,
"num files != num restore_files")
- self._ss_revert_files(fs.name, snapshot.name, files,
+ self._ss_restore_files(fs.name, snapshot.name, files,
restore_files)
return "%s@%d" % (Ontap.SS_JOB, len(files))
else:
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 6a3c1fa..fd940b6 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -311,10 +311,10 @@ class SimArray(object):
return self.data.job_create(
self.data.fs_snapshot_delete(fs_id, snap_id, flags))[0]
- def fs_snapshot_revert(self, fs_id, snap_id, files, restore_files,
- flag_all_files, flags):
+ def fs_snapshot_restore(self, fs_id, snap_id, files, restore_files,
+ flag_all_files, flags):
return self.data.job_create(
- self.data.fs_snapshot_revert(
+ self.data.fs_snapshot_restore(
fs_id, snap_id, files, restore_files,
flag_all_files, flags))[0]
@@ -1347,7 +1347,7 @@ class SimData(object):
self.fs_dict[fs_id]['snaps'] = new_snap_ids
return None
- def fs_snapshot_revert(self, fs_id, snap_id, files, restore_files,
+ def fs_snapshot_restore(self, fs_id, snap_id, files, restore_files,
flag_all_files, flags):
if fs_id not in self.fs_dict.keys():
raise LsmError(ErrorNumber.INVALID_INIT,
@@ -1355,7 +1355,7 @@ class SimData(object):
if snap_id not in self.snap_dict.keys():
raise LsmError(ErrorNumber.INVALID_SS,
"No such Snapshot: %s" % snap_id)
- # Nothing need to done internally for revert.
+ # Nothing need to done internally for restore.
return None
def fs_child_dependency(self, fs_id, files, flags=0):
diff --git a/plugin/sim/simulator.py b/plugin/sim/simulator.py
index 168bd3e..e109639 100644
--- a/plugin/sim/simulator.py
+++ b/plugin/sim/simulator.py
@@ -279,9 +279,9 @@ class SimPlugin(INfs, IStorageAreaNetwork):
return self.sim_array.fs_snapshot_delete(
fs.id, snapshot.id, flags)
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
+ def fs_snapshot_restore(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
- return self.sim_array.fs_snapshot_revert(
+ return self.sim_array.fs_snapshot_restore(
fs.id, snapshot.id, files, restore_files, all_files, flags)
def fs_child_dependency(self, fs, files, flags=0):
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 3532dfe..b4fa9b2 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -2196,7 +2196,7 @@ static int ss_delete(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss,
return rc;
}
-static int ss_revert(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss,
+static int ss_restore(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss *ss,
lsm_string_list *files,
lsm_string_list *restore_files,
int all_files, char **job, lsm_flag flags)
@@ -2232,7 +2232,7 @@ static struct lsm_fs_ops_v1 fs_ops = {
ss_list,
ss_create,
ss_delete,
- ss_revert
+ ss_restore
};
static int nfs_auth_types(lsm_plugin_ptr c, lsm_string_list **types,
diff --git a/python_binding/lsm/_client.py b/python_binding/lsm/_client.py
index a87e557..7aded84 100644
--- a/python_binding/lsm/_client.py
+++ b/python_binding/lsm/_client.py
@@ -993,16 +993,16 @@ class Client(INetworkAttachedStorage):
## Reverts a snapshot
# @param self The this pointer
- # @param fs The file system object to revert snapshot for
- # @param snapshot The snapshot file to revert back too
- # @param files The specific files to revert
+ # @param fs The file system object to restore snapshot for
+ # @param snapshot The snapshot file to restore back too
+ # @param files The specific files to restore
# @param restore_files Individual files to restore
- # @param all_files Set to True if all files should be reverted
+ # @param all_files Set to True if all files should be restored
# back
# @param flags Reserved for future use, must be zero.
# @return None on success, else job id
@_return_requires(unicode)
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
+ def fs_snapshot_restore(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
"""
WARNING: Destructive!
@@ -1010,14 +1010,14 @@ class Client(INetworkAttachedStorage):
Reverts a file-system or just the specified files from the snapshot.
If a list of files is supplied but the array cannot restore just them
then the operation will fail with an LsmError raised. If files == None
- and all_files = True then all files on the file-system are reverted.
+ and all_files = True then all files on the file-system are restored.
Restore_file if None none must be the same length as files with each
index in each list referring to the associated file.
Returns None on success, else job id, LsmError exception on error
"""
- return self._tp.rpc('fs_snapshot_revert', _del_self(locals()))
+ return self._tp.rpc('fs_snapshot_restore', _del_self(locals()))
## Checks to see if a file system has child dependencies.
# @param fs The file system to check
diff --git a/python_binding/lsm/_cmdline.py b/python_binding/lsm/_cmdline.py
index c1f7e64..f5d5932 100644
--- a/python_binding/lsm/_cmdline.py
+++ b/python_binding/lsm/_cmdline.py
@@ -1213,7 +1213,7 @@ class CmdLine:
if self.confirm_prompt(True):
self._wait_for_it(
'fs-snap-restore',
- self.c.fs_snapshot_revert(
+ self.c.fs_snapshot_restore(
fs, ss, self.args.file, self.args.fileas, flag_all_files),
None)
diff --git a/python_binding/lsm/_iplugin.py b/python_binding/lsm/_iplugin.py
index 143146a..92cd6ae 100644
--- a/python_binding/lsm/_iplugin.py
+++ b/python_binding/lsm/_iplugin.py
@@ -497,7 +497,7 @@ class INetworkAttachedStorage(IPlugin):
"""
raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
+ def fs_snapshot_restore(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
"""
WARNING: Destructive!
@@ -506,7 +506,7 @@ class INetworkAttachedStorage(IPlugin):
If a list of files is supplied but the array cannot restore just them
then the operation will fail with an LsmError raised.
If files == None and all_files = True then all files on the
- file-system are reverted.
+ file-system are restored.
Restore_file if not None must be the same length as files with each
index in each list referring to the associated file.
diff --git a/test/plugin_test.py b/test/plugin_test.py
index 005048a..139b1d4 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -114,7 +114,7 @@ class TestProxy(object):
'fs_file_clone': (unicode,),
'fs_snapshot_create': (unicode, lsm.FsSnapshot),
'fs_snapshot_delete': (unicode,),
- 'fs_snapshot_revert': (unicode,),
+ 'fs_snapshot_restore': (unicode,),
'fs_child_dependency_rm': (unicode,)}
## The constructor.
diff --git a/test/tester.c b/test/tester.c
index 4a20b88..aa67460 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -944,9 +944,9 @@ START_TEST(test_ss)
fail_unless( LSM_ERR_OK == rc, "lsmStringListElemSet rc = %d", rc);
}
- rc = lsm_fs_ss_revert(c, fs, ss, files, files, 0, &job, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, fs, ss, files, files, 0, &job, LSM_FLAG_RSVD);
if( LSM_ERR_JOB_STARTED == rc ) {
- printf("Waiting for lsmSsRevert!\n");
+ printf("Waiting for lsm_fs_ss_restore!\n");
wait_for_job(c, &job);
} else {
fail_unless(LSM_ERR_OK == rc);
@@ -1721,19 +1721,19 @@ START_TEST(test_invalid_input)
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
- rc = lsm_fs_ss_revert(c, NULL, NULL, NULL, NULL, 0, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, NULL, NULL, NULL, NULL, 0, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_FS, "rc = %d", rc);
- rc = lsm_fs_ss_revert(c, arg_fs, NULL, NULL, NULL, 0, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, arg_fs, NULL, NULL, NULL, 0, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_SS, "rc = %d", rc);
- rc = lsm_fs_ss_revert(c, arg_fs, arg_ss, badf, NULL, 0, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, badf, NULL, 0, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_SL, "rc = %d", rc);
- rc = lsm_fs_ss_revert(c, arg_fs, arg_ss, badf, badf, 0, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, badf, badf, 0, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_SL, "rc = %d", rc);
- rc = lsm_fs_ss_revert(c, arg_fs, arg_ss, f, f, 0, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, f, f, 0, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
rc = lsm_nfs_list(c, NULL, NULL, LSM_FLAG_RSVD);
--
1.8.2.1