[Libvirt-cim] VSMS method args type

Zhengang Li zli at linux.vnet.ibm.com
Tue Dec 11 07:44:29 UTC 2007


Dan,

I got this when writing the resource setting data related method test 
case for VSMS.

In DMTF cimv216Experimental, we have:
uint32 AddResourceSettings(CIM_VSSD REF AffectedConfiguration,
          string ResourceSettings[],
          CIM_RASD REF ResultingResourceSettings[],         /* out */
          CIM_ConcreteJob REF Job);            /* out */
uint32 RemoveResourceSettings(CIM_RASD REF ResourceSettings[],
          CIM_ConcreteJob REF Job);            /* out */


But in the VSMS provider, the handlers are defined as follows:
static struct method_handler AddResourceSettings = {
        .name = "AddResourceSettings",
        .handler = add_resource_settings,
        .args = {{"AffectedConfiguration", CMPI_string},      /* dmtf 
mof says CMPI_ref here */
                 {"ResourceSettings", CMPI_stringA},
                 ARG_END
        }
};
static struct method_handler RemoveResourceSettings = {
        .name = "RemoveResourceSettings",
        .handler = rm_resource_settings,
        .args = {{"ResourceSettings", CMPI_stringA},         /* dmtf mof 
says CMPI_refA here */
                 ARG_END
        }
};

And the three add/modify/remove resource settings method handler are 
using the same
helper function 'update_resource_settings' taking ResourceSettings as 
embedded instance
string array.

I think we need some code refactoring here for the three method handlers.

                                  

-- 
- Zhengang





More information about the Libvirt-cim mailing list