[Libvirt-cim] [PATCH 1 of 2] Add get_alloc_cap_by_id() external function to AC

Dan Smith danms at us.ibm.com
Fri Apr 25 16:12:13 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1209139918 25200
# Node ID 18e2b29c6d95ebc4f549e7332ce62d62526eb5ce
# Parent  792eef56fcd585d50bbb287cf36cf31c1cdd5367
Add get_alloc_cap_by_id() external function to AC

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 792eef56fcd5 -r 18e2b29c6d95 src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c	Fri Apr 25 09:11:49 2008 -0700
+++ b/src/Virt_AllocationCapabilities.c	Fri Apr 25 09:11:58 2008 -0700
@@ -147,6 +147,21 @@ CMPIStatus enum_alloc_cap_instances(cons
         return s;
 }
 
+CMPIStatus get_alloc_cap_by_id(const CMPIBroker *broker,
+                               const CMPIObjectPath *ref,
+                               const char *poolid,
+                               CMPIInstance **inst)
+{
+        CMPIInstance *pool;
+        CMPIStatus s;
+
+        s = get_pool_by_name(broker, ref, poolid, &pool);
+        if ((pool == NULL) || (s.rc != CMPI_RC_OK))
+                return s;
+
+        return ac_from_pool(broker, ref, pool, inst);
+}
+
 static CMPIStatus return_alloc_cap_instances(const CMPIBroker *broker,
                                              const CMPIObjectPath *ref,
                                              const CMPIResult *results,
diff -r 792eef56fcd5 -r 18e2b29c6d95 src/Virt_AllocationCapabilities.h
--- a/src/Virt_AllocationCapabilities.h	Fri Apr 25 09:11:49 2008 -0700
+++ b/src/Virt_AllocationCapabilities.h	Fri Apr 25 09:11:58 2008 -0700
@@ -40,6 +40,11 @@ CMPIStatus enum_alloc_cap_instances(cons
                                     const char *id,
                                     struct inst_list *list);
 
+CMPIStatus get_alloc_cap_by_id(const CMPIBroker *broker,
+                               const CMPIObjectPath *ref,
+                               const char *poolid,
+                               CMPIInstance **inst);
+
 #endif
 
 /*




More information about the Libvirt-cim mailing list