# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1246397611 25200
# Node ID 696c377aa8fce213b01916af24e1e1027d08c2f7
# Parent fb4f5e6e30cf8316165fa8307bc3fd184ff231fd
Update xmlgen to generate SCSI storage pool XML, add support to RPCS
This adds the code necessary to read in the SCSI pool related attributes and
then generate the appropriate XML.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r fb4f5e6e30cf -r 696c377aa8fc libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700
+++ b/libxkutil/xmlgen.c Tue Jun 30 14:33:31 2009 -0700
@@ -874,6 +874,8 @@
return "iscsi";
case DISK_POOL_LOGICAL:
return "logical";
+ case DISK_POOL_SCSI:
+ return "scsi";
default:
CU_DEBUG("Unsupported disk pool type");
}
@@ -925,6 +927,31 @@
return XML_ERROR;
}
+ if (pool->adapter != NULL) {
+ tmp = xmlNewChild(src, NULL, BAD_CAST "adapter", BAD_CAST
NULL);
+ if (tmp == NULL)
+ return XML_ERROR;
+
+ if (xmlNewProp(tmp,
+ BAD_CAST "name",
+ BAD_CAST pool->adapter) == NULL)
+ return XML_ERROR;
+
+ if (pool->port_name != NULL) {
+ if (xmlNewProp(tmp,
+ BAD_CAST "wwpn",
+ BAD_CAST pool->port_name) == NULL)
+ return XML_ERROR;
+ }
+
+ if (pool->node_name != NULL) {
+ if (xmlNewProp(tmp,
+ BAD_CAST "wwnn",
+ BAD_CAST pool->node_name) == NULL)
+ return XML_ERROR;
+ }
+ }
+
return NULL;
}
diff -r fb4f5e6e30cf -r 696c377aa8fc src/Virt_ResourcePoolConfigurationService.c
--- a/src/Virt_ResourcePoolConfigurationService.c Tue Jun 30 14:33:31 2009 -0700
+++ b/src/Virt_ResourcePoolConfigurationService.c Tue Jun 30 14:33:31 2009 -0700
@@ -147,6 +147,9 @@
pool->pool_info.disk.path = NULL;
pool->pool_info.disk.host = NULL;
pool->pool_info.disk.src_dir = NULL;
+ pool->pool_info.disk.adapter = NULL;
+ pool->pool_info.disk.port_name = NULL;
+ pool->pool_info.disk.node_name = NULL;
}
static char *get_dev_paths(CMPIInstance *inst,
@@ -257,6 +260,29 @@
return NULL;
}
+static const char *disk_scsi_pool(CMPIInstance *inst,
+ struct virt_pool *pool)
+{
+ const char *val = NULL;
+
+ if (cu_get_str_prop(inst, "AdapterName", &val) != CMPI_RC_OK)
+ return "Missing `AdapterName' property";
+
+ pool->pool_info.disk.adapter = strdup(val);
+
+ if (cu_get_str_prop(inst, "PortName", &val) != CMPI_RC_OK) {
+ CU_DEBUG("No `PortName' property specified");
+ } else
+ pool->pool_info.disk.port_name = strdup(val);
+
+ if (cu_get_str_prop(inst, "NodeName", &val) != CMPI_RC_OK) {
+ CU_DEBUG("No `NodeName' property specified");
+ } else
+ pool->pool_info.disk.node_name = strdup(val);
+
+ return NULL;
+}
+
static const char *disk_rasd_to_pool(CMPIInstance *inst,
struct virt_pool *pool)
{
@@ -285,6 +311,9 @@
case DISK_POOL_ISCSI:
msg = disk_iscsi_pool(inst, pool);
break;
+ case DISK_POOL_SCSI:
+ msg = disk_scsi_pool(inst, pool);
+ break;
default:
return "Storage pool type not supported";
}