C bits for Gris's python patch set
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 4 ++--
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 8 ++++----
c_binding/lsm_mgmt.cpp | 8 ++++----
c_binding/lsm_plugin_ipc.cpp | 20 ++++++++++----------
plugin/simc/simc_lsmplugin.c | 6 +++---
test/tester.c | 10 +++++-----
6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index e87a305..c0ac404 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -373,7 +373,7 @@ extern "C" {
* @param[in] flags Reserved for future use, must be zero.
* @return LSM_ERR_OK on success, else error code
*/
- int LSM_DLL_EXPORT lsm_volume_online(lsm_connect *conn, lsm_volume *volume,
+ int LSM_DLL_EXPORT lsm_volume_enable(lsm_connect *conn, lsm_volume *volume,
lsm_flag flags);
/**
@@ -383,7 +383,7 @@ extern "C" {
* @param[in] flags Reserved for future use, must be zero.
* @return LSM_ERR_OK on success, else error code
*/
- int LSM_DLL_EXPORT lsm_volume_offline(lsm_connect *conn,
+ int LSM_DLL_EXPORT lsm_volume_disable(lsm_connect *conn,
lsm_volume *volume, lsm_flag flags);
/**
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 1fd1593..ba5fa81 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -339,7 +339,7 @@ typedef int (*lsm_plug_volume_status)(lsm_plugin_ptr c, lsm_volume *v,
* @param[in] flags Reserved
* @return LSM_ERR_OK, else error reason
*/
-typedef int (*lsm_plug_volume_online)(lsm_plugin_ptr c, lsm_volume *v,
+typedef int (*lsm_plug_volume_enable)(lsm_plugin_ptr c, lsm_volume *v,
lsm_flag flags);
/**
@@ -349,7 +349,7 @@ typedef int (*lsm_plug_volume_online)(lsm_plugin_ptr c, lsm_volume *v,
* @param flags
* @return LSM_ERR_OK, else error reason
*/
-typedef int (*lsm_plug_volume_offline)(lsm_plugin_ptr c, lsm_volume *v,
+typedef int (*lsm_plug_volume_disable)(lsm_plugin_ptr c, lsm_volume *v,
lsm_flag flags);
/**
@@ -766,8 +766,8 @@ struct lsm_san_ops_v1 {
lsm_plug_volume_replicate_range vol_rep_range; /**< volume replication range */
lsm_plug_volume_resize vol_resize; /**< resizing a volume */
lsm_plug_volume_delete vol_delete; /**< deleting a volume */
- lsm_plug_volume_online vol_online; /**< bringing volume online */
- lsm_plug_volume_offline vol_offline; /**< bringing volume offline */
+ lsm_plug_volume_enable vol_enable; /**< volume is accessible */
+ lsm_plug_volume_disable vol_disable; /**< volume is unaccessible */
lsm_plug_iscsi_chap_auth iscsi_chap_auth; /**< iscsi chap authentication */
lsm_plug_access_group_list ag_list; /**< access groups */
lsm_plug_access_group_create ag_create; /**< access group create */
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index b236549..cb841d4 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -1202,14 +1202,14 @@ static int online_offline(lsm_connect *c, lsm_volume *v,
return rpc(c, operation, parameters, response);
}
-int lsm_volume_online(lsm_connect *c, lsm_volume *volume, lsm_flag flags)
+int lsm_volume_enable(lsm_connect *c, lsm_volume *volume, lsm_flag flags)
{
- return online_offline(c, volume, "volume_online", flags);
+ return online_offline(c, volume, "volume_enable", flags);
}
-int lsm_volume_offline(lsm_connect *c, lsm_volume *volume, lsm_flag flags)
+int lsm_volume_disable(lsm_connect *c, lsm_volume *volume, lsm_flag flags)
{
- return online_offline(c, volume, "volume_offline", flags);
+ return online_offline(c, volume, "volume_disable", flags);
}
int lsm_access_group_list(lsm_connect *c, const char *search_key,
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 24b89ae..8fcca83 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -912,13 +912,13 @@ static int handle_volume_delete(lsm_plugin_ptr p, Value ¶ms, Value &response
return rc;
}
-static int handle_vol_online_offline( lsm_plugin_ptr p, Value ¶ms,
+static int handle_vol_enable_disable( lsm_plugin_ptr p, Value ¶ms,
Value &response, int online)
{
int rc = LSM_ERR_NO_SUPPORT;
if( p && p->san_ops &&
- ((online)? p->san_ops->vol_online : p->san_ops->vol_offline)) {
+ ((online)? p->san_ops->vol_enable : p->san_ops->vol_disable)) {
Value v_vol = params["volume"];
@@ -927,10 +927,10 @@ static int handle_vol_online_offline( lsm_plugin_ptr p, Value ¶ms,
lsm_volume *vol = value_to_volume(v_vol);
if( vol ) {
if( online ) {
- rc = p->san_ops->vol_online(p, vol,
+ rc = p->san_ops->vol_enable(p, vol,
LSM_FLAG_GET_VALUE(params));
} else {
- rc = p->san_ops->vol_offline(p, vol,
+ rc = p->san_ops->vol_disable(p, vol,
LSM_FLAG_GET_VALUE(params));
}
@@ -945,14 +945,14 @@ static int handle_vol_online_offline( lsm_plugin_ptr p, Value ¶ms,
return rc;
}
-static int handle_volume_online(lsm_plugin_ptr p, Value ¶ms, Value &response)
+static int handle_volume_enable(lsm_plugin_ptr p, Value ¶ms, Value &response)
{
- return handle_vol_online_offline(p, params, response, 1);
+ return handle_vol_enable_disable(p, params, response, 1);
}
-static int handle_volume_offline(lsm_plugin_ptr p, Value ¶ms, Value &response)
+static int handle_volume_disable(lsm_plugin_ptr p, Value ¶ms, Value &response)
{
- return handle_vol_online_offline(p, params, response, 0);
+ return handle_vol_enable_disable(p, params, response, 0);
}
static int ag_list(lsm_plugin_ptr p, Value ¶ms, Value &response)
@@ -2140,8 +2140,8 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("volume_child_dependency", volume_dependency)
("volume_create", handle_volume_create)
("volume_delete", handle_volume_delete)
- ("volume_offline", handle_volume_offline)
- ("volume_online", handle_volume_online)
+ ("volume_disable", handle_volume_disable)
+ ("volume_enable", handle_volume_enable)
("volume_replicate", handle_volume_replicate)
("volume_replicate_range_block_size", handle_volume_replicate_range_block_size)
("volume_replicate_range", handle_volume_replicate_range)
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 53fd94b..6b2ddb7 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -925,7 +925,7 @@ static int volume_delete(lsm_plugin_ptr c, lsm_volume *volume,
return rc;
}
-static int volume_online_offline(lsm_plugin_ptr c, lsm_volume *v,
+static int volume_enable_disable(lsm_plugin_ptr c, lsm_volume *v,
lsm_flag flags)
{
int rc = LSM_ERR_OK;
@@ -1424,8 +1424,8 @@ static struct lsm_san_ops_v1 san_ops = {
volume_replicate_range,
volume_resize,
volume_delete,
- volume_online_offline,
- volume_online_offline,
+ volume_enable_disable,
+ volume_enable_disable,
iscsi_chap_auth,
access_group_list,
access_group_create,
diff --git a/test/tester.c b/test/tester.c
index 41219db..f4e19f4 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -516,9 +516,9 @@ START_TEST(test_smoke_test)
G(rc, lsm_block_range_record_array_free, range, 3);
int online = 0;
- G(online, lsm_volume_offline, c, n, LSM_FLAG_RSVD);
+ G(online, lsm_volume_disable, c, n, LSM_FLAG_RSVD);
- G(online, lsm_volume_online, c, n, LSM_FLAG_RSVD);
+ G(online, lsm_volume_enable, c, n, LSM_FLAG_RSVD);
char *jobDel = NULL;
int delRc = lsm_volume_delete(c, n, &jobDel, LSM_FLAG_RSVD);
@@ -548,7 +548,7 @@ START_TEST(test_smoke_test)
lsm_volume_vpd83_get(volumes[i]),
lsm_volume_block_size_get(volumes[i]),
lsm_volume_number_of_blocks_get(volumes[i]),
- lsm_volume_op_status_get(volumes[i]));
+ lsm_volume_admin_state_get(volumes[i]));
}
if( count ) {
@@ -1512,10 +1512,10 @@ START_TEST(test_invalid_input)
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
- rc = lsm_volume_online(c, NULL, LSM_FLAG_RSVD);
+ rc = lsm_volume_enable(c, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
- rc = lsm_volume_offline(c, NULL, LSM_FLAG_RSVD);
+ rc = lsm_volume_disable(c, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
--
1.8.2.1