Review Request 184: openlmi-networking coverity [5/5] Do proper error handling when return instance fails

Roman Rakus reviewboard at gallagherhome.com
Thu Apr 11 12:48:52 UTC 2013



> On April 11, 2013, 12:14 p.m., Roman Rakus wrote:
> > Can you describe why is this needed? What is wrong with KReturn? Shouldn't be this fixed in KonkreteCMPI?
> > In `error("Unable to return instance of class LMI_BindsToLANEndpoint");' you can use macro for class name. So when you will change class name, you will get compile-time error. If you use hardcoded name, it could be false name.
> 
> Radek Novacek wrote:
>     Initial motivation of this change is implementation of KReturnInstance macro:     
>     
>     #define KReturnInstance(RESULT, INSTANCE) \
>     do \
>         { \
>             CMPIStatus status = __KReturnInstance((RESULT), &(INSTANCE).__base); \
>             if (!KOkay(status)) \
>                 return status; \
>         } \
>         while (0)
>     
>     When something goes wrong, it just returns from the function without possibility of deinitialization (free memory, detailed error reporting, etc.) - mainly calling network_unlock in this case.
>     
>     What macro for class name do you mean?

Oh... it makes KReturnInstance() less intuitive and usable.

The macro is like SOMECLASS_ClassName. For `LMI_BindsToLANEndpoint' it is `LMI_BindsToLANEndpoint_ClassName'.


- Roman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/184/#review192
-----------------------------------------------------------


On April 11, 2013, 9:07 a.m., Radek Novacek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard-openlmi.rhcloud.com/r/184/
> -----------------------------------------------------------
> 
> (Updated April 11, 2013, 9:07 a.m.)
> 
> 
> Review request for OpenLMI Developers.
> 
> 
> Repository: openlmi-networking
> 
> 
> Description
> -------
> 
> Do proper error handling when return instance fails
> 
> 
> Diffs
> -----
> 
>   src/LMI_BindsToLANEndpointProvider.c b273f83828f2e57b6906f2987b3cae268f7f6a0f 
>   src/LMI_DHCPSettingDataProvider.c 032933d726cb557e4768bf5e6854de9d9bf2d66b 
>   src/LMI_DNSProtocolEndpointProvider.c 227ab615a893da9963cf2c84d0d7eda396fa74ba 
>   src/LMI_DNSSettingDataProvider.c 8292afd216145eddb3cdcb0857ab15217d3726e5 
>   src/LMI_EndpointForIPNetworkConnectionProvider.c 86e040eb8fbc25197318abf89780d60b121e19da 
>   src/LMI_EthernetPortProvider.c b16b7e1c1237ba0b4d1ef830cc79d1a394d92bc9 
>   src/LMI_EthernetPortStatisticsProvider.c 9aa855b533a77fb127c75a56310e9d73523fb2b3 
>   src/LMI_ExtendedStaticIPAssignmentSettingDataProvider.c c0500515de89abff407b8b52bc6151d4c2d6be64 
>   src/LMI_HostedIPConfigurationServiceProvider.c f1ab7e588908641a6e10820b480f36f2838ea010 
>   src/LMI_IPAssignmentSettingDataProvider.c c3b632c49378233432945cbb8bd3f215425b96ae 
>   src/LMI_IPConfigurationServiceAffectsElementProvider.c a9256742ea4bcd61ad999898c43bb75002a74d11 
>   src/LMI_IPConfigurationServiceProvider.c 14af9e65aa0948955a551ac1edce1f5262a28588 
>   src/LMI_IPElementSettingDataProvider.c 11a322f6e313fcadc41bce8214c7bc77115a1847 
>   src/LMI_IPNetworkConnectionProvider.c b63f7678de11dbac939c107a44f1d269da3554c0 
>   src/LMI_IPProtocolEndpointProvider.c 513cebfc77952e7daca433dd8c01a02f340c9c3d 
>   src/LMI_IPVersionElementSettingDataProvider.c 67cc0edcb638e72ab566a6113787770042f868e0 
>   src/LMI_IPVersionSettingDataProvider.c 04aae1eac6afe594a63e920797da61c9ccc76bf2 
>   src/LMI_LAGPort8023adProvider.c b7554a8a7faf91685bf1bb759f39cb8aa86ffd09 
>   src/LMI_LANEndpointProvider.c 2b7b8b64f690644c3c5feb3702b4f2fb642b01cd 
>   src/LMI_LinkAggregationBindsToProvider.c ba2c5ce9699267d75e0c1211da8f5137082db867 
>   src/LMI_LinkAggregationConcreteIdentityProvider.c 91b135503daf66a4649974c7fc6c15c018404566 
>   src/LMI_LinkAggregator8023adProvider.c b9e8f177ab29a620e21323b255732971c08312a9 
>   src/LMI_NetworkDeviceSAPImplementationProvider.c 6e29d2c913a6450c565c952790a8e34f15ed8096 
>   src/LMI_NetworkElementCapabilitiesProvider.c 1c6146ac7cbc7ce2d4607d6d79baceca15fda519 
>   src/LMI_NetworkEnabledLogicalElementCapabilitiesProvider.c 9b5b2b90cfe1ba9442458eca26bd92e63c99d482 
>   src/LMI_NetworkHostedAccessPointProvider.c f1da7df3cc9eded1a61a2d1fd1024334a3d3a943 
>   src/LMI_NetworkRemoteAccessAvailableToElementProvider.c 11c076f98b7c282742fa3954a29cc883892a8509 
>   src/LMI_NetworkRemoteServiceAccessPointProvider.c 1dce18d88c310ded20323db9a506a34cf534d4ec 
>   src/LMI_NetworkSAPSAPDependencyProvider.c 3440fd49735006477f108b01116bd17d891c45c1 
>   src/LMI_NetworkSystemDeviceProvider.c 50c4227bdf3fbeeb1aa4299e131e8d7a24ee2d89 
>   src/LMI_OrderedIPAssignmentComponentProvider.c 9d3a92e6c6cf3e02a706c15e2509783e6fc4b252 
>   src/globals.h 59162c9ebd447734287a7a4e94c3cc2de5d46b6c 
> 
> Diff: http://reviewboard-openlmi.rhcloud.com/r/184/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Radek Novacek
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/openlmi-devel/attachments/20130411/c1d39493/attachment.html>


More information about the openlmi-devel mailing list