[Libvirt-cim] [PATCH] Add support for iscsi storage pools

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed May 20 23:33:06 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1242695586 25200
# Node ID 9ac4e06aa21334cf25b8096663dca6fea74dccd8
# Parent  aa8e071730d2ce20064f1c0295a8005e31ef2cea
Add support for iscsi storage pools

You will need a system with iSCSI connected storage to test this

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

diff -r aa8e071730d2 -r 9ac4e06aa213 src/Virt_ResourcePoolConfigurationService.c
--- a/src/Virt_ResourcePoolConfigurationService.c	Wed May 20 10:41:46 2009 -0700
+++ b/src/Virt_ResourcePoolConfigurationService.c	Mon May 18 18:13:06 2009 -0700
@@ -179,6 +179,24 @@
         return NULL;
 }
 
+static const char *disk_iscsi_pool(CMPIInstance *inst,
+                                   struct virt_pool *pool)
+{
+        const char *val = NULL;
+
+        if (cu_get_str_prop(inst, "DevicePath", &val) != CMPI_RC_OK)
+                return "Missing `DevicePath' property";
+
+        pool->pool_info.disk.device_path = strdup(val);
+
+        if (cu_get_str_prop(inst, "Host", &val) != CMPI_RC_OK)
+                return "Missing `Host' property";
+
+        pool->pool_info.disk.host = strdup(val);
+
+        return NULL;
+}
+
 static const char *disk_rasd_to_pool(CMPIInstance *inst,
                                     struct virt_pool *pool)
 {
@@ -201,6 +219,9 @@
         case DISK_POOL_NETFS:
                 msg = disk_netfs_pool(inst, pool);
                 break;
+        case DISK_POOL_ISCSI:
+                msg = disk_iscsi_pool(inst, pool);
+                break;
         default:
                 return "Storage pool type not supported";
         }




More information about the Libvirt-cim mailing list