[Libvirt-cim] [PATCH 2 of 3] Move get_disk_pool() to Virt_DevicePool.h from SDC

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Aug 25 15:47:59 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1251215156 25200
# Node ID 5253dd03a6588d6856aa30fdbb385c3325d0fed1
# Parent  cb562e877b51e5a5811080f47c657ec64b9b7918
Move get_disk_pool() to Virt_DevicePool.h from SDC

Also, fix the #ifndef in pool_parsing.h - otherwise, there are redeclaration
conflicts during build.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r cb562e877b51 -r 5253dd03a658 libxkutil/pool_parsing.h
--- a/libxkutil/pool_parsing.h	Mon Aug 24 16:14:41 2009 -0700
+++ b/libxkutil/pool_parsing.h	Tue Aug 25 08:45:56 2009 -0700
@@ -18,7 +18,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  */
-#ifndef __RES_POOLS_H_
+#ifndef __RES_POOLS_H
 #define __RES_POOLS_H
 
 #include <stdint.h>
diff -r cb562e877b51 -r 5253dd03a658 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c	Mon Aug 24 16:14:41 2009 -0700
+++ b/src/Virt_DevicePool.c	Tue Aug 25 08:45:56 2009 -0700
@@ -92,6 +92,26 @@
 
 
 #if VIR_USE_LIBVIRT_STORAGE
+int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool)
+{
+        char *xml;
+        int ret;
+
+        xml = virStoragePoolGetXMLDesc(poolptr, 0);
+        if (xml == NULL)
+                return 0;
+
+        *pool = malloc(sizeof(**pool));
+        if (*pool == NULL)
+                return 0;
+
+        ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK);
+
+        free(xml);
+
+        return ret;
+}
+
 static int get_diskpool_config(virConnectPtr conn,
                                struct tmp_disk_pool **_pools)
 {
diff -r cb562e877b51 -r 5253dd03a658 src/Virt_DevicePool.h
--- a/src/Virt_DevicePool.h	Mon Aug 24 16:14:41 2009 -0700
+++ b/src/Virt_DevicePool.h	Tue Aug 25 08:45:56 2009 -0700
@@ -26,6 +26,8 @@
 #include <libcmpiutil/libcmpiutil.h>
 #include <stdint.h>
 
+#include "pool_parsing.h"
+
 /**
  * Get the InstanceID of a pool that a given RASD id (for type) is in
  *
@@ -133,6 +135,15 @@
                                   uint16_t type,
                                   CMPIStatus *status);
 
+/**
+ * Get the configuration settings of a given storage pool 
+ *
+ * @param poolptr A pointer to the given storage pool 
+ * @param pool A struct to hold the configuration settings of the storage pool 
+ * @returns An int that indicates whether the function was successful 
+ */
+int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool);
+
 #endif
 
 /*
diff -r cb562e877b51 -r 5253dd03a658 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c	Mon Aug 24 16:14:41 2009 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c	Tue Aug 25 08:45:56 2009 -0700
@@ -1027,26 +1027,6 @@
 }
 
 #if VIR_USE_LIBVIRT_STORAGE
-static int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool)
-{
-        char *xml;
-        int ret;
-
-        xml = virStoragePoolGetXMLDesc(poolptr, 0);
-        if (xml == NULL)
-                return 0;
-
-        *pool = malloc(sizeof(**pool));
-        if (*pool == NULL)
-                return 0;
-
-        ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK);
-
-        free(xml);
-
-        return ret;
-}
-
 static CMPIStatus new_volume_template(const CMPIObjectPath *ref,
                                       int template_type,
                                       virStoragePoolPtr poolptr,




More information about the Libvirt-cim mailing list