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

Heidi Eckhart heidieck at linux.vnet.ibm.com
Wed Jan 30 19:19:49 UTC 2008


Jay Gagnon wrote:
> Heidi Eckhart wrote:
>   
>> @@ -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;
>>  }
>>
>>     
> 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?
>   
Its always good to have a discerning reviewer ;). What's set here is the 
system's CreationClassName. And the scoping system in that case is the 
virtual system ... our Xen/KVM_ComputerSystem. So its the key-value pair 
of ComputerSystem.
Xen/KVM_ComputerSystem.Name becomes Xen/KVM_<LogicalDevice>.SystemName
Xen/KVM_ComputerSystem.CreationClassName becomes 
Xen/KVM_<LogicalDevice>.SystemCreationClassName

> Also, looks like you forgot the virConnectClose() for that new conn.
>   
Thanks ...  a very good catch. I will resend the patch.

-- 
Regards

Heidi Eckhart
Software Engineer
IBM Linux Technology Center - Open Hypervisor




More information about the Libvirt-cim mailing list