[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [RFC] Multi-IQN proposal

Shyam_Iyer Dell com wrote:
Would this proposal be acceptable ?

In principle, I think what you're proposing is reasonable, and is certainly contemplated by the iSCSI specs.

Example XML schema for an iSCSI storage pool created --

 <pool type="iscsi">
- <source>
  <initiator iqnname = "<initiator IQN1>">
  <initiator iqnname = "<initiator IQN2>">
  <host name="<iSCSI target hostname or Target IP address>" />
  <device path="<iSCSI Target IQN name>" />
- <target>
- <permissions>

I think you have the initiator name specified in the right place in the XML. I would make the initiator iqn an element rather than an attribute, since your proposal contemplates adding additional initiator specific information later, and stylistically I think elements will be cleaner. That gives:


Each initiator iqn name can be parsed to create the unique sessions.

You should propose specifically how you see the sessions being set up. Each pool currently describes something that basically resembles a session, so your proposal modifies that paradigm a bit. Another possible way to implement what you describe would be to allow zero or one initiator tags within a pool. If no initiator tag is specified, the system will use the system default; if a tag is specified, the system will attempt to use the information contained in it. The more I think about it, the more I like that approach since it keeps the pool paradigm unmodified.

This should solve the following possibilities --

* possibility of multiple IQNs for a single Guest
* option for Guest's own BIOS & initiator to use these IQNs (iSCSI in
* option for hypervisor's initiator to use these IQNs on behalf of the

How is this different from the first possibility?

Compile tested only. Needs beatification.

I didn't go over the code closely, but I didn't see anything that struck me as completely off base. I think it's more important to get the details of how this information will be used worked out at this point than to get the code finalized.


diff --git a/src/storage_conf.c b/src/storage_conf.c
index cb063cc..915e897 100644
--- a/src/storage_conf.c
+++ b/src/storage_conf.c
@@ -116,6 +116,7 @@ enum {
     VIR_STORAGE_POOL_SOURCE_DIR     = (1<<2),

@@ -537,6 +538,33 @@ virStoragePoolDefParseXML(virConnectPtr conn,
             goto cleanup;
+/* Read the conf here */
+    if (options->flags & VIR_STORAGE_POOL_SOURCE_INITATOR_IQN) {
+       int niqn, i;
+       if ((niqn = virXPathNodeSet(conn, "./source/host/initiator",
ctxt, &nodeset)) < 0) {
+            virStorageReportError(conn, VIR_ERR_XML_ERROR,
+                        "%s", _("cannot extract storage pool source
+            goto cleanup;
+        }
+       if (VIR_ALLOC_N(ret->source.niqn, niqn) < 0) {
+            VIR_FREE(nodeset);
+            virReportOOMError(conn);
+            goto cleanup;
+        }
+       for (i = 0 ; i < niqn ; i++ ) {
+           xmlChar *name = xmlGetProp(nodeset[i], BAD_CAST "iqnname");
+            if (path == NULL) {
+                VIR_FREE(nodeset);
+                virStorageReportError(conn, VIR_ERR_XML_ERROR,
+                        "%s", _("missing storage pool source device
+                goto cleanup;
+            }
+           ret->source.initiator[i].iqnname  = (char  *)name;
+       }
+    }
     if (options->flags & VIR_STORAGE_POOL_SOURCE_DEVICE) {
         xmlNodePtr *nodeset = NULL;
         int nsource, i;
diff --git a/src/storage_conf.h b/src/storage_conf.h
index 421d305..c2504be 100644
--- a/src/storage_conf.h
+++ b/src/storage_conf.h
@@ -202,7 +202,12 @@ struct _virStoragePoolSourceDevice {
     } geometry;

+/* Initiator Attributes */
+typedef virStoragePoolSourceInitiatorAttr
+struct virStoragePoolSourceInitiatorAttr {
+    char *iqnname;
+    /* We could put other initiator specific things here */

 typedef struct _virStoragePoolSource virStoragePoolSource;
 typedef virStoragePoolSource *virStoragePoolSourcePtr;
@@ -214,6 +219,9 @@ struct _virStoragePoolSource {
     int ndevice;
     virStoragePoolSourceDevicePtr devices;

+    /*And either one or more initiators*/
+    virStoragePoolSourceInitiatorAttrPtr initiator;
     /* Or a directory */
     char *dir;

Libvir-list mailing list
Libvir-list redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]