# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1203509638 -3600
# Node ID 163ff2951cfcabe676535d6fcfe1c84f65271ba4
# Parent 4a89baa025dfffc42cdd5f15c725b7b42fcb1212
SDS: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 4a89baa025df -r 163ff2951cfc src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Wed Feb 20 13:01:11 2008 +0100
+++ b/src/Virt_SettingsDefineState.c Wed Feb 20 13:13:58 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,