# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1203672860 -3600
# Node ID 5b9393cbce63ab45b6d5be07e1c6d5a866248ca5
# Parent 5713725abc8c466a8d621d90fe00454b7dfb3801
SDS: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 5713725abc8c -r 5b9393cbce63 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Fri Feb 22 10:34:20 2008 +0100
+++ b/src/Virt_SettingsDefineState.c Fri Feb 22 10:34:20 2008 +0100
@@ -196,18 +196,16 @@ static CMPIStatus vs_to_vssd(const CMPIO
struct std_assoc_info *info,
struct inst_list *list)
{
- virConnectPtr conn = NULL;
- virDomainPtr dom = NULL;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ CMPIInstance *inst;
const char *name;
- CMPIInstance *vssd;
- CMPIStatus s = {CMPI_RC_OK, NULL};
-
+
if (!match_hypervisor_prefix(ref, info))
return s;
-
- conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
- if (conn == NULL)
- return s;
+
+ s = get_domain(_BROKER, ref, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
if (cu_get_str_path(ref, "Name", &name) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -215,28 +213,15 @@ static CMPIStatus vs_to_vssd(const CMPIO
"Missing Name property");
goto out;
}
-
- dom = virDomainLookupByName(conn, name);
- if (dom == NULL) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No such domain `%s'", name);
- goto out;
- }
-
- vssd = get_vssd_instance(dom, _BROKER, ref);
- if (vssd != NULL)
- inst_list_add(list, vssd);
-
- cu_statusf(_BROKER, &s,
- CMPI_RC_OK,
- "");
- out:
- virDomainFree(dom);
- virConnectClose(conn);
-
+
+ s = get_vssd_by_name(_BROKER, ref, name, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(list, inst);
+
+ out:
return s;
-
}
static CMPIStatus vssd_to_vs(const CMPIObjectPath *ref,
@@ -250,9 +235,14 @@ static CMPIStatus vssd_to_vs(const CMPIO
virConnectPtr conn = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *cs;
+ CMPIInstance *inst;
if (!match_hypervisor_prefix(ref, info))
return s;
+
+ s = get_vssd_by_ref(_BROKER, ref, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,