[Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance()

Jay Gagnon grendel at linux.vnet.ibm.com
Wed Nov 21 18:37:24 UTC 2007


Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1195662213 28800
> # Node ID ad925c6e9bf0635e79c2b6e45698d11ede760d99
> # Parent  5c0b219865cd675d54d4a13230c549be93a4d144
> Remove static from get_rasd_instance()
>
> Add get_rasd_instance() declaration to header file.  Also add an additional broker argument so other providers can call this function.
>
> Fixed minor mem leak in GetInstance().
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 5c0b219865cd -r ad925c6e9bf0 src/Virt_RASD.c
> --- a/src/Virt_RASD.c	Wed Nov 21 08:17:31 2007 -0800
> +++ b/src/Virt_RASD.c	Wed Nov 21 08:23:33 2007 -0800
> @@ -177,10 +177,11 @@ static CMPIInstance *rasd_from_vdev(cons
>          return inst;
>  }
>
> -static CMPIInstance *get_rasd_instance(const CMPIContext *context,
> -                                       const CMPIObjectPath *ref,
> -                                       const char *id,
> -                                       const uint16_t type)
> +CMPIInstance *get_rasd_instance(const CMPIContext *context,
> +                                const CMPIObjectPath *ref,
> +                                const CMPIBroker *broker,
> +                                const char *id,
> +                                const uint16_t type)
>  {
>          CMPIInstance *inst = NULL;
>          CMPIStatus s;
> @@ -194,13 +195,13 @@ static CMPIInstance *get_rasd_instance(c
>          if (!ret)
>                  return NULL;
>
> -        conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
> +        conn = connect_by_classname(broker, CLASSNAME(ref), &s);
>          if (conn == NULL)
>                  goto out;
>
>          dev = find_dev(conn, type, host, devid);
>          if (dev)
> -                inst = rasd_from_vdev(_BROKER, dev, host, ref);
> +                inst = rasd_from_vdev(broker, dev, host, ref);
>
>   out:
>          virConnectClose(conn);
> @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan
>                  goto out;
>          }
>
> -        inst = get_rasd_instance(context, ref, id, type);
> +        inst = get_rasd_instance(context, ref, _BROKER, id, type);
>   
Think you got the wrong broker there.  Should be broker, not _BROKER,
right?  Everything else looks fine.  Assuming that _BROKER gets taken
care of, it's +1 from me.

-- 

-Jay




More information about the Libvirt-cim mailing list