# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197677158 28800
# Node ID 552b27c0e224e278d9b8c12e39b45808667345c1
# Parent 889611ecea877bb54fad494ece56b2e7fac2b98e
Clean up unneeded functions in AC.
Now that GetInstance is calling alloc_cap_instances(), get_alloc_cap() and
return_alloc_cap() are no longer needed.
This removes the need for Virt_AllocationCapabilities.h
Also clean up lengthy function calls.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 889611ecea87 -r 552b27c0e224 src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c Fri Dec 14 16:05:54 2007 -0800
+++ b/src/Virt_AllocationCapabilities.c Fri Dec 14 16:05:58 2007 -0800
@@ -31,66 +31,9 @@
#include "misc_util.h"
-#include "Virt_AllocationCapabilities.h"
-#include "Virt_RASD.h"
#include "Virt_DevicePool.h"
const static CMPIBroker *_BROKER;
-
-CMPIStatus get_alloc_cap(const CMPIBroker *broker,
- const CMPIObjectPath *ref,
- CMPIInstance **inst)
-{
- CMPIStatus s = {CMPI_RC_OK, NULL};
- char *inst_id;
- uint16_t type;
- int ret;
-
- *inst = get_typed_instance(broker,
- CLASSNAME(ref),
- "AllocationCapabilities",
- NAMESPACE(ref));
-
- if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Could not get ResourceType");
- goto out;
- }
-
- ret = asprintf(&inst_id, "%hi/%s", type, "0");
- if (ret == -1) {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Could not get InstanceID");
- goto out;
- }
-
- CMSetProperty(*inst, "InstanceID", inst_id, CMPI_chars);
- CMSetProperty(*inst, "ResourceType", &type, CMPI_uint16);
-
- out:
- return s;
-}
-
-static CMPIStatus return_alloc_cap(const CMPIObjectPath *ref,
- const CMPIResult *results,
- int names_only)
-{
- CMPIStatus s = {CMPI_RC_OK, NULL};
- CMPIInstance *inst = NULL;
-
- s = get_alloc_cap(_BROKER, ref, &inst);
- if (s.rc != CMPI_RC_OK)
- goto out;
-
- if (names_only)
- cu_return_instance_name(results, inst);
- else
- CMReturnInstance(results, inst);
- out:
- return s;
-}
static CMPIStatus ac_from_pool(const CMPIBroker *broker,
const CMPIObjectPath *ref,
@@ -231,7 +174,12 @@ static CMPIStatus EnumInstanceNames(CMPI
const CMPIResult *results,
const CMPIObjectPath *reference)
{
- return alloc_cap_instances(_BROKER, reference, results, true, NULL, NULL);
+ return alloc_cap_instances(_BROKER,
+ reference,
+ results,
+ true,
+ NULL,
+ NULL);
}
static CMPIStatus EnumInstances(CMPIInstanceMI *self,
@@ -240,7 +188,12 @@ static CMPIStatus EnumInstances(CMPIInst
const CMPIObjectPath *reference,
const char **properties)
{
- return alloc_cap_instances(_BROKER, reference, results, false, properties,
NULL);
+ return alloc_cap_instances(_BROKER,
+ reference,
+ results,
+ false,
+ properties,
+ NULL);
}
DEFAULT_CI();
diff -r 889611ecea87 -r 552b27c0e224 src/Virt_AllocationCapabilities.h
--- a/src/Virt_AllocationCapabilities.h Fri Dec 14 16:05:54 2007 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright IBM Corp. 2007
- *
- * Authors:
- * Jay Gagnon <grendel(a)linux.vnet.ibm.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-CMPIStatus get_alloc_cap(const CMPIBroker *broker,
- const CMPIObjectPath *ref,
- CMPIInstance **inst);
-/*
- * Local Variables:
- * mode: C
- * c-set-style: "K&R"
- * tab-width: 8
- * c-basic-offset: 8
- * indent-tabs-mode: nil
- * End:
- */