From: Dave H. <hel...@us...> - 2013-03-07 06:06:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcb - Small Footprint CIM Broker". The branch, master has been updated via e94199e0c0ef04862ebf71fd217e7e9e5bec168d (commit) from 380537de398cf5fe9467429444b3801008a06a13 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e94199e0c0ef04862ebf71fd217e7e9e5bec168d Author: Dave Heller <hel...@us...> Date: Thu Mar 7 01:01:18 2013 -0500 [sfcb-tix:#6] SFCB XML Parser Error with Instance as Parameter ----------------------------------------------------------------------- Summary of changes: cimXmlGen.c | 7 +++++++ cimXmlOps.y | 46 ++++++++++++++++++++++++++++++++++++++++++---- cimXmlParser.c | 9 +++------ cimXmlParser.h | 6 ++++++ 4 files changed, 58 insertions(+), 10 deletions(-) diff --git a/cimXmlGen.c b/cimXmlGen.c index d573a39..fd3e32d 100644 --- a/cimXmlGen.c +++ b/cimXmlGen.c @@ -485,8 +485,15 @@ str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference * ref, getKeyValueTypePtr("ref", NULL, ref, &value, &t, ns); break; case CMPI_instance: + /* + * TODO: Properly support PARAMVALUE subelements INSTANCE, INSTANCENAME, + * VALUE.NAMEDINSTANCE, in addition to EmbeddedInstance. + */ value = makeFromEmbeddedObject(val, ns); break; + case CMPI_class: + /* TODO: Properly support PARAMVALUE subelements CLASS, CLASSNAME. */ + break; default: mlogf(M_ERROR, M_SHOW, "%s(%d): invalid value %d-%p\n", __FILE__, __LINE__, (int) type, val); diff --git a/cimXmlOps.y b/cimXmlOps.y index 7317fb7..09cacbf 100644 --- a/cimXmlOps.y +++ b/cimXmlOps.y @@ -1422,10 +1422,12 @@ buildInvokeMethodRequest(void *parm) for (p = req->paramValues.first; p; p = p->next) { /* - * Update untyped params (p->type==0) and verify those that were - * specified + * Update untyped params (p->type==0) and verify those that were specified. + * (Unlikely to be untyped at this point. Even if no paramtype is given in + * the XML, the rule actions would assign one.) */ - if (p->type == 0 || p->type == CMPI_ARRAY || vmpt) { + if (p->type == 0 || p->type == CMPI_ARRAY || p->type == CMPI_class || + p->type == CMPI_instance || vmpt) { rc = updateMethodParamTypes(hdr); if (rc != CMPI_RC_OK) { @@ -1435,7 +1437,10 @@ buildInvokeMethodRequest(void *parm) return; } } - + /* + * TODO: Add support for PARAMVALUE subelements CLASS, CLASSNAME, INSTANCE, + * INSTANCENAME, VALUE.NAMEDINSTANCE, in addition to EmbeddedInstance. + */ if (p->value.value) { CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, req->op.nameSpace.data, &st); if (st.rc) { @@ -1545,6 +1550,11 @@ updateMethodParamTypes(RequestHdr * hdr) // fprintf(stderr, " is EmbeddedInstance\n"); isEI = 1; break; + /* + * TODO: For PARAMVALUE subelements CLASS, CLASSNAME, INSTANCE, + * INSTANCENAME, VALUE.NAMEDINSTANCE, we probably want to skip + * the below repository check as well. + */ } } if (isEI) @@ -1554,6 +1564,7 @@ updateMethodParamTypes(RequestHdr * hdr) if ((ptok->type == 0) || (ptok->type == CMPI_ARRAY)) { /* * Type was unknown, fill it in + * (unlikely at this point, see comment in buildInvokeMethodRequest) */ // printf("parameter %s missing type, using %s\n", sname, // paramType(pdata.type)); @@ -2256,6 +2267,33 @@ paramValue $$.valueRefArray=$2; $$.type=CMPI_ARRAY | CMPI_ref; } + /* Support new subelements in DSP0201 v2.3.1 */ + | XTOK_PARAMVALUE className ZTOK_PARAMVALUE + { + $$.className=$2; + if (!$$.type) $$.type=CMPI_class; /* should this be CMPI_string? */ + } + | XTOK_PARAMVALUE instanceName ZTOK_PARAMVALUE + { + $$.instanceName=$2; + if (!$$.type) $$.type=CMPI_instance; + } + | XTOK_PARAMVALUE class ZTOK_PARAMVALUE + { + //$$.class=$2; + if (!$$.type) $$.type=CMPI_class; + } + | XTOK_PARAMVALUE instance ZTOK_PARAMVALUE + { + $$.instance=$2; + if (!$$.type) $$.type=CMPI_instance; + } + | XTOK_PARAMVALUE namedInstance ZTOK_PARAMVALUE + { + $$.namedInstance=$2; + /* should we ignore paramtype from the XML and always set to CMPI_instance? */ + if (!$$.type) $$.type=CMPI_instance; + } ; /* diff --git a/cimXmlParser.c b/cimXmlParser.c index 1816d08..c154da5 100644 --- a/cimXmlParser.c +++ b/cimXmlParser.c @@ -487,6 +487,9 @@ static Types types[] = { {"datetime", CMPI_dateTime}, {"real32", CMPI_real32}, {"real64", CMPI_real64}, + {"reference", CMPI_ref}, + {"class", CMPI_class}, + {"instance", CMPI_instance}, {NULL} }; @@ -734,12 +737,6 @@ procParamValue(YYSTYPE * lvalp, ParserControl * parm) break; } } - // is this right? why isn't reference covered by the types array - // in the loop above? - if (lvalp->xtokParamValue.type == 0) { - if (strcasecmp(attr[1].attr, "reference") == 0) - lvalp->xtokParamValue.type = CMPI_ref; - } } if (attr[2].attr) { if (strcasecmp(attr[2].attr, "instance") == 0 diff --git a/cimXmlParser.h b/cimXmlParser.h index 7c752f2..db39e94 100644 --- a/cimXmlParser.h +++ b/cimXmlParser.h @@ -278,6 +278,12 @@ typedef struct xtokParamValue { XtokValueReference valueRef; XtokValueArray valueArray; XtokValueRefArray valueRefArray; + /* Support new subelements in DSP0201 v2.3.1 */ + char *className; + XtokInstanceName instanceName; +// XtokClass class; /* FIXME resolve circular dependency */ + XtokInstance instance; + XtokNamedInstance namedInstance; }; } XtokParamValue; hooks/post-receive -- sfcb - Small Footprint CIM Broker |