From 5b1bf2192993c24cd140664140694cae1e757dc5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:28:36 +0000 Subject: import libstoragemgmt-1.1.0-2.el7 --- diff --git a/.gitignore b/.gitignore index d44a375..7deeff6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libstoragemgmt-0.0.24.tar.gz +SOURCES/libstoragemgmt-1.1.0.tar.gz diff --git a/.libstoragemgmt.metadata b/.libstoragemgmt.metadata index 3271478..e3bca57 100644 --- a/.libstoragemgmt.metadata +++ b/.libstoragemgmt.metadata @@ -1 +1 @@ -d3ce509a05f68357891fc018c2330a692c0b0880 SOURCES/libstoragemgmt-0.0.24.tar.gz +0f6165537c8956a2282ce7820a8888ddbba52a5c SOURCES/libstoragemgmt-1.1.0.tar.gz diff --git a/SOURCES/libstoragemgmt-0.0.24-comment_out_ua_udev_rules.patch b/SOURCES/libstoragemgmt-0.0.24-comment_out_ua_udev_rules.patch deleted file mode 100644 index 0ed63a2..0000000 --- a/SOURCES/libstoragemgmt-0.0.24-comment_out_ua_udev_rules.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git tools/udev/90-scsi-ua.rules tools/udev/90-scsi-ua.rules -index 694e29f..193e22c 100644 ---- tools/udev/90-scsi-ua.rules -+++ tools/udev/90-scsi-ua.rules -@@ -1,5 +1,5 @@ --ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="INQUIRY_DATA_HAS_CHANGED", TEST=="rescan", ATTR{rescan}="x" --ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="CAPACITY_DATA_HAS_CHANGED", TEST=="rescan", ATTR{rescan}="x" --ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="THIN_PROVISIONING_SOFT_THRESHOLD_REACHED", TEST=="rescan", ATTR{rescan}="x" --ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="MODE_PARAMETERS_CHANGED", TEST=="rescan", ATTR{rescan}="x" -+#ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="INQUIRY_DATA_HAS_CHANGED", TEST=="rescan", ATTR{rescan}="x" -+#ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="CAPACITY_DATA_HAS_CHANGED", TEST=="rescan", ATTR{rescan}="x" -+#ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="THIN_PROVISIONING_SOFT_THRESHOLD_REACHED", TEST=="rescan", ATTR{rescan}="x" -+#ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="MODE_PARAMETERS_CHANGED", TEST=="rescan", ATTR{rescan}="x" - ACTION=="change", SUBSYSTEM=="scsi", ENV{SDEV_UA}=="REPORTED_LUNS_DATA_HAS_CHANGED", RUN+="scan-scsi-target $env{DEVPATH}" diff --git a/SOURCES/libstoragemgmt-0.0.24-coverity-fix.patch b/SOURCES/libstoragemgmt-0.0.24-coverity-fix.patch deleted file mode 100644 index 287a5aa..0000000 --- a/SOURCES/libstoragemgmt-0.0.24-coverity-fix.patch +++ /dev/null @@ -1,1571 +0,0 @@ -diff --git include/libstoragemgmt/libstoragemgmt_plug_interface.h include/libstoragemgmt/libstoragemgmt_plug_interface.h -index 24c84d0..c0e29a3 100644 ---- include/libstoragemgmt/libstoragemgmt_plug_interface.h -+++ include/libstoragemgmt/libstoragemgmt_plug_interface.h -@@ -1016,6 +1016,7 @@ lsmDisk LSM_DLL_EXPORT **lsmDiskRecordAllocArray( uint32_t size ); - * @param block_count Number of blocks for disk - * @param disk_status Status - * @param op OptionalData can be NULL if not available -+ * NOTE: op gets copied internally - * @param system_id System id this disk resides in - * @return Pointer to allocated disk record or NULL on memory error. - */ -diff --git plugin/simc_lsmplugin.c plugin/simc_lsmplugin.c -index f9c4530..e12c630 100644 ---- plugin/simc_lsmplugin.c -+++ plugin/simc_lsmplugin.c -@@ -567,7 +567,8 @@ static int _list_initiators(lsmPluginPtr c, lsmInitiator **initArray[], - if( init_key && init_val ) { - g_hash_table_insert(tmp_inits, init_key, init_val); - } else { -- g_hash_table_destroy(tmp_inits); -+ free(init_key); -+ lsmInitiatorRecordFree(init_val); - rc = LSM_ERR_NO_MEMORY; - } - } -@@ -652,12 +653,12 @@ static int list_disks(lsmPluginPtr c, lsmDisk **disks[], uint32_t *count, - { - int i; - int rc = LSM_ERR_OK; -- struct plugin_data *pd = (struct plugin_data*)lsmGetPrivateData(c); - char name[17]; - char sn[32]; -+ struct plugin_data *pd = (struct plugin_data*)lsmGetPrivateData(c); - lsmOptionalData *od = lsmOptionalDataRecordAlloc(); - -- if(pd) { -+ if(pd && od) { - // For now we are going to make up some disks to return. Later we will - // try to make a simulated array that makes sense. - *count = 10; -@@ -672,11 +673,12 @@ static int list_disks(lsmPluginPtr c, lsmDisk **disks[], uint32_t *count, - (*disks)[i] = lsmDiskRecordAlloc(md5(name), name, LSM_DISK_TYPE_SOP, 512, - 0x8000000000000, LSM_DISK_STATUS_OK, od, sys_id); - } -- lsmOptionalDataRecordFree(od); -+ - } else { - rc = LSM_ERR_INVALID_PLUGIN; - } - -+ lsmOptionalDataRecordFree(od); - return rc; - } - -@@ -1593,6 +1595,7 @@ static int vol_accessible_by_init(lsmPluginPtr c, - lsmVolumeRecordFreeArray(*volumes, alloc_count); - *count = 0; - *volumes = NULL; -+ break; - } else { - alloc_count += 1; - } -@@ -2220,8 +2223,25 @@ int load( lsmPluginPtr c, xmlURIPtr uri, const char *password, - - if( !data->system[0] || !data->pool[0] || !data->pool[1] || - !data->pool[2] || !data->pool[3] || !data->access_groups || -- !data->group_grant || !data->fs) { -- rc = LSM_ERR_NO_MEMORY; -+ !data->group_grant || !data->fs || !data->jobs ) { -+ rc = LSM_ERR_NO_MEMORY; /* We need to free data and everything else */ -+ -+ if( data->jobs ) -+ g_hash_table_destroy(data->jobs); -+ if( data->fs ) -+ g_hash_table_destroy(data->fs); -+ if( data->group_grant ) -+ g_hash_table_destroy(data->group_grant); -+ if( data->access_groups ) -+ g_hash_table_destroy(data->access_groups); -+ lsmPoolRecordFree(data->pool[3]); -+ lsmPoolRecordFree(data->pool[2]); -+ lsmPoolRecordFree(data->pool[1]); -+ lsmPoolRecordFree(data->pool[0]); -+ lsmSystemRecordFree(data->system[0]); -+ memset(data, 0xAA, sizeof(struct plugin_data)); -+ free(data); -+ data = NULL; - } else { - rc = lsmRegisterPluginV1( c, data, &mgmOps, - &sanOps, &fsOps, &nfsOps); -diff --git src/lsm_convert.cpp src/lsm_convert.cpp -index 54100a5..242efe9 100644 ---- src/lsm_convert.cpp -+++ src/lsm_convert.cpp -@@ -95,6 +95,9 @@ lsmDisk *valueToDisk(Value &disk) - op, - d["system_id"].asString().c_str() - ); -+ -+ /* Optional data gets copied in lsmDiskRecordAlloc */ -+ lsmOptionalDataRecordFree(op); - } - return rc; - } -diff --git src/lsm_daemon.c src/lsm_daemon.c -index 670fb17..04eed85 100644 ---- src/lsm_daemon.c -+++ src/lsm_daemon.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - - #define BASE_DIR "/var/run/lsm" - #define SOCKET_DIR BASE_DIR"/ipc" -@@ -379,7 +380,7 @@ void empty_plugin_list(struct plugin_list *list) - - free(item->file_path); - item->file_path = NULL; -- item->fd = -1; -+ item->fd = INT_MAX; - free(item); - } - } -diff --git src/lsm_datatypes.cpp src/lsm_datatypes.cpp -index d989c32..7e6415d 100644 ---- src/lsm_datatypes.cpp -+++ src/lsm_datatypes.cpp -@@ -1560,7 +1560,12 @@ static uint8_t *stringToBytes(const char *hex_string, uint32_t *l) - *l = len; - - for( i = 0; i < len; ++i ) { -- sscanf(t, "%02hhx", &rc[i]); -+ if( 1 != sscanf(t, "%02hhx", &rc[i])) { -+ free(rc); -+ rc = NULL; -+ *l = 0; -+ break; -+ } - t += 2; - } - } -diff --git src/lsm_ipc.cpp src/lsm_ipc.cpp -index 355abee..4a2d07d 100644 ---- src/lsm_ipc.cpp -+++ src/lsm_ipc.cpp -@@ -121,9 +121,13 @@ std::string Transport::recvMsg(int &error_code) - { - std::string msg; - error_code = 0; -+ unsigned long int payload_len = 0; - std::string len = readString(s, HDR_LEN, error_code); //Read the length - if (len.size() && error_code == 0) { -- msg = readString(s, strtoul(len.c_str(), NULL, 10), error_code); -+ payload_len = strtoul(len.c_str(), NULL, 10); -+ if( payload_len < 0x80000000 ) { /* Should be big enough */ -+ msg = readString(s, payload_len, error_code); -+ } - //fprintf(stderr, "<<< %s\n", msg.c_str()); - } - return msg; -@@ -147,6 +151,7 @@ int Transport::getSocket(const std::string& path, int &error_code) - if (rc != 0) { - error_code = errno; - rc = -1; //Redundant, connect should set to -1 on error -+ ::close(sfd); - } else { - rc = sfd; //We are good to go. - } -diff --git src/lsm_mgmt.cpp src/lsm_mgmt.cpp -index f5c96a1..694e10a 100644 ---- src/lsm_mgmt.cpp -+++ src/lsm_mgmt.cpp -@@ -37,6 +37,7 @@ - return LSM_ERR_INVALID_CONN; \ - } \ - lsmErrorFree(c->error); \ -+ c->error = NULL; \ - } while (0) - - /** -@@ -118,7 +119,7 @@ static lsmErrorNumber logException(lsmConnect *c, lsmErrorNumber error, - LSM_ERR_LEVEL_ERROR, message, - exception_msg, NULL, - NULL, 0); -- if( err && c ) { -+ if( err ) { - lsmErrorLog(c, err); - } - return error; -@@ -135,7 +136,7 @@ static int rpc(lsmConnect *c, const char *method, const Value ¶meters, - } catch ( const LsmException &le ) { - return logException(c, (lsmErrorNumber)le.error_code, le.what(), - NULL); -- } catch ( EOFException &eof ) { -+ } catch ( const EOFException &eof ) { - return logException(c, LSM_ERR_TRANSPORT_COMMUNICATION, "Plug-in died", - "Check syslog"); - } catch (...) { -@@ -145,30 +146,40 @@ static int rpc(lsmConnect *c, const char *method, const Value ¶meters, - return LSM_ERR_OK; - } - --static int jobCheck( int rc, Value &response, char **job ) -+static int jobCheck( lsmConnect *c, int rc, Value &response, char **job ) - { -- if( LSM_ERR_OK == rc ) { -- //We get a value back, either null or job id. -- if( Value::string_t == response.valueType() ) { -- *job = strdup(response.asString().c_str()); -- -- if( *job ) { -- rc = LSM_ERR_JOB_STARTED; -+ try { -+ if( LSM_ERR_OK == rc ) { -+ //We get a value back, either null or job id. -+ if( Value::string_t == response.valueType() ) { -+ *job = strdup(response.asString().c_str()); -+ -+ if( *job ) { -+ rc = LSM_ERR_JOB_STARTED; -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } - } else { -- rc = LSM_ERR_NO_MEMORY; -+ *job = NULL; - } -- } else { -- *job = NULL; - } -+ } catch (const ValueException &ve) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Wrong type", -+ ve.what()); - } - return rc; - } - --static int getAccessGroups( int rc, Value &response, lsmAccessGroup **groups[], -- uint32_t *count) -+static int getAccessGroups( lsmConnect *c, int rc, Value &response, -+ lsmAccessGroup **groups[], uint32_t *count) - { -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- *groups = valueToAccessGroupList(response, count); -+ try { -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ *groups = valueToAccessGroupList(response, count); -+ } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -197,6 +208,7 @@ int lsmConnectClose(lsmConnect *c, lsmFlag_t flags) - int LSM_DLL_EXPORT lsmPluginGetInfo(lsmConnect *c, char **desc, - char **version, lsmFlag_t flags) - { -+ int rc = LSM_ERR_OK; - CONN_SETUP(c); - - if( LSM_FLAG_UNUSED_CHECK(flags) ) { -@@ -207,23 +219,32 @@ int LSM_DLL_EXPORT lsmPluginGetInfo(lsmConnect *c, char **desc, - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; - -- int rc = rpc(c, "plugin_info", parameters, response); -+ rc = rpc(c, "plugin_info", parameters, response); - -- if( rc == LSM_ERR_OK ) { -- std::vector j = response.asArray(); -- *desc = strdup(j[0].asC_str()); -- *version = strdup(j[1].asC_str()); -+ if( rc == LSM_ERR_OK ) { -+ std::vector j = response.asArray(); -+ *desc = strdup(j[0].asC_str()); -+ *version = strdup(j[1].asC_str()); - -- if( !*desc || !*version ) { -- rc = LSM_ERR_NO_MEMORY; -- free(*desc); -- free(*version); -+ if( !*desc || !*version ) { -+ rc = LSM_ERR_NO_MEMORY; -+ free(*desc); -+ free(*version); -+ } - } -+ } catch (const ValueException &ve) { -+ free(*desc); -+ *desc = NULL; -+ free(*version); -+ *version = NULL; -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - - return rc; -@@ -242,16 +263,17 @@ int LSM_DLL_EXPORT lsmGetAvailablePlugins(const char *sep, - char *version = NULL; - char *s = NULL; - const char *uds_dir = uds_path(); -- lsmStringList *plugin_list = lsmStringListAlloc(0); -- -- if( !plugin_list ) { -- return LSM_ERR_NO_MEMORY; -- } -+ lsmStringList *plugin_list = NULL; - - if( CHECK_STR(sep) || CHECK_RP(plugins) || LSM_FLAG_UNUSED_CHECK(flags)) { - return LSM_ERR_INVALID_ARGUMENT; - } - -+ plugin_list = lsmStringListAlloc(0); -+ if( !plugin_list ) { -+ return LSM_ERR_NO_MEMORY; -+ } -+ - dirp = opendir(uds_dir); - if( dirp ) { - for(;;) { -@@ -277,28 +299,32 @@ int LSM_DLL_EXPORT lsmGetAvailablePlugins(const char *sep, - - if( -1 == format ) { - rc = LSM_ERR_NO_MEMORY; -- goto bail; -+ break; - } - - rc = lsmStringListAppend(plugin_list, s); - free(s); - s = NULL; - if( LSM_ERR_OK != rc ) { -- goto bail; -+ break; - } - - } - } else { -- goto bail; -+ break; - } - - freeConnection(c); - c = NULL; - } - } -+ } /* for(;;) */ -+ -+ if( e ) { -+ lsmErrorFree(e); -+ e = NULL; - } - -- bail: - if( c ) { - freeConnection(c); - c = NULL; -@@ -309,7 +335,8 @@ int LSM_DLL_EXPORT lsmGetAvailablePlugins(const char *sep, - //log the error - rc = LSM_ERR_INTERNAL_ERROR; - } -- } else { -+ -+ } else { /* If dirp == NULL */ - //Log the error - rc = LSM_ERR_INTERNAL_ERROR; - } -@@ -318,6 +345,7 @@ int LSM_DLL_EXPORT lsmGetAvailablePlugins(const char *sep, - *plugins = plugin_list; - } else { - lsmStringListFree(plugin_list); -+ plugin_list = NULL; - } - - return rc; -@@ -343,20 +371,27 @@ int lsmConnectSetTimeout(lsmConnect *c, uint32_t timeout, lsmFlag_t flags) - - int lsmConnectGetTimeout(lsmConnect *c, uint32_t *timeout, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -- -- int rc = rpc(c, "get_time_out", parameters, response); -- if( rc == LSM_ERR_OK ) { -- *timeout = response.asUint32_t(); -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; -+ -+ rc = rpc(c, "get_time_out", parameters, response); -+ if( rc == LSM_ERR_OK ) { -+ *timeout = response.asUint32_t(); -+ } -+ } -+ catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -365,26 +400,32 @@ static int jobStatus( lsmConnect *c, const char *job, - lsmJobStatus *status, uint8_t *percentComplete, - Value &returned_value, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !job || !status || !percentComplete ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["job_id"] = Value(job); -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -- -- int rc = rpc(c, "job_status", parameters, response); -- if( LSM_ERR_OK == rc ) { -- //We get back an array [status, percent, volume] -- std::vector j = response.asArray(); -- *status = (lsmJobStatus)j[0].asInt32_t(); -- *percentComplete = (uint8_t)j[1].asUint32_t(); -- -- returned_value = j[2]; -+ try { -+ std::map p; -+ p["job_id"] = Value(job); -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; -+ -+ rc = rpc(c, "job_status", parameters, response); -+ if( LSM_ERR_OK == rc ) { -+ //We get back an array [status, percent, volume] -+ std::vector j = response.asArray(); -+ *status = (lsmJobStatus)j[0].asInt32_t(); -+ *percentComplete = (uint8_t)j[1].asUint32_t(); -+ -+ returned_value = j[2]; -+ } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -408,6 +449,7 @@ int lsmJobStatusVolumeGet( lsmConnect *c, const char *job, - lsmVolume **vol, lsmFlag_t flags) - { - Value rv; -+ int rc = 0; - - CONN_SETUP(c); - -@@ -415,14 +457,20 @@ int lsmJobStatusVolumeGet( lsmConnect *c, const char *job, - return LSM_ERR_INVALID_ARGUMENT; - } - -- int rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ try { - -- if( LSM_ERR_OK == rc ) { -- if( Value::object_t == rv.valueType() ) { -- *vol = valueToVolume(rv); -- } else { -- *vol = NULL; -+ rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ -+ if( LSM_ERR_OK == rc ) { -+ if( Value::object_t == rv.valueType() ) { -+ *vol = valueToVolume(rv); -+ } else { -+ *vol = NULL; -+ } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -431,20 +479,27 @@ int lsmJobStatusFsGet(lsmConnect *c, const char *job, - lsmJobStatus *status, uint8_t *percentComplete, - lsmFs **fs, lsmFlag_t flags) - { -+ int rc = 0; - Value rv; - - if( CHECK_RP(fs) || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- int rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ try { - -- if( LSM_ERR_OK == rc ) { -- if( Value::object_t == rv.valueType() ) { -- *fs = valueToFs(rv); -- } else { -- *fs = NULL; -+ rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ -+ if( LSM_ERR_OK == rc ) { -+ if( Value::object_t == rv.valueType() ) { -+ *fs = valueToFs(rv); -+ } else { -+ *fs = NULL; -+ } - } -+ } catch( const ValueException &ve) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -453,20 +508,27 @@ int lsmJobStatusSsGet(lsmConnect *c, const char *job, - lsmJobStatus *status, uint8_t *percentComplete, - lsmSs **ss, lsmFlag_t flags) - { -+ int rc = 0; - Value rv; - - if( CHECK_RP(ss) || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- int rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ try { - -- if( LSM_ERR_OK == rc ) { -- if( Value::object_t == rv.valueType() ) { -- *ss = valueToSs(rv); -- } else { -- *ss = NULL; -+ rc = jobStatus(c, job, status, percentComplete, rv, flags); -+ -+ if( LSM_ERR_OK == rc ) { -+ if( Value::object_t == rv.valueType() ) { -+ *ss = valueToSs(rv); -+ } else { -+ *ss = NULL; -+ } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -498,6 +560,7 @@ int lsmJobFree(lsmConnect *c, char **job, lsmFlag_t flags) - int lsmCapabilities(lsmConnect *c, lsmSystem *system, - lsmStorageCapabilities **cap, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_SYSTEM(system) ) { -@@ -516,10 +579,15 @@ int lsmCapabilities(lsmConnect *c, lsmSystem *system, - Value parameters(p); - Value response; - -- int rc = rpc(c, "capabilities", parameters, response); -+ try { -+ rc = rpc(c, "capabilities", parameters, response); - -- if( LSM_ERR_OK == rc && Value::object_t == response.valueType() ) { -- *cap = valueToCapabilities(response); -+ if( LSM_ERR_OK == rc && Value::object_t == response.valueType() ) { -+ *cap = valueToCapabilities(response); -+ } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - - return rc; -@@ -528,56 +596,76 @@ int lsmCapabilities(lsmConnect *c, lsmSystem *system, - int lsmPoolList(lsmConnect *c, lsmPool **poolArray[], - uint32_t *count, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !poolArray || !count || CHECK_RP(poolArray) || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; - -- int rc = rpc(c, "pools", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector pools = response.asArray(); -+ rc = rpc(c, "pools", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector pools = response.asArray(); - -- *count = pools.size(); -+ *count = pools.size(); - -- if( pools.size() ) { -- *poolArray = lsmPoolRecordAllocArray(pools.size()); -+ if( pools.size() ) { -+ *poolArray = lsmPoolRecordAllocArray(pools.size()); - -- for( size_t i = 0; i < pools.size(); ++i ) { -- (*poolArray)[i] = valueToPool(pools[i]); -+ for( size_t i = 0; i < pools.size(); ++i ) { -+ (*poolArray)[i] = valueToPool(pools[i]); -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *poolArray && *count ) { -+ lsmPoolRecordFreeArray(*poolArray, *count); -+ *poolArray = NULL; -+ *count = 0; -+ } - } - return rc; - } - --static int get_initiator_array(int rc, Value &response, -+static int get_initiator_array(lsmConnect *c, int rc, Value &response, - lsmInitiator **initiators[], uint32_t *count) - { -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector inits = response.asArray(); -- -- *count = inits.size(); -- -- if( inits.size() ) { -+ try { -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector inits = response.asArray(); - -- *initiators = lsmInitiatorRecordAllocArray(inits.size()); -+ *count = inits.size(); - -- if( *initiators ) { -+ if( inits.size() ) { - -+ *initiators = lsmInitiatorRecordAllocArray(inits.size()); - -- for( size_t i = 0; i < inits.size(); ++i ) { -- (*initiators)[i] = valueToInitiator(inits[i]); -+ if( *initiators ) { -+ for( size_t i = 0; i < inits.size(); ++i ) { -+ (*initiators)[i] = valueToInitiator(inits[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; - } -- } else { -- rc = LSM_ERR_NO_MEMORY; - } - } -+ } catch ( const ValueException &ve ) { -+ if( *initiators && *count ) { -+ lsmInitiatorRecordFreeArray(*initiators, *count); -+ *initiators = NULL; -+ *count = 0; -+ } -+ -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -598,28 +686,39 @@ int lsmInitiatorList(lsmConnect *c, lsmInitiator **initiators[], - Value response; - - int rc = rpc(c, "initiators", parameters, response); -- return get_initiator_array(rc, response, initiators, count); -+ return get_initiator_array(c, rc, response, initiators, count); - } - --static int get_volume_array(int rc, Value response, -+static int get_volume_array(lsmConnect *c, int rc, Value response, - lsmVolume **volumes[], uint32_t *count) - { -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector vol = response.asArray(); -+ try { -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector vol = response.asArray(); - -- *count = vol.size(); -+ *count = vol.size(); - -- if( vol.size() ) { -- *volumes = lsmVolumeRecordAllocArray(vol.size()); -+ if( vol.size() ) { -+ *volumes = lsmVolumeRecordAllocArray(vol.size()); - -- if( *volumes ){ -- for( size_t i = 0; i < vol.size(); ++i ) { -- (*volumes)[i] = valueToVolume(vol[i]); -+ if( *volumes ){ -+ for( size_t i = 0; i < vol.size(); ++i ) { -+ (*volumes)[i] = valueToVolume(vol[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; - } -- } else { -- rc = LSM_ERR_NO_MEMORY; - } - } -+ } catch( const ValueException &ve) { -+ if( *volumes && *count ) { -+ lsmVolumeRecordFreeArray(*volumes, *count); -+ *volumes = NULL; -+ *count = 0; -+ } -+ -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -641,28 +740,38 @@ int lsmVolumeList(lsmConnect *c, lsmVolume **volumes[], uint32_t *count, - Value response; - - int rc = rpc(c, "volumes", parameters, response); -- return get_volume_array(rc, response, volumes, count); -+ return get_volume_array(c, rc, response, volumes, count); - } - --static int get_disk_array(int rc, Value &response, lsmDisk **disks[], -- uint32_t *count) -+static int get_disk_array(lsmConnect *c, int rc, Value &response, -+ lsmDisk **disks[], uint32_t *count) - { -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector d = response.asArray(); -+ try { -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector d = response.asArray(); - -- *count = d.size(); -+ *count = d.size(); - -- if( d.size() ) { -- *disks = lsmDiskRecordAllocArray(d.size()); -+ if( d.size() ) { -+ *disks = lsmDiskRecordAllocArray(d.size()); - -- if( *disks ){ -- for( size_t i = 0; i < d.size(); ++i ) { -- (*disks)[i] = valueToDisk(d[i]); -+ if( *disks ){ -+ for( size_t i = 0; i < d.size(); ++i ) { -+ (*disks)[i] = valueToDisk(d[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; - } -- } else { -- rc = LSM_ERR_NO_MEMORY; - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *disks && *count ) { -+ lsmDiskRecordFreeArray(*disks, *count); -+ *disks = NULL; -+ *count = 0; -+ } - } - return rc; - -@@ -684,30 +793,39 @@ int lsmDiskList(lsmConnect *c, lsmDisk **disks[], - Value response; - - int rc = rpc(c, "disks", parameters, response); -- return get_disk_array(rc, response, disks, count); -+ return get_disk_array(c, rc, response, disks, count); - } - - typedef void* (*convert)(Value &v); - --static void* parse_job_response(Value response, int &rc, char **job, convert conv) -+static void* parse_job_response(lsmConnect *c, Value response, int &rc, -+ char **job, convert conv) - { - void *val = NULL; -- //We get an array back. first value is job, second is data of interest. -- if( Value::array_t == response.valueType() ) { -- std::vector r = response.asArray(); -- if( Value::string_t == r[0].valueType()) { -- *job = strdup((r[0].asString()).c_str()); -- if( *job ) { -+ -+ try { -+ //We get an array back. first value is job, second is data of interest. -+ if( Value::array_t == response.valueType() ) { -+ std::vector r = response.asArray(); -+ if( Value::string_t == r[0].valueType()) { -+ *job = strdup((r[0].asString()).c_str()); -+ if( *job ) { -+ rc = LSM_ERR_JOB_STARTED; -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } -+ - rc = LSM_ERR_JOB_STARTED; -- } else { -- rc = LSM_ERR_NO_MEMORY; - } -- -- rc = LSM_ERR_JOB_STARTED; -- } -- if( Value::object_t == r[1].valueType() ) { -- val = conv(r[1]); -+ if( Value::object_t == r[1].valueType() ) { -+ val = conv(r[1]); -+ } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ free(*job); -+ *job = NULL; - } - return val; - } -@@ -739,7 +857,7 @@ int lsmVolumeCreate(lsmConnect *c, lsmPool *pool, const char *volumeName, - - int rc = rpc(c, "volume_create", parameters, response); - if( LSM_ERR_OK == rc ) { -- *newVolume = (lsmVolume *)parse_job_response(response, rc, job, -+ *newVolume = (lsmVolume *)parse_job_response(c, response, rc, job, - (convert)valueToVolume); - } - return rc; -@@ -775,7 +893,7 @@ int lsmVolumeResize(lsmConnect *c, lsmVolume *volume, - - int rc = rpc(c, "volume_resize", parameters, response); - if( LSM_ERR_OK == rc ) { -- *resizedVolume = (lsmVolume *)parse_job_response(response, rc, job, -+ *resizedVolume = (lsmVolume *)parse_job_response(c, response, rc, job, - (convert)valueToVolume); - } - return rc; -@@ -813,7 +931,7 @@ int lsmVolumeReplicate(lsmConnect *c, lsmPool *pool, - - int rc = rpc(c, "volume_replicate", parameters, response); - if( LSM_ERR_OK == rc ) { -- *newReplicant = (lsmVolume *)parse_job_response(response, rc, job, -+ *newReplicant = (lsmVolume *)parse_job_response(c, response, rc, job, - (convert)valueToVolume); - } - return rc; -@@ -823,6 +941,7 @@ int lsmVolumeReplicate(lsmConnect *c, lsmPool *pool, - int lsmVolumeReplicateRangeBlockSize(lsmConnect *c, lsmSystem *system, - uint32_t *bs, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !bs || LSM_FLAG_UNUSED_CHECK(flags) ) { -@@ -833,17 +952,22 @@ int lsmVolumeReplicateRangeBlockSize(lsmConnect *c, lsmSystem *system, - return LSM_ERR_INVALID_SYSTEM; - } - -- std::map p; -- p["system"] = systemToValue(system); -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -- -- int rc = rpc(c, "volume_replicate_range_block_size", parameters, response); -- if( LSM_ERR_OK == rc ) { -- if( Value::numeric_t == response.valueType() ) { -- *bs = response.asUint32_t(); -+ try { -+ std::map p; -+ p["system"] = systemToValue(system); -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; -+ -+ rc = rpc(c, "volume_replicate_range_block_size", parameters, response); -+ if( LSM_ERR_OK == rc ) { -+ if( Value::numeric_t == response.valueType() ) { -+ *bs = response.asUint32_t(); -+ } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -879,12 +1003,13 @@ int lsmVolumeReplicateRange(lsmConnect *c, - Value response; - - int rc = rpc(c, "volume_replicate_range", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - int lsmVolumeDelete(lsmConnect *c, lsmVolume *volume, char **job, - lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_VOL(volume) ) { -@@ -895,25 +1020,30 @@ int lsmVolumeDelete(lsmConnect *c, lsmVolume *volume, char **job, - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["volume"] = volumeToValue(volume); -- p["flags"] = Value(flags); -- -- Value parameters(p); -- Value response; -- -- int rc = rpc(c, "volume_delete", parameters, response); -- if( LSM_ERR_OK == rc ) { -- //We get a value back, either null or job id. -- if( Value::string_t == response.valueType() ) { -- *job = strdup(response.asString().c_str()); -- -- if( *job ) { -- rc = LSM_ERR_JOB_STARTED; -- } else { -- rc = LSM_ERR_NO_MEMORY; -+ try { -+ std::map p; -+ p["volume"] = volumeToValue(volume); -+ p["flags"] = Value(flags); -+ -+ Value parameters(p); -+ Value response; -+ -+ rc = rpc(c, "volume_delete", parameters, response); -+ if( LSM_ERR_OK == rc ) { -+ //We get a value back, either null or job id. -+ if( Value::string_t == response.valueType() ) { -+ *job = strdup(response.asString().c_str()); -+ -+ if( *job ) { -+ rc = LSM_ERR_JOB_STARTED; -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - -@@ -1026,7 +1156,7 @@ int lsmVolumesAccessibleByInitiator(lsmConnect *c, - Value response; - - int rc = rpc(c, "volumes_accessible_by_initiator", parameters, response); -- return get_volume_array(rc, response, volumes, count); -+ return get_volume_array(c, rc, response, volumes, count); - } - - int lsmInitiatorsGrantedToVolume(lsmConnect *c, lsmVolume *volume, -@@ -1050,7 +1180,7 @@ int lsmInitiatorsGrantedToVolume(lsmConnect *c, lsmVolume *volume, - Value response; - - int rc = rpc(c, "initiators_granted_to_volume", parameters, response); -- return get_initiator_array(rc, response, initiators, count); -+ return get_initiator_array(c, rc, response, initiators, count); - } - - -@@ -1101,7 +1231,7 @@ int lsmAccessGroupList( lsmConnect *c, lsmAccessGroup **groups[], - Value response; - - int rc = rpc(c, "access_group_list", parameters, response); -- return getAccessGroups(rc, response, groups, groupCount); -+ return getAccessGroups(c, rc, response, groups, groupCount); - } - - int lsmAccessGroupCreate(lsmConnect *c, const char *name, -@@ -1279,6 +1409,7 @@ int lsmVolumesAccessibleByAccessGroup(lsmConnect *c, - lsmVolume **volumes[], - uint32_t *count, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_ACCESS_GROUP(group)) { -@@ -1289,26 +1420,36 @@ int lsmVolumesAccessibleByAccessGroup(lsmConnect *c, - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["group"] = accessGroupToValue(group); -- p["flags"] = Value(flags); -+ try { -+ std::map p; -+ p["group"] = accessGroupToValue(group); -+ p["flags"] = Value(flags); - -- Value parameters(p); -- Value response; -+ Value parameters(p); -+ Value response; - -- int rc = rpc(c, "volumes_accessible_by_access_group", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector vol = response.asArray(); -+ rc = rpc(c, "volumes_accessible_by_access_group", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector vol = response.asArray(); - -- *count = vol.size(); -+ *count = vol.size(); - -- if( vol.size() ) { -- *volumes = lsmVolumeRecordAllocArray(vol.size()); -+ if( vol.size() ) { -+ *volumes = lsmVolumeRecordAllocArray(vol.size()); - -- for( size_t i = 0; i < vol.size(); ++i ) { -- (*volumes)[i] = valueToVolume(vol[i]); -+ for( size_t i = 0; i < vol.size(); ++i ) { -+ (*volumes)[i] = valueToVolume(vol[i]); -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *volumes && *count ) { -+ lsmVolumeRecordFreeArray(*volumes, *count); -+ *volumes = NULL; -+ *count = 0; -+ } - } - return rc; - } -@@ -1336,12 +1477,13 @@ int lsmAccessGroupsGrantedToVolume(lsmConnect *c, - Value response; - - int rc = rpc(c, "access_groups_granted_to_volume", parameters, response); -- return getAccessGroups(rc, response, groups, groupCount); -+ return getAccessGroups(c, rc, response, groups, groupCount); - } - - int lsmVolumeChildDependency(lsmConnect *c, lsmVolume *volume, - uint8_t *yes, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_VOL(volume)) { -@@ -1352,25 +1494,30 @@ int lsmVolumeChildDependency(lsmConnect *c, lsmVolume *volume, - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["volume"] = volumeToValue(volume); -- p["flags"] = Value(flags); -+ try { -+ std::map p; -+ p["volume"] = volumeToValue(volume); -+ p["flags"] = Value(flags); - -- Value parameters(p); -- Value response; -+ Value parameters(p); -+ Value response; - -- *yes = 0; -+ *yes = 0; - -- int rc = rpc(c, "volume_child_dependency", parameters, response); -- if( LSM_ERR_OK == rc ) { -- //We should be getting a boolean value back. -- if( Value::boolean_t == response.valueType() ) { -- if( response.asBool() ) { -- *yes = 1; -+ rc = rpc(c, "volume_child_dependency", parameters, response); -+ if( LSM_ERR_OK == rc ) { -+ //We should be getting a boolean value back. -+ if( Value::boolean_t == response.valueType() ) { -+ if( response.asBool() ) { -+ *yes = 1; -+ } -+ } else { -+ rc = LSM_ERR_INTERNAL_ERROR; - } -- } else { -- rc = LSM_ERR_INTERNAL_ERROR; - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -1396,45 +1543,56 @@ int lsmVolumeChildDependencyRm(lsmConnect *c, lsmVolume *volume, - Value response; - - int rc = rpc(c, "volume_child_dependency_rm", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - int lsmSystemList(lsmConnect *c, lsmSystem **systems[], - uint32_t *systemCount, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !systems || ! systemCount || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -- -- int rc = rpc(c, "systems", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector sys = response.asArray(); -- -- *systemCount = sys.size(); -- -- if( sys.size() ) { -- *systems = lsmSystemRecordAllocArray(sys.size()); -- -- if( *systems ) { -- for( size_t i = 0; i < sys.size(); ++i ) { -- (*systems)[i] = valueToSystem(sys[i]); -- if( !(*systems)[i] ) { -- lsmSystemRecordFreeArray(*systems, i); -- rc = LSM_ERR_NO_MEMORY; -- break; -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; -+ -+ rc = rpc(c, "systems", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector sys = response.asArray(); -+ -+ *systemCount = sys.size(); -+ -+ if( sys.size() ) { -+ *systems = lsmSystemRecordAllocArray(sys.size()); -+ -+ if( *systems ) { -+ for( size_t i = 0; i < sys.size(); ++i ) { -+ (*systems)[i] = valueToSystem(sys[i]); -+ if( !(*systems)[i] ) { -+ lsmSystemRecordFreeArray(*systems, i); -+ rc = LSM_ERR_NO_MEMORY; -+ break; -+ } - } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; - } -- } else { -- rc = LSM_ERR_NO_MEMORY; - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *systems ) { -+ lsmSystemRecordFreeArray( *systems, *systemCount); -+ *systems = NULL; -+ *systemCount = 0; -+ } - } - return rc; - } -@@ -1442,30 +1600,45 @@ int lsmSystemList(lsmConnect *c, lsmSystem **systems[], - int lsmFsList(lsmConnect *c, lsmFs **fs[], uint32_t *fsCount, - lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !fs || !fsCount || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; - -- int rc = rpc(c, "fs", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector sys = response.asArray(); -+ rc = rpc(c, "fs", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector sys = response.asArray(); - -- *fsCount = sys.size(); -+ *fsCount = sys.size(); - -- if( sys.size() ) { -- *fs = lsmFsRecordAllocArray(sys.size()); -+ if( sys.size() ) { -+ *fs = lsmFsRecordAllocArray(sys.size()); - -- for( size_t i = 0; i < sys.size(); ++i ) { -- (*fs)[i] = valueToFs(sys[i]); -+ if( *fs ) { -+ for( size_t i = 0; i < sys.size(); ++i ) { -+ (*fs)[i] = valueToFs(sys[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *fs && *fsCount) { -+ lsmFsRecordFreeArray(*fs, *fsCount); -+ *fs = NULL; -+ *fsCount = 0; -+ } - } - return rc; - -@@ -1497,7 +1670,7 @@ int lsmFsCreate(lsmConnect *c, lsmPool *pool, const char *name, - - int rc = rpc(c, "fs_create", parameters, response); - if( LSM_ERR_OK == rc ) { -- *fs = (lsmFs *)parse_job_response(response, rc, job, -+ *fs = (lsmFs *)parse_job_response(c, response, rc, job, - (convert)valueToFs); - } - return rc; -@@ -1523,7 +1696,7 @@ int lsmFsDelete(lsmConnect *c, lsmFs *fs, char **job, lsmFlag_t flags) - Value response; - - int rc = rpc(c, "fs_delete", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - -@@ -1551,7 +1724,7 @@ int lsmFsResize(lsmConnect *c, lsmFs *fs, - - int rc = rpc(c, "fs_resize", parameters, response); - if( LSM_ERR_OK == rc ) { -- *rfs = (lsmFs *)parse_job_response(response, rc, job, -+ *rfs = (lsmFs *)parse_job_response(c, response, rc, job, - (convert)valueToFs); - } - return rc; -@@ -1583,7 +1756,7 @@ int lsmFsClone(lsmConnect *c, lsmFs *src_fs, - - int rc = rpc(c, "fs_clone", parameters, response); - if( LSM_ERR_OK == rc ) { -- *cloned_fs = (lsmFs *)parse_job_response(response, rc, job, -+ *cloned_fs = (lsmFs *)parse_job_response(c, response, rc, job, - (convert)valueToFs); - } - return rc; -@@ -1615,12 +1788,13 @@ int lsmFsFileClone(lsmConnect *c, lsmFs *fs, const char *src_file_name, - Value response; - - int rc = rpc(c, "file_clone", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - int lsmFsChildDependency( lsmConnect *c, lsmFs *fs, lsmStringList *files, - uint8_t *yes, lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_FS(fs) ) { -@@ -1637,26 +1811,31 @@ int lsmFsChildDependency( lsmConnect *c, lsmFs *fs, lsmStringList *files, - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["fs"] = fsToValue(fs); -- p["files"] = stringListToValue(files); -- p["flags"] = Value(flags); -- -- Value parameters(p); -- Value response; -- -- *yes = 0; -- -- int rc = rpc(c, "fs_child_dependency", parameters, response); -- if( LSM_ERR_OK == rc ) { -- //We should be getting a boolean value back. -- if( Value::boolean_t == response.valueType() ) { -- if( response.asBool() ) { -- *yes = 1; -+ try { -+ std::map p; -+ p["fs"] = fsToValue(fs); -+ p["files"] = stringListToValue(files); -+ p["flags"] = Value(flags); -+ -+ Value parameters(p); -+ Value response; -+ -+ *yes = 0; -+ -+ rc = rpc(c, "fs_child_dependency", parameters, response); -+ if( LSM_ERR_OK == rc ) { -+ //We should be getting a boolean value back. -+ if( Value::boolean_t == response.valueType() ) { -+ if( response.asBool() ) { -+ *yes = 1; -+ } -+ } else { -+ rc = LSM_ERR_INTERNAL_ERROR; - } -- } else { -- rc = LSM_ERR_INTERNAL_ERROR; - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); - } - return rc; - } -@@ -1689,12 +1868,13 @@ int lsmFsChildDependencyRm( lsmConnect *c, lsmFs *fs, lsmStringList *files, - Value response; - - int rc = rpc(c, "fs_child_dependency_rm", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - int lsmFsSsList(lsmConnect *c, lsmFs *fs, lsmSs **ss[], - uint32_t *ssCount, lsmFlag_t flags ) - { -+ int rc = 0; - CONN_SETUP(c); - - if( !LSM_IS_FS(fs) ) { -@@ -1712,19 +1892,33 @@ int lsmFsSsList(lsmConnect *c, lsmFs *fs, lsmSs **ss[], - Value parameters(p); - Value response; - -- int rc = rpc(c, "fs_snapshots", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector sys = response.asArray(); -+ try { -+ rc = rpc(c, "fs_snapshots", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector sys = response.asArray(); - -- *ssCount = sys.size(); -+ *ssCount = sys.size(); - -- if( sys.size() ) { -- *ss = lsmSsRecordAllocArray(sys.size()); -+ if( sys.size() ) { -+ *ss = lsmSsRecordAllocArray(sys.size()); - -- for( size_t i = 0; i < sys.size(); ++i ) { -- (*ss)[i] = valueToSs(sys[i]); -+ if( *ss ) { -+ for( size_t i = 0; i < sys.size(); ++i ) { -+ (*ss)[i] = valueToSs(sys[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *ss && *ssCount ) { -+ lsmSsRecordFreeArray(*ss, *ssCount); -+ *ss = NULL; -+ *ssCount = 0; -+ } - } - return rc; - -@@ -1761,7 +1955,7 @@ int lsmFsSsCreate(lsmConnect *c, lsmFs *fs, const char *name, - - int rc = rpc(c, "fs_snapshot_create", parameters, response); - if( LSM_ERR_OK == rc ) { -- *snapshot = (lsmSs *)parse_job_response(response, rc, job, -+ *snapshot = (lsmSs *)parse_job_response(c, response, rc, job, - (convert)valueToSs); - } - return rc; -@@ -1793,7 +1987,7 @@ int lsmFsSsDelete(lsmConnect *c, lsmFs *fs, lsmSs *ss, char **job, - Value response; - - int rc = rpc(c, "fs_snapshot_delete", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - } - - int lsmFsSsRevert(lsmConnect *c, lsmFs *fs, lsmSs *ss, -@@ -1839,37 +2033,52 @@ int lsmFsSsRevert(lsmConnect *c, lsmFs *fs, lsmSs *ss, - Value response; - - int rc = rpc(c, "fs_snapshot_revert", parameters, response); -- return jobCheck(rc, response, job); -+ return jobCheck(c, rc, response, job); - - } - - int lsmNfsList( lsmConnect *c, lsmNfsExport **exports[], uint32_t *count, - lsmFlag_t flags) - { -+ int rc = 0; - CONN_SETUP(c); - - if( CHECK_RP(exports) || !count || LSM_FLAG_UNUSED_CHECK(flags) ) { - return LSM_ERR_INVALID_ARGUMENT; - } - -- std::map p; -- p["flags"] = Value(flags); -- Value parameters(p); -- Value response; -+ try { -+ std::map p; -+ p["flags"] = Value(flags); -+ Value parameters(p); -+ Value response; - -- int rc = rpc(c, "exports", parameters, response); -- if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -- std::vector exps = response.asArray(); -+ rc = rpc(c, "exports", parameters, response); -+ if( LSM_ERR_OK == rc && Value::array_t == response.valueType()) { -+ std::vector exps = response.asArray(); - -- *count = exps.size(); -+ *count = exps.size(); - -- if( *count ) { -- *exports = lsmNfsExportRecordAllocArray(*count); -+ if( *count ) { -+ *exports = lsmNfsExportRecordAllocArray(*count); - -- for( size_t i = 0; i < *count; ++i ) { -- (*exports)[i] = valueToNfsExport(exps[i]); -+ if( *exports ) { -+ for( size_t i = 0; i < *count; ++i ) { -+ (*exports)[i] = valueToNfsExport(exps[i]); -+ } -+ } else { -+ rc = LSM_ERR_NO_MEMORY; -+ } - } - } -+ } catch( const ValueException &ve ) { -+ rc = logException(c, LSM_ERR_INTERNAL_ERROR, "Unexpected type", -+ ve.what()); -+ if( *exports && *count ) { -+ lsmNfsExportRecordFreeArray( *exports, *count ); -+ *exports = NULL; -+ *count = 0; -+ } - } - return rc; - } -diff --git src/lsm_plugin_ipc.cpp src/lsm_plugin_ipc.cpp -index c23806c..c68a742 100644 ---- src/lsm_plugin_ipc.cpp -+++ src/lsm_plugin_ipc.cpp -@@ -257,20 +257,20 @@ static int handle_startup(lsmPluginPtr p, Value ¶ms, Value &response) - { - int rc = LSM_ERR_NO_SUPPORT; - xmlURIPtr uri = NULL; -+ std::string uri_string = params["uri"].asString(); -+ std::string password; - - if( p ) { -- uri = xmlParseURI(params["uri"].asString().c_str()); -+ uri = xmlParseURI(uri_string.c_str()); - if( uri ) { -- const char *pass = NULL; -- - lsmFlag_t flags = LSM_FLAG_GET_VALUE(params); - - if( Value::string_t == params["password"].valueType() ) { -- pass = params["password"].asString().c_str(); -+ password = params["password"].asString(); - } - - //Let the plug-in initialize itself. -- rc = p->reg(p, uri, pass, params["timeout"].asUint32_t(), -+ rc = p->reg(p, uri, password.c_str(), params["timeout"].asUint32_t(), - flags); - xmlFreeURI(uri); - uri = NULL; -@@ -314,7 +314,7 @@ static int handle_get_time_out( lsmPluginPtr p, Value ¶ms, Value &response) - - static int handle_job_status( lsmPluginPtr p, Value ¶ms, Value &response) - { -- const char *job_id = NULL; -+ std::string job_id; - lsmJobStatus status; - uint8_t percent; - lsmDataType t = LSM_DATA_TYPE_UNKNOWN; -@@ -328,9 +328,9 @@ static int handle_job_status( lsmPluginPtr p, Value ¶ms, Value &response) - rc = LSM_ERR_TRANSPORT_INVALID_ARG; - } else { - -- job_id = params["job_id"].asString().c_str(); -+ job_id = params["job_id"].asString(); - -- rc = p->mgmtOps->job_status(p, job_id, &status, &percent, &t, -+ rc = p->mgmtOps->job_status(p, job_id.c_str(), &status, &percent, &t, - &value, LSM_FLAG_GET_VALUE(params)); - - if( LSM_ERR_OK == rc) { diff --git a/SOURCES/libstoragemgmt-0.0.24-nstor-json.patch b/SOURCES/libstoragemgmt-0.0.24-nstor-json.patch deleted file mode 100644 index 6b08541..0000000 --- a/SOURCES/libstoragemgmt-0.0.24-nstor-json.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git lsm/lsm/nstor.py lsm/lsm/nstor.py -index 540a4db..10d4b65 100644 ---- lsm/lsm/nstor.py -+++ lsm/lsm/nstor.py -@@ -20,7 +20,10 @@ - - import urllib2 - import urlparse --import simplejson as json -+try: -+ import simplejson as json -+except ImportError: -+ import json - import base64 - import time - diff --git a/SOURCES/libstoragemgmt-0.0.24-python_env.patch b/SOURCES/libstoragemgmt-0.0.24-python_env.patch deleted file mode 100644 index 829589c..0000000 --- a/SOURCES/libstoragemgmt-0.0.24-python_env.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git lsm/nstor_lsmplugin lsm/nstor_lsmplugin -index f183c86..9886181 100755 ---- lsm/nstor_lsmplugin -+++ lsm/nstor_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # - # Copyright (C) 2012 Nexenta Systems, Inc. -diff --git lsm/ontap_lsmplugin lsm/ontap_lsmplugin -index 2695fa7..4f14516 100755 ---- lsm/ontap_lsmplugin -+++ lsm/ontap_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2011-2013 Red Hat, Inc. - # This library is free software; you can redistribute it and/or -diff --git lsm/sim_lsmplugin lsm/sim_lsmplugin -index e05dce5..fc19d13 100755 ---- lsm/sim_lsmplugin -+++ lsm/sim_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2011-2013 Red Hat, Inc. - # This library is free software; you can redistribute it and/or -diff --git lsm/smispy_lsmplugin lsm/smispy_lsmplugin -index 015cb34..ae93bba 100755 ---- lsm/smispy_lsmplugin -+++ lsm/smispy_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2011-2013 Red Hat, Inc. - # This library is free software; you can redistribute it and/or -diff --git lsm/targetd_lsmplugin lsm/targetd_lsmplugin -index f8e65bd..b3fa5bd 100755 ---- lsm/targetd_lsmplugin -+++ lsm/targetd_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2011-2013 Red Hat, Inc. - # This library is free software; you can redistribute it and/or -diff --git lsm/v7k_lsmplugin lsm/v7k_lsmplugin -index b772c59..7c41850 100755 ---- lsm/v7k_lsmplugin -+++ lsm/v7k_lsmplugin -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2013 IBM Corporation - # This library is free software; you can redistribute it and/or -diff --git test/cmdtest.py test/cmdtest.py -index 0a545aa..c915bc8 100755 ---- test/cmdtest.py -+++ test/cmdtest.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2011-2013 Red Hat, Inc. - # -diff --git tools/lsmclipy/lsmcli tools/lsmclipy/lsmcli -index c115e61..2d2541e 100755 ---- tools/lsmclipy/lsmcli -+++ tools/lsmclipy/lsmcli -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python2.7 - - # Copyright (C) 2012 Red Hat, Inc. - # This library is free software; you can redistribute it and/or diff --git a/SOURCES/libstoragemgmt-1.1.0-remove_yaml_build_requirement.patch b/SOURCES/libstoragemgmt-1.1.0-remove_yaml_build_requirement.patch new file mode 100644 index 0000000..1aa6f4d --- /dev/null +++ b/SOURCES/libstoragemgmt-1.1.0-remove_yaml_build_requirement.patch @@ -0,0 +1,43 @@ +diff --git configure.ac configure.ac +index 0bd3070..1c27fa0 100644 +--- configure.ac ++++ configure.ac +@@ -160,7 +160,6 @@ AM_PATH_PYTHON([2.6], [], AC_MSG_ERROR([Python interpreter 2.6 or 2.7 required]) + AC_PYTHON_MODULE([pywbem], [Required]) + AC_PYTHON_MODULE([M2Crypto], [Required]) + AC_PYTHON_MODULE([argparse], [Required]) +-AC_PYTHON_MODULE([yaml], [Required]) + + dnl ========================================================================== + dnl Check for libmicrohttpd and json-c as it is needed for REST API daemon +diff --git test/plugin_test.py test/plugin_test.py +index e92497c..8e0d8bc 100755 +--- test/plugin_test.py ++++ test/plugin_test.py +@@ -26,7 +26,6 @@ import argparse + import collections + import atexit + import sys +-import yaml + import re + import os + import tempfile +@@ -1273,10 +1272,15 @@ def dump_results(): + unittest.main exits when done so we need to register this handler to + get our results out. + +- output details (yaml) results of what we called, how it finished and how +- long it took. ++ If PyYAML is available we will output detailed results, else we will ++ output nothing. The detailed output results of what we called, ++ how it finished and how long it took. + """ +- sys.stdout.write(yaml.dump(dict(methods_called=results, stats=stats))) ++ try: ++ import yaml ++ sys.stdout.write(yaml.dump(dict(methods_called=results, stats=stats))) ++ except ImportError: ++ sys.stdout.write("NOTICE: Install PyYAML for detailed test results\n") + + + def add_our_params(): diff --git a/SPECS/libstoragemgmt.spec b/SPECS/libstoragemgmt.spec index f76d66a..a55e860 100644 --- a/SPECS/libstoragemgmt.spec +++ b/SPECS/libstoragemgmt.spec @@ -1,28 +1,26 @@ Name: libstoragemgmt -Version: 0.0.24 -Release: 4%{?dist} +Version: 1.1.0 +Release: 2%{?dist} Summary: Storage array management library Group: System Environment/Libraries License: LGPLv2+ URL: http://sourceforge.net/projects/libstoragemgmt/ Source0: http://sourceforge.net/projects/libstoragemgmt/files/libstoragemgmt-%{version}.tar.gz -Patch0: %{name}-0.0.24-python_env.patch -Patch1: %{name}-0.0.24-nstor-json.patch -Patch2: %{name}-0.0.24-coverity-fix.patch -Patch3: %{name}-0.0.24-comment_out_ua_udev_rules.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildRequires: autoconf automake libtool yajl-devel libxml2-devel check-devel glib2-devel -BuildRequires: gcc-c++ Requires: %{name}-python - -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -BuildRequires: systemd-units +BuildRequires: autoconf automake libtool yajl-devel libxml2-devel check-devel perl +BuildRequires: openssl-devel +BuildRequires: python-argparse +BuildRequires: glib2-devel +# Explicitly require gcc-c++ +BuildRequires: gcc-c++ +BuildRequires: systemd Requires: initscripts -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -%endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +Patch0: libstoragemgmt-1.1.0-remove_yaml_build_requirement.patch %description The libStorageMgmt library will provide a vendor agnostic open source storage @@ -89,21 +87,6 @@ The %{name}-targetd-plugin package contains plug-in for targetd array support. -%if 0%{?fedora} || 0%{?rhel} <= 6 -%package ibm-v7k-plugin -Summary: Files for IBM v7k array support for %{name} -Group: System Environment/Libraries -BuildRequires: python-paramiko -Requires: python-paramiko %{name}-python -Requires: libstoragemgmt-python = %{version}-%{release} -BuildArch: noarch - -%description ibm-v7k-plugin -The %{name}-ibm-v7k-plugin package contains plug-in for IBM v7k array -support. -%endif - - %package nstor-plugin Summary: Files for NexentaStor array support for %{name} Group: System Environment/Libraries @@ -116,7 +99,7 @@ The %{name}-nstor-plugin package contains plug-in for NexentaStor array support. %package udev -Summary: udev files for %{name} +Summary: Udev files for %{name} Group: System Environment/Base %description udev @@ -125,20 +108,14 @@ uevents generated by the kernel. %prep %setup -q -%patch0 -p0 -%patch1 -p0 -%patch2 -p0 -%patch3 -p0 + +%patch0 -p0 -b .remove_yaml_build_requirement.patch %build -bash autogen.sh +./autogen.sh #Tell the install program to preserve file date/timestamps -%if 0%{?rhel} >= 7 -%configure --disable-static --without-paramiko -%else -%configure --disable-static -%endif +%configure --without-rest-api --disable-static V=1 make %{?_smp_mflags} @@ -147,29 +124,35 @@ rm -rf %{buildroot} make install DESTDIR=%{buildroot} find %{buildroot} -name '*.la' -exec rm -f {} ';' -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 install -d -m755 %{buildroot}/%{_unitdir} -install -m644 packaging/daemon/libstoragemgmt.service %{buildroot}/%{_unitdir}/libstoragemgmt.service +install -m644 packaging/daemon/libstoragemgmt.service \ + %{buildroot}/%{_unitdir}/libstoragemgmt.service #tempfiles.d configuration for /var/run -mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d -install -m 0644 packaging/daemon/lsm-tmpfiles.conf %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf -%else -#Need these to exist at install so we can start the daemon -mkdir -p %{buildroot}/etc/rc.d/init.d -install packaging/daemon/libstoragemgmtd %{buildroot}/etc/rc.d/init.d/libstoragemgmtd -%endif +mkdir -p %{buildroot}/%{_tmpfilesdir} +install -m 0644 packaging/daemon/lsm-tmpfiles.conf \ + %{buildroot}/%{_tmpfilesdir}/%{name}.conf #Need these to exist at install so we can start the daemon mkdir -p %{buildroot}%{_localstatedir}/run/lsm/ipc -mkdir -p %{buildroot}/lib/udev/rules.d -install -m 644 tools/udev/90-scsi-ua.rules %{buildroot}/lib/udev/rules.d/90-scsi-ua.rules -install -m 755 tools/udev/scan-scsi-target %{buildroot}/lib/udev/scan-scsi-target +#Files for udev handling +mkdir -p %{buildroot}/usr/lib/udev/rules.d +install -m 644 tools/udev/90-scsi-ua.rules \ + %{buildroot}/usr/lib/udev/rules.d/90-scsi-ua.rules +install -m 755 tools/udev/scan-scsi-target \ + %{buildroot}/usr/lib/udev/scan-scsi-target %clean rm -rf %{buildroot} +%check +if ! make check +then + cat test/test-suite.log || true + exit 1 +fi + %pre getent group libstoragemgmt >/dev/null || groupadd -r libstoragemgmt getent passwd libstoragemgmt >/dev/null || \ @@ -178,38 +161,23 @@ getent passwd libstoragemgmt >/dev/null || \ %post /sbin/ldconfig -if [ $1 -eq 1 ]; then -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 - /bin/systemctl enable libstoragemgmt.service >/dev/null 2>&1 || : -%else - /sbin/chkconfig --add libstoragemgmtd +%systemd_post libstoragemgmt.service + + +%if 0%{?with_rest_api} +%preun rest +%systemd_preun libstoragemgmt-rest.service + +%postun rest +%systemd_postun libstoragemgmt-rest.service %endif -fi %preun -if [ $1 -eq 0 ]; then -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 - # On uninstall (not upgrade), disable and stop the units - /bin/systemctl --no-reload disable libstoragemgmt.service >/dev/null 2>&1 || : - /bin/systemctl stop libstoragemgmt.service >/dev/null 2>&1 || : -%else - /etc/rc.d/init.d/libstoragemgmtd stop > /dev/null 2>&1 || : - /sbin/chkconfig --del libstoragemgmtd -%endif -fi +%systemd_preun libstoragemgmt.service %postun /sbin/ldconfig -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 - # On upgrade (not uninstall), optionally, restart the daemon - /bin/systemctl try-restart libstoragemgmt.service >/dev/null 2>&1 || : -%else - #Restart the daemond - /etc/rc.d/init.d/libstoragemgmtd restart >/dev/null 2>&1 || : -%endif -fi +%systemd_postun libstoragemgmt.service %files %defattr(-,root,root,-) @@ -221,18 +189,12 @@ fi %{_bindir}/lsmd %{_bindir}/simc_lsmplugin -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %{_unitdir}/* -%endif %dir %attr(0755, libstoragemgmt, libstoragemgmt) %{_localstatedir}/run/lsm/ %dir %attr(0755, libstoragemgmt, libstoragemgmt) %{_localstatedir}/run/lsm/ipc -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -%attr(0644, root, root) %{_sysconfdir}/tmpfiles.d/%{name}.conf -%else -%attr(0755, root, root) /etc/rc.d/init.d/libstoragemgmtd -%endif +%attr(0644, root, root) %{_tmpfilesdir}/%{name}.conf %files devel %defattr(-,root,root,-) @@ -243,56 +205,97 @@ fi %files python %defattr(-,root,root,-) #Python library files +%dir %{python_sitelib}/lsm %{python_sitelib}/lsm/__init__.* +%dir %{python_sitelib}/lsm/external %{python_sitelib}/lsm/external/* -%{python_sitelib}/lsm/client.* -%{python_sitelib}/lsm/cmdline.* -%{python_sitelib}/lsm/common.* -%{python_sitelib}/lsm/data.* -%{python_sitelib}/lsm/iplugin.* -%{python_sitelib}/lsm/pluginrunner.* -%{python_sitelib}/lsm/simulator.* -%{python_sitelib}/lsm/transport.* +%{python_sitelib}/lsm/_client.* +%{python_sitelib}/lsm/_common.* +%{python_sitelib}/lsm/_data.* +%{python_sitelib}/lsm/_iplugin.* +%{python_sitelib}/lsm/_pluginrunner.* +%{python_sitelib}/lsm/_transport.* %{python_sitelib}/lsm/version.* +%dir %{python_sitelib}/lsm/plugin +%{python_sitelib}/lsm/plugin/__init__.* +%dir %{python_sitelib}/lsm/plugin/sim +%{python_sitelib}/lsm/plugin/sim/__init__.* +%{python_sitelib}/lsm/plugin/sim/simulator.* +%{python_sitelib}/lsm/plugin/sim/simarray.* +%dir %{python_sitelib}/lsm/lsmcli +%{python_sitelib}/lsm/lsmcli/__init__.* +%{python_sitelib}/lsm/lsmcli/data_display.* +%{python_sitelib}/lsm/lsmcli/cmdline.* %{_bindir}/sim_lsmplugin %files smis-plugin %defattr(-,root,root,-) -%{python_sitelib}/lsm/eseries.* -%{python_sitelib}/lsm/smis.* -%{python_sitelib}/lsm/smisproxy.* +%dir %{python_sitelib}/lsm/plugin/smispy +%{python_sitelib}/lsm/plugin/smispy/__init__.* +%{python_sitelib}/lsm/plugin/smispy/smis.* +%{python_sitelib}/lsm/plugin/smispy/dmtf.* +%{python_sitelib}/lsm/plugin/smispy/utils.* +%{python_sitelib}/lsm/plugin/smispy/smis_common.* +%{python_sitelib}/lsm/plugin/smispy/smis_cap.* +%{python_sitelib}/lsm/plugin/smispy/smis_sys.* +%{python_sitelib}/lsm/plugin/smispy/smis_pool.* +%{python_sitelib}/lsm/plugin/smispy/smis_disk.* +%{python_sitelib}/lsm/plugin/smispy/smis_vol.* +%{python_sitelib}/lsm/plugin/smispy/smis_ag.* %{_bindir}/smispy_lsmplugin %files netapp-plugin %defattr(-,root,root,-) -%{python_sitelib}/lsm/na.* -%{python_sitelib}/lsm/ontap.* +%dir %{python_sitelib}/lsm/plugin/ontap +%{python_sitelib}/lsm/plugin/ontap/__init__.* +%{python_sitelib}/lsm/plugin/ontap/na.* +%{python_sitelib}/lsm/plugin/ontap/ontap.* %{_bindir}/ontap_lsmplugin %files targetd-plugin %defattr(-,root,root,-) -%{python_sitelib}/lsm/targetd.* +%dir %{python_sitelib}/lsm/plugin/targetd +%{python_sitelib}/lsm/plugin/targetd/__init__.* +%{python_sitelib}/lsm/plugin/targetd/targetd.* %{_bindir}/targetd_lsmplugin - -%if 0%{?fedora} || 0%{?rhel} <= 6 -%files ibm-v7k-plugin -%defattr(-,root,root,-) -%{python_sitelib}/lsm/ibmv7k.* -%{_bindir}/v7k_lsmplugin -%endif - %files nstor-plugin %defattr(-,root,root,-) -%{python_sitelib}/lsm/nstor.* +%dir %{python_sitelib}/lsm/plugin/nstor +%{python_sitelib}/lsm/plugin/nstor/__init__.* +%{python_sitelib}/lsm/plugin/nstor/nstor.* %{_bindir}/nstor_lsmplugin %files udev %defattr(-,root,root,-) -/lib/udev/scan-scsi-target -/lib/udev/rules.d/90-scsi-ua.rules +/usr/lib/udev/scan-scsi-target +/usr/lib/udev/rules.d/90-scsi-ua.rules %changelog +* Thu Dec 11 2014 Tony Asleson 1.1.0-2 +- Remove PyYAML build dependency + +* Thu Dec 4 2014 Tony Asleson 1.1.0-1 +- New upstream release + +* Mon Oct 6 2014 Tony Asleson - 1.0.0-4 +- Fix rpmdiff, error for path names + https://bugzilla.redhat.com/show_bug.cgi?id=1149368 +- Fix rpmdiff, multilib regressions + https://bugzilla.redhat.com/show_bug.cgi?id=1149371 + +* Fri Oct 3 2014 Tony Asleson - 1.0.0-3 +- Use new systemd rpm macros + https://bugzilla.redhat.com/show_bug.cgi?id=1149010 +- Place config file in correct tmpfiles.d directory + https://bugzilla.redhat.com/show_bug.cgi?id=1122087 + +* Mon Sep 8 2014 Tony Asleson - 1.0.0-2 +- Removed REST sub-package + +* Sun Sep 7 2014 Tony Asleson - 1.0.0-1 +- New upstream release + * Fri Feb 28 2014 Tony Asleson - 0.0.24-4 - https://bugzilla.redhat.com/show_bug.cgi?id=1071382