# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1203670741 -3600
# Node ID bef4df9bf1109545c067010d83af3b12782632d0
# Parent 982b5aa81c2f2b2f827fd473755a8d148f0fed56
SDS: adopt interface changes in VSSD
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 982b5aa81c2f -r bef4df9bf110 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Fri Feb 22 09:58:51 2008 +0100
+++ b/src/Virt_SettingsDefineState.c Fri Feb 22 09:59:01 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,