# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1201773719 -3600
# Node ID 6cd2c98c9dc6cac1b1fe88a4f486a59952051bdc
# Parent aeff601277c84629df5ab6d61174409134692215
Device: SystemCreationClassName not set in key properties
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r aeff601277c8 -r 6cd2c98c9dc6 src/Virt_Device.c
--- a/src/Virt_Device.c Thu Jan 31 11:00:53 2008 +0100
+++ b/src/Virt_Device.c Thu Jan 31 11:01:59 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,20 @@ 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);
+ virConnectClose(conn);
+ }
return 1;
}