[Libvirt-cim] [PATCH 3 of 3] Device: SystemCreationClassName not set in key properties

Jay Gagnon grendel at linux.vnet.ibm.com
Wed Jan 30 13:59:03 UTC 2008


Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> # Date 1201696056 -3600
> # Node ID 06f194fc249857f9d523583873065d3417ea5784
> # Parent  0a2eafae729edda6f4cd12171fd28d7fbf5b1c16
> Device: SystemCreationClassName not set in key properties
> Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>
>
> diff -r 0a2eafae729e -r 06f194fc2498 src/Virt_Device.c
> --- a/src/Virt_Device.c	Wed Jan 30 12:58:24 2008 +0100
> +++ b/src/Virt_Device.c	Wed Jan 30 13:27:36 2008 +0100
> @@ -84,15 +84,6 @@ static int net_set_hwaddr(CMPIInstance *
>          return 1;
>  }
>
> -static int net_set_systemname(CMPIInstance *instance,
> -                              const char *domain)
> -{
> -        CMSetProperty(instance, "SystemName",
> -                      (CMPIValue *)domain, CMPI_chars);
> -
> -        return 1;
> -}
> -
>  static CMPIInstance *net_instance(const CMPIBroker *broker,
>                                    struct net_device *dev,
>                                    const virDomainPtr dom,
> @@ -111,9 +102,6 @@ static CMPIInstance *net_instance(const 
>                  return NULL;
>
>          if (!net_set_hwaddr(inst, dev, broker))
> -                return NULL;
> -
> -        if (!net_set_systemname(inst, virDomainGetName(dom)))
>                  return NULL;
>
>          return inst;        
> @@ -224,8 +212,19 @@ static int device_set_systemname(CMPIIns
>  static int device_set_systemname(CMPIInstance *instance,
>                                   const virDomainPtr dom)
>  {
> +        virConnectPtr conn = NULL;
> +
>          CMSetProperty(instance, "SystemName",
>                        (CMPIValue *)virDomainGetName(dom), CMPI_chars);
> +
> +        conn = virDomainGetConnect(dom);
> +        if (conn) {
> +                char *sccn = NULL;
> +                sccn = get_typed_class(pfx_from_conn(conn), "ComputerSystem");
> +                CMSetProperty(instance, "SystemCreationClassName",
> +                              (CMPIValue *)sccn, CMPI_chars);
> +                free(sccn);
> +        }
>
>          return 1;
>  }
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>   
I'm sure this is just my CIM ignorance showing here, but is
ComputerSystem the right base class name there? Isn't this for Device?
Also, looks like you forgot the virConnectClose() for that new conn.

Other two in the set look good.

-- 

-Jay




More information about the Libvirt-cim mailing list