Tony Asleson
2014-07-17 18:35:30 UTC
Back in May we decided that we should remove this parameter.
I thought we had already did it, but we hadn't.
V2: Removed some references to capability constant that no
longer exists.
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 3 +--
.../include/libstoragemgmt/libstoragemgmt_capabilities.h | 1 -
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 6 +++---
c_binding/lsm_mgmt.cpp | 10 +---------
c_binding/lsm_plugin_ipc.cpp | 9 ++-------
plugin/nstor/nstor.py | 4 ++--
plugin/ontap/ontap.py | 2 +-
plugin/sim/simarray.py | 13 +++++--------
plugin/sim/simulator.py | 4 ++--
plugin/simc/simc_lsmplugin.c | 5 ++---
plugin/targetd/targetd.py | 2 +-
python_binding/lsm/_client.py | 11 ++---------
python_binding/lsm/_data.py | 1 -
python_binding/lsm/_iplugin.py | 10 ++--------
test/plugin_test.py | 2 +-
test/tester.c | 16 +++++-----------
tools/lsmcli/cmdline.py | 10 +---------
17 files changed, 31 insertions(+), 78 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index 6c68c3d..53f6e7d 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -798,7 +798,6 @@ extern "C" {
* @param[in] c Valid connection
* @param[in] fs File system to snapshot
* @param[in] name Name of snap shot
- * @param[in] files List of file names to snapshot (null OK)
* @param[out] snapshot Snapshot that was created
* @param[out] job Job id if the operation is async.
* @param[in] flags Reserved for future use, must be zero.
@@ -806,7 +805,7 @@ extern "C" {
* else error code
*/
int LSM_DLL_EXPORT lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
+ const char *name,
lsm_fs_ss **snapshot, char **job,
lsm_flag flags);
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h b/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
index f8740f9..c0c6d24 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
@@ -85,7 +85,6 @@ typedef enum {
LSM_CAP_FILE_CLONE = 105, /**< Clone a file on a file system */
LSM_CAP_FS_SNAPSHOTS = 106, /**< List FS snapshots */
LSM_CAP_FS_SNAPSHOT_CREATE = 107, /**< Create a snapshot */
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES = 108, /**< Create snapshots for one or more specific files */
LSM_CAP_FS_SNAPSHOT_DELETE = 109, /**< Delete a snapshot */
LSM_CAP_FS_SNAPSHOT_REVERT = 110, /**< Revert the state of a FS to the specified snapshot */
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES = 111, /**< Revert the state of a list of files to a specified snapshot */
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 1e9fe99..9c206ee 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -727,14 +727,14 @@ typedef int (*lsm_plug_fs_ss_list)(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss **ss[
* @param[in] c Valid lsm plug-in pointer
* @param[in] fs File system to create snapshot for
* @param[in] name Snap shot name
- * @param[in] files Optional list of files to specifically snapshot
* @param[out] snapshot Newly created snapshot
* @param[out] job Job ID
* @return LSM_ERR_OK, else error reason
*/
typedef int (*lsm_plug_fs_ss_create)(lsm_plugin_ptr c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
- lsm_fs_ss **snapshot, char **job, lsm_flag flags);
+ const char *name,
+ lsm_fs_ss **snapshot, char **job,
+ lsm_flag flags);
/**
* Delete a fs snapshot, callback function signature, callback function
* signature
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index c57263a..af20a02 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -2132,8 +2132,7 @@ int lsm_fs_ss_list(lsm_connect *c, lsm_fs *fs, lsm_fs_ss **ss[],
}
-int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
- lsm_string_list *files, lsm_fs_ss **snapshot, char **job,
+int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name, lsm_fs_ss **snapshot, char **job,
lsm_flag flags)
{
CONN_SETUP(c);
@@ -2142,12 +2141,6 @@ int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
return LSM_ERR_INVALID_FS;
}
- if( files ) {
- if( !LSM_IS_STRING_LIST(files) ) {
- return LSM_ERR_INVALID_SL;
- }
- }
-
if( CHECK_STR(name) || CHECK_RP(snapshot) || CHECK_RP(job) || LSM_FLAG_UNUSED_CHECK(flags) ) {
return LSM_ERR_INVALID_ARGUMENT;
}
@@ -2155,7 +2148,6 @@ int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
std::map<std::string, Value> p;
p["fs"] = fs_to_value(fs);
p["snapshot_name"] = Value(name);
- p["files"] = string_list_to_value(files);
p["flags"] = Value(flags);
Value parameters(p);
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 57c4c9b..5e10647 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1902,23 +1902,19 @@ static int ss_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
Value v_fs = params["fs"];
Value v_ss_name = params["snapshot_name"];
- Value v_files = params["files"];
if( Value::object_t == v_fs.valueType() &&
Value::string_t == v_ss_name.valueType() &&
- Value::array_t == v_files.valueType() &&
LSM_FLAG_EXPECTED_TYPE(params) ) {
-
lsm_fs *fs = value_to_fs(v_fs);
- lsm_string_list *files = value_to_string_list(v_files);
- if( fs && files ) {
+ if( fs ) {
lsm_fs_ss *ss = NULL;
char *job = NULL;
const char *name = v_ss_name.asC_str();
- rc = p->fs_ops->fs_ss_create(p, fs, name, files, &ss, &job,
+ rc = p->fs_ops->fs_ss_create(p, fs, name, &ss, &job,
LSM_FLAG_GET_VALUE(params));
std::vector<Value> r;
@@ -1939,7 +1935,6 @@ static int ss_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
}
lsm_fs_record_free(fs);
- lsm_string_list_free(files);
} else {
rc = LSM_ERR_TRANSPORT_INVALID_ARG;
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index c05c2de..a3a8962 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -196,7 +196,7 @@ class NexentaStor(INfs, IStorageAreaNetwork):
return snapshots
@handle_nstor_errors
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
full_name = "%s@%s" % (fs.name, snapshot_name)
self._request("create", "snapshot", [full_name, "0"])
@@ -316,7 +316,7 @@ class NexentaStor(INfs, IStorageAreaNetwork):
# User did not supply a snapshot, so we will create one for them
name = src_fs.name.split('/')[0]
snapshot = self.fs_snapshot_create(
- src_fs, name + "_clone_ss_" + md5(time.ctime()), None)[1]
+ src_fs, name + "_clone_ss_" + md5(time.ctime()))[1]
self._request("clone", "folder", [snapshot.name, dest])
pool_id = NexentaStor._get_pool_id(dest)
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index 9fa6206..00722ff 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -875,7 +875,7 @@ class Ontap(IStorageAreaNetwork, INfs):
return [Ontap._ss(s) for s in snapshots]
@handle_ontap_errors
- def fs_snapshot_create(self, fs, snapshot_name, files=None, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
#We can't do files, so we will do them all
snap = self.f.snapshot_create(fs.name, snapshot_name)
return None, Ontap._ss(snap)
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 20058d9..888858e 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -288,9 +288,8 @@ class SimArray(object):
sim_snaps = self.data.fs_snapshots(fs_id, flags)
return [SimArray._sim_snap_2_lsm(s) for s in sim_snaps]
- def fs_snapshot_create(self, fs_id, snap_name, files, flags=0):
- sim_snap = self.data.fs_snapshot_create(fs_id, snap_name, files,
- flags)
+ def fs_snapshot_create(self, fs_id, snap_name, flags=0):
+ sim_snap = self.data.fs_snapshot_create(fs_id, snap_name, flags)
return self.data.job_create(SimArray._sim_snap_2_lsm(sim_snap))
def fs_snapshot_delete(self, fs_id, snap_id, flags=0):
@@ -1252,7 +1251,7 @@ class SimData(object):
rc.extend([self.snap_dict[snap_id]])
return rc
- def fs_snapshot_create(self, fs_id, snap_name, files, flags=0):
+ def fs_snapshot_create(self, fs_id, snap_name, flags=0):
if fs_id not in self.fs_dict.keys():
raise LsmError(ErrorNumber.NOT_FOUND_FS,
"File System: %s not found" % fs_id)
@@ -1263,10 +1262,8 @@ class SimData(object):
sim_snap = dict()
sim_snap['snap_id'] = snap_id
sim_snap['name'] = snap_name
- if files is None:
- sim_snap['files'] = []
- else:
- sim_snap['files'] = files
+ sim_snap['files'] = []
+
sim_snap['timestamp'] = time.time()
self.snap_dict[snap_id] = sim_snap
self.fs_dict[fs_id]['snaps'].extend([snap_id])
diff --git a/plugin/sim/simulator.py b/plugin/sim/simulator.py
index cf03a0a..fd866ce 100644
--- a/plugin/sim/simulator.py
+++ b/plugin/sim/simulator.py
@@ -265,9 +265,9 @@ class SimPlugin(INfs, IStorageAreaNetwork):
sim_snaps = self.sim_array.fs_snapshots(fs.id, flags)
return [SimPlugin._sim_data_2_lsm(s) for s in sim_snaps]
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
return self.sim_array.fs_snapshot_create(
- fs.id, snapshot_name, files, flags)
+ fs.id, snapshot_name, flags)
def fs_snapshot_delete(self, fs, snapshot, flags=0):
return self.sim_array.fs_snapshot_delete(
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 73a319c..08c5c54 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -334,7 +334,7 @@ static int cap(lsm_plugin_ptr c, lsm_system *system,
*cap = lsm_capability_record_alloc(NULL);
if( *cap ) {
- rc = lsm_capability_set_n(*cap, LSM_CAPABILITY_SUPPORTED, 47,
+ rc = lsm_capability_set_n(*cap, LSM_CAPABILITY_SUPPORTED, 46,
LSM_CAP_BLOCK_SUPPORT,
LSM_CAP_FS_SUPPORT,
LSM_CAP_VOLUMES,
@@ -371,7 +371,6 @@ static int cap(lsm_plugin_ptr c, lsm_system *system,
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
@@ -1865,7 +1864,7 @@ static int ss_list(lsm_plugin_ptr c, lsm_fs * fs, lsm_fs_ss **ss[],
}
static int ss_create(lsm_plugin_ptr c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
+ const char *name,
lsm_fs_ss **snapshot, char **job,
lsm_flag flags)
{
diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index e58a67e..fc19f3c 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
@@ -386,7 +386,7 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return rc
@handle_errors
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
self._jsonrequest("fs_snapshot", dict(fs_uuid=fs.id,
dest_ss_name=snapshot_name))
diff --git a/python_binding/lsm/_client.py b/python_binding/lsm/_client.py
index b975540..8591285 100644
--- a/python_binding/lsm/_client.py
+++ b/python_binding/lsm/_client.py
@@ -880,21 +880,14 @@ class Client(INetworkAttachedStorage):
# @param self The this pointer
# @param fs The file system to snapshot
# @param snapshot_name The human readable snapshot name
- # @param files The list of specific files to snapshot.
# @param flags Reserved for future use, must be zero.
# @returns tuple (job_id, snapshot)
@_return_requires(unicode, FsSnapshot)
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
"""
Snapshot is a point in time read-only copy
- Create a snapshot on the chosen file system with a supplied name for
- each of the files. Passing None implies snapping all files on the file
- system. When files is non-none it implies snap shooting those file.
- NOTE: Some arrays only support snapshots at the file system level. In
- this case it will not be considered an error if file names are passed.
- In these cases the file names are effectively discarded as all files
- are done.
+ Create a snapshot on the chosen file system.
Returns a tuple (job_id, snapshot)
Notes:
diff --git a/python_binding/lsm/_data.py b/python_binding/lsm/_data.py
index 6577683..8fd42a3 100644
--- a/python_binding/lsm/_data.py
+++ b/python_binding/lsm/_data.py
@@ -797,7 +797,6 @@ class Capabilities(IData):
FILE_CLONE = 105
FS_SNAPSHOTS = 106
FS_SNAPSHOT_CREATE = 107
- FS_SNAPSHOT_CREATE_SPECIFIC_FILES = 108
FS_SNAPSHOT_DELETE = 109
FS_SNAPSHOT_REVERT = 110
FS_SNAPSHOT_REVERT_SPECIFIC_FILES = 111
diff --git a/python_binding/lsm/_iplugin.py b/python_binding/lsm/_iplugin.py
index da8e8d4..9e0af9e 100644
--- a/python_binding/lsm/_iplugin.py
+++ b/python_binding/lsm/_iplugin.py
@@ -423,17 +423,11 @@ class INetworkAttachedStorage(IPlugin):
"""
raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
"""
Snapshot is a point in time read-only copy
- Create a snapshot on the chosen file system with a supplied name for
- each of the files. Passing None implies snapping all files on the file
- system. When files is non-none it implies snap shoting those file.
- NOTE: Some arrays only support snapshots at the file system level. In
- this case it will not be considered an error if file names are passed.
- In these cases the file names are effectively discarded as all files
- are done.
+ Create a snapshot on the chosen file system
Returns a tuple (job_id, snap shot created)
Note: Tuple return values are mutually exclusive, when one
diff --git a/test/plugin_test.py b/test/plugin_test.py
index dcd7cd6..0731e25 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -548,7 +548,7 @@ class TestPlugin(unittest.TestCase):
fs = self._fs_create(s.id)[0]
- ss = self.c.fs_snapshot_create(fs, rs('fs_snapshot'), None)[1]
+ ss = self.c.fs_snapshot_create(fs, rs('fs_snapshot'))[1]
self.assertTrue(self._fs_snapshot_exists(fs, ss.id))
# Delete snapshot
diff --git a/test/tester.c b/test/tester.c
index cb89201..526279c 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -921,7 +921,7 @@ START_TEST(test_ss)
fail_unless( 0 == ss_count );
- rc = lsm_fs_ss_create(c, fs, "test_snap", NULL, &ss, &job, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, fs, "test_snap", &ss, &job, LSM_FLAG_RSVD);
if( LSM_ERR_JOB_STARTED == rc ) {
printf("Waiting for snap to create!\n");
ss = wait_for_job_ss(c, &job);
@@ -1682,18 +1682,15 @@ START_TEST(test_invalid_input)
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, NULL, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_FS, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, arg_fs, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, arg_fs, NULL, NULL, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
lsm_fs_ss *arg_ss = NULL;
- rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", badf, &arg_ss, &job,
- LSM_FLAG_RSVD);
- fail_unless(rc == LSM_ERR_INVALID_SL, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", NULL, &arg_ss, &job,
+ rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", &arg_ss, &job,
LSM_FLAG_RSVD);
if( LSM_ERR_JOB_STARTED == rc ) {
@@ -1898,7 +1895,6 @@ START_TEST(test_capabilities)
cap_test(cap, LSM_CAP_FILE_CLONE);
cap_test(cap, LSM_CAP_FS_SNAPSHOTS);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_CREATE);
- cap_test(cap, LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_DELETE);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_REVERT);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES);
@@ -2082,7 +2078,6 @@ START_TEST(test_capability)
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
@@ -2124,7 +2119,7 @@ START_TEST(test_capability)
fail_unless(cap != NULL);
if( cap ) {
- G(rc, lsm_capability_set_n, cap, LSM_CAPABILITY_SUPPORTED, 47,
+ G(rc, lsm_capability_set_n, cap, LSM_CAPABILITY_SUPPORTED, 46,
LSM_CAP_BLOCK_SUPPORT,
LSM_CAP_FS_SUPPORT,
LSM_CAP_VOLUMES,
@@ -2161,7 +2156,6 @@ START_TEST(test_capability)
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
diff --git a/tools/lsmcli/cmdline.py b/tools/lsmcli/cmdline.py
index c324e63..4e47cd7 100644
--- a/tools/lsmcli/cmdline.py
+++ b/tools/lsmcli/cmdline.py
@@ -516,13 +516,6 @@ cmds = (
help='The human friendly name of new snapshot'),
dict(fs_id_opt),
],
- optional=[
- dict(name="--file", metavar="<FILE_PATH>",
- help="Only create snapshot for provided file\n"
- "Without this argument, all files will be snapshotted\n"
- "This is a repeatable argument.",
- action='append', default=[]),
- ],
),
dict(
@@ -1208,8 +1201,7 @@ class CmdLine:
ss = self._wait_for_it("snapshot-create",
*self.c.fs_snapshot_create(
fs,
- args.name,
- self.args.file))
+ args.name))
self.display_data([ss])
I thought we had already did it, but we hadn't.
V2: Removed some references to capability constant that no
longer exists.
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 3 +--
.../include/libstoragemgmt/libstoragemgmt_capabilities.h | 1 -
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 6 +++---
c_binding/lsm_mgmt.cpp | 10 +---------
c_binding/lsm_plugin_ipc.cpp | 9 ++-------
plugin/nstor/nstor.py | 4 ++--
plugin/ontap/ontap.py | 2 +-
plugin/sim/simarray.py | 13 +++++--------
plugin/sim/simulator.py | 4 ++--
plugin/simc/simc_lsmplugin.c | 5 ++---
plugin/targetd/targetd.py | 2 +-
python_binding/lsm/_client.py | 11 ++---------
python_binding/lsm/_data.py | 1 -
python_binding/lsm/_iplugin.py | 10 ++--------
test/plugin_test.py | 2 +-
test/tester.c | 16 +++++-----------
tools/lsmcli/cmdline.py | 10 +---------
17 files changed, 31 insertions(+), 78 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index 6c68c3d..53f6e7d 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -798,7 +798,6 @@ extern "C" {
* @param[in] c Valid connection
* @param[in] fs File system to snapshot
* @param[in] name Name of snap shot
- * @param[in] files List of file names to snapshot (null OK)
* @param[out] snapshot Snapshot that was created
* @param[out] job Job id if the operation is async.
* @param[in] flags Reserved for future use, must be zero.
@@ -806,7 +805,7 @@ extern "C" {
* else error code
*/
int LSM_DLL_EXPORT lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
+ const char *name,
lsm_fs_ss **snapshot, char **job,
lsm_flag flags);
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h b/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
index f8740f9..c0c6d24 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_capabilities.h
@@ -85,7 +85,6 @@ typedef enum {
LSM_CAP_FILE_CLONE = 105, /**< Clone a file on a file system */
LSM_CAP_FS_SNAPSHOTS = 106, /**< List FS snapshots */
LSM_CAP_FS_SNAPSHOT_CREATE = 107, /**< Create a snapshot */
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES = 108, /**< Create snapshots for one or more specific files */
LSM_CAP_FS_SNAPSHOT_DELETE = 109, /**< Delete a snapshot */
LSM_CAP_FS_SNAPSHOT_REVERT = 110, /**< Revert the state of a FS to the specified snapshot */
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES = 111, /**< Revert the state of a list of files to a specified snapshot */
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 1e9fe99..9c206ee 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -727,14 +727,14 @@ typedef int (*lsm_plug_fs_ss_list)(lsm_plugin_ptr c, lsm_fs *fs, lsm_fs_ss **ss[
* @param[in] c Valid lsm plug-in pointer
* @param[in] fs File system to create snapshot for
* @param[in] name Snap shot name
- * @param[in] files Optional list of files to specifically snapshot
* @param[out] snapshot Newly created snapshot
* @param[out] job Job ID
* @return LSM_ERR_OK, else error reason
*/
typedef int (*lsm_plug_fs_ss_create)(lsm_plugin_ptr c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
- lsm_fs_ss **snapshot, char **job, lsm_flag flags);
+ const char *name,
+ lsm_fs_ss **snapshot, char **job,
+ lsm_flag flags);
/**
* Delete a fs snapshot, callback function signature, callback function
* signature
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index c57263a..af20a02 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -2132,8 +2132,7 @@ int lsm_fs_ss_list(lsm_connect *c, lsm_fs *fs, lsm_fs_ss **ss[],
}
-int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
- lsm_string_list *files, lsm_fs_ss **snapshot, char **job,
+int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name, lsm_fs_ss **snapshot, char **job,
lsm_flag flags)
{
CONN_SETUP(c);
@@ -2142,12 +2141,6 @@ int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
return LSM_ERR_INVALID_FS;
}
- if( files ) {
- if( !LSM_IS_STRING_LIST(files) ) {
- return LSM_ERR_INVALID_SL;
- }
- }
-
if( CHECK_STR(name) || CHECK_RP(snapshot) || CHECK_RP(job) || LSM_FLAG_UNUSED_CHECK(flags) ) {
return LSM_ERR_INVALID_ARGUMENT;
}
@@ -2155,7 +2148,6 @@ int lsm_fs_ss_create(lsm_connect *c, lsm_fs *fs, const char *name,
std::map<std::string, Value> p;
p["fs"] = fs_to_value(fs);
p["snapshot_name"] = Value(name);
- p["files"] = string_list_to_value(files);
p["flags"] = Value(flags);
Value parameters(p);
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 57c4c9b..5e10647 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1902,23 +1902,19 @@ static int ss_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
Value v_fs = params["fs"];
Value v_ss_name = params["snapshot_name"];
- Value v_files = params["files"];
if( Value::object_t == v_fs.valueType() &&
Value::string_t == v_ss_name.valueType() &&
- Value::array_t == v_files.valueType() &&
LSM_FLAG_EXPECTED_TYPE(params) ) {
-
lsm_fs *fs = value_to_fs(v_fs);
- lsm_string_list *files = value_to_string_list(v_files);
- if( fs && files ) {
+ if( fs ) {
lsm_fs_ss *ss = NULL;
char *job = NULL;
const char *name = v_ss_name.asC_str();
- rc = p->fs_ops->fs_ss_create(p, fs, name, files, &ss, &job,
+ rc = p->fs_ops->fs_ss_create(p, fs, name, &ss, &job,
LSM_FLAG_GET_VALUE(params));
std::vector<Value> r;
@@ -1939,7 +1935,6 @@ static int ss_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
}
lsm_fs_record_free(fs);
- lsm_string_list_free(files);
} else {
rc = LSM_ERR_TRANSPORT_INVALID_ARG;
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index c05c2de..a3a8962 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -196,7 +196,7 @@ class NexentaStor(INfs, IStorageAreaNetwork):
return snapshots
@handle_nstor_errors
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
full_name = "%s@%s" % (fs.name, snapshot_name)
self._request("create", "snapshot", [full_name, "0"])
@@ -316,7 +316,7 @@ class NexentaStor(INfs, IStorageAreaNetwork):
# User did not supply a snapshot, so we will create one for them
name = src_fs.name.split('/')[0]
snapshot = self.fs_snapshot_create(
- src_fs, name + "_clone_ss_" + md5(time.ctime()), None)[1]
+ src_fs, name + "_clone_ss_" + md5(time.ctime()))[1]
self._request("clone", "folder", [snapshot.name, dest])
pool_id = NexentaStor._get_pool_id(dest)
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index 9fa6206..00722ff 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -875,7 +875,7 @@ class Ontap(IStorageAreaNetwork, INfs):
return [Ontap._ss(s) for s in snapshots]
@handle_ontap_errors
- def fs_snapshot_create(self, fs, snapshot_name, files=None, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
#We can't do files, so we will do them all
snap = self.f.snapshot_create(fs.name, snapshot_name)
return None, Ontap._ss(snap)
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 20058d9..888858e 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -288,9 +288,8 @@ class SimArray(object):
sim_snaps = self.data.fs_snapshots(fs_id, flags)
return [SimArray._sim_snap_2_lsm(s) for s in sim_snaps]
- def fs_snapshot_create(self, fs_id, snap_name, files, flags=0):
- sim_snap = self.data.fs_snapshot_create(fs_id, snap_name, files,
- flags)
+ def fs_snapshot_create(self, fs_id, snap_name, flags=0):
+ sim_snap = self.data.fs_snapshot_create(fs_id, snap_name, flags)
return self.data.job_create(SimArray._sim_snap_2_lsm(sim_snap))
def fs_snapshot_delete(self, fs_id, snap_id, flags=0):
@@ -1252,7 +1251,7 @@ class SimData(object):
rc.extend([self.snap_dict[snap_id]])
return rc
- def fs_snapshot_create(self, fs_id, snap_name, files, flags=0):
+ def fs_snapshot_create(self, fs_id, snap_name, flags=0):
if fs_id not in self.fs_dict.keys():
raise LsmError(ErrorNumber.NOT_FOUND_FS,
"File System: %s not found" % fs_id)
@@ -1263,10 +1262,8 @@ class SimData(object):
sim_snap = dict()
sim_snap['snap_id'] = snap_id
sim_snap['name'] = snap_name
- if files is None:
- sim_snap['files'] = []
- else:
- sim_snap['files'] = files
+ sim_snap['files'] = []
+
sim_snap['timestamp'] = time.time()
self.snap_dict[snap_id] = sim_snap
self.fs_dict[fs_id]['snaps'].extend([snap_id])
diff --git a/plugin/sim/simulator.py b/plugin/sim/simulator.py
index cf03a0a..fd866ce 100644
--- a/plugin/sim/simulator.py
+++ b/plugin/sim/simulator.py
@@ -265,9 +265,9 @@ class SimPlugin(INfs, IStorageAreaNetwork):
sim_snaps = self.sim_array.fs_snapshots(fs.id, flags)
return [SimPlugin._sim_data_2_lsm(s) for s in sim_snaps]
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
return self.sim_array.fs_snapshot_create(
- fs.id, snapshot_name, files, flags)
+ fs.id, snapshot_name, flags)
def fs_snapshot_delete(self, fs, snapshot, flags=0):
return self.sim_array.fs_snapshot_delete(
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 73a319c..08c5c54 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -334,7 +334,7 @@ static int cap(lsm_plugin_ptr c, lsm_system *system,
*cap = lsm_capability_record_alloc(NULL);
if( *cap ) {
- rc = lsm_capability_set_n(*cap, LSM_CAPABILITY_SUPPORTED, 47,
+ rc = lsm_capability_set_n(*cap, LSM_CAPABILITY_SUPPORTED, 46,
LSM_CAP_BLOCK_SUPPORT,
LSM_CAP_FS_SUPPORT,
LSM_CAP_VOLUMES,
@@ -371,7 +371,6 @@ static int cap(lsm_plugin_ptr c, lsm_system *system,
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
@@ -1865,7 +1864,7 @@ static int ss_list(lsm_plugin_ptr c, lsm_fs * fs, lsm_fs_ss **ss[],
}
static int ss_create(lsm_plugin_ptr c, lsm_fs *fs,
- const char *name, lsm_string_list *files,
+ const char *name,
lsm_fs_ss **snapshot, char **job,
lsm_flag flags)
{
diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index e58a67e..fc19f3c 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
@@ -386,7 +386,7 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return rc
@handle_errors
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
self._jsonrequest("fs_snapshot", dict(fs_uuid=fs.id,
dest_ss_name=snapshot_name))
diff --git a/python_binding/lsm/_client.py b/python_binding/lsm/_client.py
index b975540..8591285 100644
--- a/python_binding/lsm/_client.py
+++ b/python_binding/lsm/_client.py
@@ -880,21 +880,14 @@ class Client(INetworkAttachedStorage):
# @param self The this pointer
# @param fs The file system to snapshot
# @param snapshot_name The human readable snapshot name
- # @param files The list of specific files to snapshot.
# @param flags Reserved for future use, must be zero.
# @returns tuple (job_id, snapshot)
@_return_requires(unicode, FsSnapshot)
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
"""
Snapshot is a point in time read-only copy
- Create a snapshot on the chosen file system with a supplied name for
- each of the files. Passing None implies snapping all files on the file
- system. When files is non-none it implies snap shooting those file.
- NOTE: Some arrays only support snapshots at the file system level. In
- this case it will not be considered an error if file names are passed.
- In these cases the file names are effectively discarded as all files
- are done.
+ Create a snapshot on the chosen file system.
Returns a tuple (job_id, snapshot)
Notes:
diff --git a/python_binding/lsm/_data.py b/python_binding/lsm/_data.py
index 6577683..8fd42a3 100644
--- a/python_binding/lsm/_data.py
+++ b/python_binding/lsm/_data.py
@@ -797,7 +797,6 @@ class Capabilities(IData):
FILE_CLONE = 105
FS_SNAPSHOTS = 106
FS_SNAPSHOT_CREATE = 107
- FS_SNAPSHOT_CREATE_SPECIFIC_FILES = 108
FS_SNAPSHOT_DELETE = 109
FS_SNAPSHOT_REVERT = 110
FS_SNAPSHOT_REVERT_SPECIFIC_FILES = 111
diff --git a/python_binding/lsm/_iplugin.py b/python_binding/lsm/_iplugin.py
index da8e8d4..9e0af9e 100644
--- a/python_binding/lsm/_iplugin.py
+++ b/python_binding/lsm/_iplugin.py
@@ -423,17 +423,11 @@ class INetworkAttachedStorage(IPlugin):
"""
raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
+ def fs_snapshot_create(self, fs, snapshot_name, flags=0):
"""
Snapshot is a point in time read-only copy
- Create a snapshot on the chosen file system with a supplied name for
- each of the files. Passing None implies snapping all files on the file
- system. When files is non-none it implies snap shoting those file.
- NOTE: Some arrays only support snapshots at the file system level. In
- this case it will not be considered an error if file names are passed.
- In these cases the file names are effectively discarded as all files
- are done.
+ Create a snapshot on the chosen file system
Returns a tuple (job_id, snap shot created)
Note: Tuple return values are mutually exclusive, when one
diff --git a/test/plugin_test.py b/test/plugin_test.py
index dcd7cd6..0731e25 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -548,7 +548,7 @@ class TestPlugin(unittest.TestCase):
fs = self._fs_create(s.id)[0]
- ss = self.c.fs_snapshot_create(fs, rs('fs_snapshot'), None)[1]
+ ss = self.c.fs_snapshot_create(fs, rs('fs_snapshot'))[1]
self.assertTrue(self._fs_snapshot_exists(fs, ss.id))
# Delete snapshot
diff --git a/test/tester.c b/test/tester.c
index cb89201..526279c 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -921,7 +921,7 @@ START_TEST(test_ss)
fail_unless( 0 == ss_count );
- rc = lsm_fs_ss_create(c, fs, "test_snap", NULL, &ss, &job, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, fs, "test_snap", &ss, &job, LSM_FLAG_RSVD);
if( LSM_ERR_JOB_STARTED == rc ) {
printf("Waiting for snap to create!\n");
ss = wait_for_job_ss(c, &job);
@@ -1682,18 +1682,15 @@ START_TEST(test_invalid_input)
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, NULL, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_FS, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, arg_fs, NULL, NULL, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_fs_ss_create(c, arg_fs, NULL, NULL, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
lsm_fs_ss *arg_ss = NULL;
- rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", badf, &arg_ss, &job,
- LSM_FLAG_RSVD);
- fail_unless(rc == LSM_ERR_INVALID_SL, "rc = %d", rc);
- rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", NULL, &arg_ss, &job,
+ rc = lsm_fs_ss_create(c, arg_fs, "arg_snapshot", &arg_ss, &job,
LSM_FLAG_RSVD);
if( LSM_ERR_JOB_STARTED == rc ) {
@@ -1898,7 +1895,6 @@ START_TEST(test_capabilities)
cap_test(cap, LSM_CAP_FILE_CLONE);
cap_test(cap, LSM_CAP_FS_SNAPSHOTS);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_CREATE);
- cap_test(cap, LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_DELETE);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_REVERT);
cap_test(cap, LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES);
@@ -2082,7 +2078,6 @@ START_TEST(test_capability)
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
@@ -2124,7 +2119,7 @@ START_TEST(test_capability)
fail_unless(cap != NULL);
if( cap ) {
- G(rc, lsm_capability_set_n, cap, LSM_CAPABILITY_SUPPORTED, 47,
+ G(rc, lsm_capability_set_n, cap, LSM_CAPABILITY_SUPPORTED, 46,
LSM_CAP_BLOCK_SUPPORT,
LSM_CAP_FS_SUPPORT,
LSM_CAP_VOLUMES,
@@ -2161,7 +2156,6 @@ START_TEST(test_capability)
LSM_CAP_FILE_CLONE,
LSM_CAP_FS_SNAPSHOTS,
LSM_CAP_FS_SNAPSHOT_CREATE,
- LSM_CAP_FS_SNAPSHOT_CREATE_SPECIFIC_FILES,
LSM_CAP_FS_SNAPSHOT_DELETE,
LSM_CAP_FS_SNAPSHOT_REVERT,
LSM_CAP_FS_SNAPSHOT_REVERT_SPECIFIC_FILES,
diff --git a/tools/lsmcli/cmdline.py b/tools/lsmcli/cmdline.py
index c324e63..4e47cd7 100644
--- a/tools/lsmcli/cmdline.py
+++ b/tools/lsmcli/cmdline.py
@@ -516,13 +516,6 @@ cmds = (
help='The human friendly name of new snapshot'),
dict(fs_id_opt),
],
- optional=[
- dict(name="--file", metavar="<FILE_PATH>",
- help="Only create snapshot for provided file\n"
- "Without this argument, all files will be snapshotted\n"
- "This is a repeatable argument.",
- action='append', default=[]),
- ],
),
dict(
@@ -1208,8 +1201,7 @@ class CmdLine:
ss = self._wait_for_it("snapshot-create",
*self.c.fs_snapshot_create(
fs,
- args.name,
- self.args.file))
+ args.name))
self.display_data([ss])
--
1.8.2.1
1.8.2.1