Hi,
As a reference, ComputerSystem defined as one parameter of VirtualSystemIsMigratableToHost method,
which is parsed by passing two keys to CIMInstanceName. Below is a test example segment.
cs_ref = CIMInstanceName(classname, keybindings = {
'Name':test_dom,
'CreationClassName':classname})
service.VirtualSystemIsMigratableToHost(ComputerSystem=cs_ref,
DestinationHost=options.ip)
If the "Name" key is set "Wrong", it will report expected error "Missing key (Name) in ComputerSystem".
Then does the other key "CreationClassName" need to verify also? At now, either wrong key name
or wrong value of CreationClassName, such as "CreationClassName!@#$$$" instead of "CreationClassName"£¬
it can still return expected result. So is it a provider's bug?
Do we need to add some verification of "CreationClassName" key in provider code below? Thanks!
static CMPIStatus vs_migratable_host(CMPIMethodMI *self,
const CMPIContext *ctx,
const CMPIResult *results,
const CMPIObjectPath *ref,
const CMPIArgs *argsin,
CMPIArgs *argsout)
{
CMPIStatus s;
const char *dhost = NULL;
CMPIObjectPath *system;
const char *name = NULL;
cu_get_str_arg(argsin, "DestinationHost", &dhost);
cu_get_ref_arg(argsin, "ComputerSystem", &system);
if (cu_get_str_path(system, "Name", &name) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Missing key (Name) in ComputerSystem");
METHOD_RETURN(results, 1);
return s;
}
return vs_migratable(ref, name, dhost, results);
}
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol@cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057