[Libvirt-cim] [PATCH 2 of 2] Added ServiceAccessBySAP association (ConsoleRedirectionService <-> KVMRedirectionSAP)

Dan Smith danms at us.ibm.com
Thu Dec 4 16:45:20 UTC 2008


RM> +static CMPIStatus service_to_rsap(const CMPIObjectPath *ref,
RM> +                                  struct std_assoc_info *info,
RM> +                                  struct inst_list *list)
RM> +{
RM> +        CMPIStatus s = {CMPI_RC_OK, NULL};
RM> +        CMPIInstance *instance = NULL;
RM> +        char* classname;
RM> +
RM> +        if (!STARTS_WITH(CLASSNAME(ref), "Linux_") &&
RM> +            !match_hypervisor_prefix(ref, info))
RM> +                goto out;

This association doesn't accept any classes that use a Linux_ prefix,
so the test for it should be removed.

RM> +        classname = class_base_name(CLASSNAME(ref));
RM> +
RM> +        if (!STREQC(classname, "ConsoleRedirectionService")) 
RM> +                goto out;        
RM> +
RM> +        s = get_console_rs(ref, &instance, _BROKER, info->context, true);
RM> +        if (s.rc != CMPI_RC_OK)
RM> +                goto out;
RM> +
RM> +        s = enum_console_sap(_BROKER, ref, list); 
RM> +        if (s.rc != CMPI_RC_OK)
RM> +                goto out;

The status check and goto are not necessary.

RM> +
RM> + out:
RM> +        return s;
RM> +}
RM> +
RM> +static CMPIStatus rsap_to_service(const CMPIObjectPath *ref,
RM> +                                  struct std_assoc_info *info,
RM> +                                  struct inst_list *list)
RM> +{
RM> +        CMPIStatus s = {CMPI_RC_OK, NULL};
RM> +        CMPIInstance *instance = NULL;
RM> +
RM> +        if (!STARTS_WITH(CLASSNAME(ref), "Linux_") &&
RM> +            !match_hypervisor_prefix(ref, info))
RM> +                goto out;

Same comment here.

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com




More information about the Libvirt-cim mailing list