
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1203934187 -3600 # Node ID e54e9297a7a5d5a14bcf8962ba4f36ba6a0cef2d # Parent 974c0863140b29682d450b8f9e0edec8052e1bae VSSDC: adopt interface changes in VSSD Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 974c0863140b -r e54e9297a7a5 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Mon Feb 25 11:09:46 2008 +0100 +++ b/src/Virt_VSSDComponent.c Mon Feb 25 11:09:47 2008 +0100 @@ -41,6 +41,7 @@ static CMPIStatus vssd_to_rasd(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; char *name = NULL; int i = 0; int types[] = { @@ -52,7 +53,11 @@ static CMPIStatus vssd_to_rasd(const CMP }; if (!match_hypervisor_prefix(ref, info)) - return s; + goto out; + + s = get_vssd_by_ref(_BROKER, ref, &inst); + if (s.rc != CMPI_RC_OK) + goto out; if (!parse_instanceid(ref, NULL, &name)) { cu_statusf(_BROKER, &s, @@ -69,48 +74,9 @@ static CMPIStatus vssd_to_rasd(const CMP list); } - cu_statusf(_BROKER, &s, - CMPI_RC_OK, - ""); - out: free(name); - return s; -} - -static CMPIStatus vssd_for_name(const char *host, - const CMPIObjectPath *ref, - CMPIInstance **inst) -{ - virConnectPtr conn = NULL; - virDomainPtr dom = NULL; - CMPIStatus s; - - 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); - else - cu_statusf(_BROKER, &s, - CMPI_RC_OK, - ""); out: - virDomainFree(dom); - virConnectClose(conn); - return s; } @@ -143,9 +109,11 @@ static CMPIStatus rasd_to_vssd(const CMP goto out; } - s = vssd_for_name(host, ref, &vssd); - if (vssd) - inst_list_add(list, vssd); + s = get_vssd_by_name(_BROKER, ref, host, &vssd); + if (s.rc != CMPI_RC_OK) + goto out; + + inst_list_add(list, vssd); out: free(host);