[Libvirt-cim] [PATCH 1 of 3] * Created a new function in the Virt_KVMRedirectionSAP.c called enum_console_saps()

Dan Smith danms at us.ibm.com
Mon Dec 1 15:45:40 UTC 2008


RM> -static CMPIStatus return_console_sap(const CMPIObjectPath *ref,
RM> -                                     const CMPIResult *results,
RM> -                                     bool names_only)
RM> +static CMPIStatus enum_console_saps(const CMPIObjectPath *ref,
RM> +                                    const CMPIResult *results,
RM> +                                    bool names_only)
RM> +{
RM> +        CMPIStatus s = {CMPI_RC_OK, NULL};
RM> +        struct inst_list list;
RM> +
RM> +        inst_list_init(&list);
RM> +
RM> +        s = return_console_sap(_BROKER, ref, &list);
RM> +        if (s.rc != CMPI_RC_OK)
RM> +                goto out;
RM> +
RM> +        if (names_only)
RM> +                cu_return_instance_names(results, &list);
RM> +        else
RM> +                cu_return_instances(results, &list);
RM> +
RM> + out:
RM> +        inst_list_free(&list);
RM> +        return s;
RM> +}

I didn't catch this before, but your terminology is a bit reversed in
this patch.  In all of our other instance providers that behave like
this, the enum function is the one that populates an inst_list.  The
return_foo() function calls the enum function and does the actual
return action to the results object.

Also, the return function should be below the enum function in the
file.

I think it's worth getting it straight before we put this in, for the
sake of consistency.

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




More information about the Libvirt-cim mailing list