# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1203670731 -3600
# Node ID 982b5aa81c2f2b2f827fd473755a8d148f0fed56
# Parent bcac7f93329a9ab20f7deb1849890e136a77cf5b
ESD: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r bcac7f93329a -r 982b5aa81c2f src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c Fri Feb 22 09:58:38 2008 +0100
+++ b/src/Virt_ElementSettingData.c Fri Feb 22 09:58:51 2008 +0100
@@ -41,47 +41,20 @@ static CMPIStatus vssd_to_vssd(const CMP
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
- virConnectPtr conn = NULL;
- virDomainPtr dom = NULL;
- char *host = NULL;
-
+
if (!match_hypervisor_prefix(ref, info))
return s;
- if (!parse_instanceid(ref, NULL, &host)) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to get system name");
- goto out;
- }
-
- conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
- if (conn == NULL)
- goto out;
-
- dom = virDomainLookupByName(conn, host);
- if (dom == NULL) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No such system `%s'", host);
- goto out;
- }
-
- inst = get_vssd_instance(dom, _BROKER, ref);
- if (inst == NULL) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Error getting VSSD for `%s'", host);
- goto out;
- }
-
+ /* Special association case:
+ * VSSD instance is pointing to itself
+ */
+ s = get_vssd_by_ref(_BROKER, ref, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
inst_list_add(list, inst);
-
+
out:
- virDomainFree(dom);
- virConnectClose(conn);
- free(host);
-
return s;
}