[Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Thu Nov 29 18:56:45 UTC 2007
Heidi Eckhart wrote:
> diff -r 3b849faf8ee1 -r 559a1c5a5840 src/Virt_SettingsDefineCapabilities.c
> --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:44:46 2007 +0100
> +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:50:36 2007 +0100
> @@ -811,16 +811,17 @@ static CMPIInstance *make_ref(const CMPI
> struct std_assoc_info *info,
> struct std_assoc *assoc)
> {
> - CMPIInstance *refinst;
> - char *base;
> -
> - base = class_base_name(assoc->assoc_class);
> - if (base == NULL)
> + CMPIStatus s = {CMPI_RC_OK, NULL};
> + CMPIInstance *refinst = NULL;
> + virConnectPtr conn = NULL;
> +
> + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
> + if (conn == NULL)
> return NULL;
>
> refinst = get_typed_instance(_BROKER,
> - CLASSNAME(ref),
> - base,
> + pfx_from_conn(conn),
> + "SettingsDefineCapabilities",
> NAMESPACE(ref));
>
> if (refinst != NULL) {
> @@ -834,32 +835,50 @@ static CMPIInstance *make_ref(const CMPI
> (CMPIValue *)&instop, CMPI_ref);
> }
>
> - free(base);
> + virConnectClose(conn);
>
> return refinst;
> }
Would it be possible to break these changes out into a separate patch as
well? Good job catching these - I think there's enough for a
connect_by_classname() patchset. =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
More information about the Libvirt-cim
mailing list