[Libvirt-cim] [PATCH 1 of 2] Add new provider - VirtualSystemMigrationSettingData

Heidi Eckhart heidieck at linux.vnet.ibm.com
Wed Feb 6 09:16:47 UTC 2008


Kaitlin Rupert wrote:
> +static CMPIStatus get_migration_sd(const CMPIObjectPath *ref,
> +                                   CMPIInstance **_inst,
> +                                   const CMPIBroker *broker,
> +                                   bool is_get_inst)
> +{
> +        CMPIInstance *inst;
> +        CMPIStatus s;
>   
Please check if you can get a connection to libvirt with the given 
classname. Otherwise you return Xen instances on a KVM only system (and 
reverse). ResourcePoolConfigurationService is already doing so (was a 
fix some days ago). Thanks.
> +
> +        inst = get_typed_instance(broker,
> +                                  CLASSNAME(ref),
> +                                  "VirtualSystemMigrationSettingData",
> +                                  NAMESPACE(ref));
> +        if (inst == NULL) {
> +                cu_statusf(broker, &s,
> +                           CMPI_RC_ERR_FAILED,
> +                           "Unable to get instance for %s", CLASSNAME(ref));
> +                goto out;
> +        }
> +
> +        CMSetProperty(inst, "InstanceID",
> +                      (CMPIValue *)"MigrationSettingData", CMPI_chars);
> +
> +        s = set_properties(broker, inst);
> +
> +        if (s.rc != CMPI_RC_OK)
> +            goto out;
> +
> +        if (is_get_inst) {
> +                s = cu_validate_ref(broker, ref, inst);
> +                if (s.rc != CMPI_RC_OK)
> +                        goto out;
> +        }
> +
> +        *_inst = inst;
> +
> + out:
> +        return s;
> +}
> +
Besides this tiny thing ... great ! :)

-- 
Regards

Heidi Eckhart
Software Engineer
IBM Linux Technology Center - Open Hypervisor




More information about the Libvirt-cim mailing list