ACK from me 4.2 patch 1 with adjustment to comment, see below.
In principle something about this flag compatibility stuff should also 
go into the README,
but we will have to take that later and separately.

/AndesBJ

Zoran Milinkovic wrote:
>  osaf/services/saf/immsv/immnd/ImmModel.cc    |  39 
> ++++++++++++++++++++++-----
>  osaf/services/saf/immsv/immnd/ImmSearchOp.cc |   2 +-
>  osaf/services/saf/immsv/immnd/ImmSearchOp.hh |   4 +-
>  3 files changed, 35 insertions(+), 10 deletions(-)
>
>
> diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
> b/osaf/services/saf/immsv/immnd/ImmModel.cc
> --- a/osaf/services/saf/immsv/immnd/ImmModel.cc
> +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
> @@ -72,7 +72,7 @@ struct AttrInfo
>  {
>      AttrInfo():mValueType(0), mFlags(0), mNtfId(0){}
>      SaUint32T       mValueType;
> -    SaUint32T       mFlags;
> +    SaImmAttrFlagsT mFlags;
>      SaUint32T       mNtfId;
>      ImmAttrValue    mDefaultValue;
>  };
> @@ -2219,6 +2219,7 @@ ImmModel::classCreate(const ImmsvOmClass
>      int illegal=0;
>      bool persistentRt = false;
>      bool persistentRdn = false;
> +    bool useUnknownFlag = false;
>      ClassInfo* classInfo = NULL;
>      ClassInfo* prevClassInfo = NULL;
>      ClassInfo dummyClass(req->classCategory);
> @@ -2423,7 +2424,10 @@ ImmModel::classCreate(const ImmsvOmClass
>              }
>          }
>          err = attrCreate(classInfo, attr, attrName);
> -        if(err != SA_AIS_OK) {
> +        if(err == SA_AIS_ERR_NOT_SUPPORTED) {
> +            useUnknownFlag = true;
> +            err = SA_AIS_OK;
> +        } else if(err != SA_AIS_OK) {
>              illegal = 1;
>          }
>          list = list->next;
> @@ -2476,6 +2480,10 @@ ImmModel::classCreate(const ImmsvOmClass
>          goto done;
>      }
>  
> +    if(useUnknownFlag) {
> +        LOG_NO("At least one attribute in class %s has unsupported attribute 
> flag", className.c_str());
> +    }
> +
>      /* All checks passed, now install the class def. */
>  
>      if(!schemaChange) {
> @@ -3054,12 +3062,29 @@ ImmModel::attrCreate(ClassInfo* classInf
>              }
>          }
>  
> -        TRACE_5("create attribute '%s'", attrName.c_str());
> +        SaImmAttrFlagsT unknownFlags = attr->attrFlags &
> +          ~(SA_IMM_ATTR_MULTI_VALUE |
> +            SA_IMM_ATTR_RDN |
> +            SA_IMM_ATTR_CONFIG |
> +            SA_IMM_ATTR_WRITABLE |
> +            SA_IMM_ATTR_INITIALIZED |
> +            SA_IMM_ATTR_RUNTIME |
> +            SA_IMM_ATTR_PERSISTENT |
> +            SA_IMM_ATTR_CACHED);
> +
> +        if(unknownFlags) {
> +            /* This error means that at least one attribute flag is not 
> supported by OpenSAF,
> +             * but because of forward compatibility, future flags must be 
> supported.
> +             */
>   
I have two problems with the comment.
First, he flag is not supported by this >>release<< of OpenSAF.
Second, its not that we must "support" future flags (contradicts that it 
is not supported by this release)
but that this release must try to "cope" with future flags by 
essentially ignoring them.
I suggest instead:

/* This error means that at least one attribute flag is not supported by this
   OpenSAF release. This release will still try to cope with such flags by 
   ignoring them (e.g. not failing to load the rest of the data). This can only
   be done if either the XSD pointed at by the file can be loaded and the
   unsupported flag is confirmed as a valid flag name in that XSD; or if the
   recognition of the unsupported flag has been hardcoded into this older 
release.
   Hardcoding is only done for non-integrity related flags such as 
SA_IMM_ATTR_NOTIFY
   and allows the flag to pass through this system (e.g. be included in a dump).
 */



> +            err = SA_AIS_ERR_NOT_SUPPORTED;
> +            TRACE_5("create attribute '%s' with unknown flag(s), attribute 
> flag: %llu", attrName.c_str(), attr->attrFlags);
> +        } else {
> +            TRACE_5("create attribute '%s'", attrName.c_str());
> +        }
>              
>          AttrInfo* attrInfo = new AttrInfo;
>          attrInfo->mValueType = attr->attrValueType;
> -        osafassert(attr->attrFlags < 0xffffffff);
> -        attrInfo->mFlags = (SaUint32T) attr->attrFlags;
> +        attrInfo->mFlags = attr->attrFlags;
>          attrInfo->mNtfId = attr->attrNtfId;
>          if(attr->attrDefaultValue) {
>              IMMSV_OCTET_STRING tmpos; //temporary octet string
> @@ -3142,13 +3167,13 @@ ImmModel::classDescriptionGet(const IMMS
>  
>  struct AttrFlagIncludes
>  {
> -    AttrFlagIncludes(SaUint32T attrFlag) : mFlag(attrFlag) { }
> +    AttrFlagIncludes(SaImmAttrFlagsT attrFlag) : mFlag(attrFlag) { }
>      
>      bool operator() (AttrMap::value_type& item) const {
>          return (item.second->mFlags & mFlag) != 0;
>      }
>      
> -    SaUint32T mFlag;
> +    SaImmAttrFlagsT mFlag;
>  };
>  
>  struct IdIs
> diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc 
> b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
> --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
> +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
> @@ -51,7 +51,7 @@ ImmSearchOp::addObject(
>  void
>  ImmSearchOp::addAttribute(const std::string& attributeName, 
>      SaUint32T valueType,
> -    SaUint32T flags)
> +    SaImmAttrFlagsT flags)
>      
>  {
>      SearchObject& obj = mResultList.back();
> diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh 
> b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
> --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
> +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
> @@ -32,7 +32,7 @@ struct SearchAttribute
>      std::string name;
>      ImmAttrValue*     valuep;
>      SaImmValueTypeT  valueType;
> -    SaUint32T flags;
> +    SaImmAttrFlagsT flags;
>  
>      ~SearchAttribute();
>  };
> @@ -63,7 +63,7 @@ public:
>      void          addAttribute(
>                                 const std::string& attributeName, 
>                                 SaUint32T valueType,
> -                               SaUint32T flags);
> +                               SaImmAttrFlagsT flags);
>      void          addAttrValue(const ImmAttrValue& value);
>      void          setImplementer(
>                                   SaUint32T conn, 
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>   


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to