# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196242330 -3600
# Node ID 99b7a3180bca444d3670a9f6295e47a920b1da11
# Parent 82a65502cfb3814efe409879675f486d6f282c7d
Adoption of changes to RegisteredProfile
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 82a65502cfb3 -r 99b7a3180bca src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:07:55 2007 +0100
+++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:32:10 2007 +0100
@@ -133,9 +133,14 @@ static CMPIStatus elem_to_prof(const CMP
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *instance;
+ virConnectPtr conn = NULL;
char *classname;
struct reg_prof *candidate;
int i;
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL)
+ return s;
classname = class_base_name(CLASSNAME(ref));
if (classname == NULL) {
@@ -151,10 +156,12 @@ static CMPIStatus elem_to_prof(const CMP
instance = reg_prof_instance(_BROKER,
"/root/interop",
- NULL,
+ NULL,
+ conn,
candidate);
if (instance == NULL) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
+ CMSetStatusWithChars(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
"Can't create profile
instance.");
goto error;
}
@@ -165,6 +172,8 @@ static CMPIStatus elem_to_prof(const CMP
error:
free(classname);
out:
+ virConnectClose(conn);
+
return s;
}