Skip to contentSkip to conversation

help: add id suboption to -iscsi

PATCH In review Paolo Bonzini 2 participants 3 messages Dec 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 help: add id suboption to -iscsi

---
 qemu-options.hx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-options.hx +1 -1
index 8b94264..7f12f02 100644
@@ -2089,7 +2089,7 @@ ETEXI
 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
     "-iscsi [user=user][,password=password]\n"
     "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
-    "       [,initiator-name=iqn]\n"
+    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
     "                iSCSI session parameters\n", QEMU_ARCH_ALL)
 STEXI
 
Signature · 1 line
1.7.1
#1 lore raw

qemu-options.hx ETEXI · line 2094

Quoted 10 lines · Paolo Bonzini
qemu-options.hx +1 -1
@@ -2089,7 +2089,7 @@ ETEXI
 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
     "-iscsi [user=user][,password=password]\n"
     "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
-    "       [,initiator-name=iqn]\n"
+    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
     "                iSCSI session parameters\n", QEMU_ARCH_ALL)
 STEXI

I'm not sure this is clearer, to me it looks more confusing than before.

The thing is that "id" suboption is automatic and is handled in the option parsing code explicitly.

As far as I can see, "id" suboption is actually never used by iscsi code, only initiator-name is.

What this change is for?

Thanks,

/mjt

#2 lore raw

Il 06/12/2013 20:04, Michael Tokarev ha scritto:

Quoted 15 lines

qemu-options.hx ETEXI · line 2094

Quoted 10 lines · Paolo Bonzini
qemu-options.hx +1 -1
@@ -2089,7 +2089,7 @@ ETEXI
 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
     "-iscsi [user=user][,password=password]\n"
     "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
-    "       [,initiator-name=iqn]\n"
+    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
     "                iSCSI session parameters\n", QEMU_ARCH_ALL)
 STEXI

I'm not sure this is clearer, to me it looks more confusing than before.

Quoted 2 lines

The thing is that "id" suboption is automatic and is handled in the option parsing code explicitly.

But it has a particular meaning in the case of -iscsi. Usually it is referred to in other options, or by monitor commands. For -iscsi, it is the target IQN.

Also, it is documented in qemu-doc.texi (albeit in -readconfig format):

Setting the target name allows different options for different targets @example
[iscsi "iqn.target.name"]
user = "CHAP username"
password = "CHAP password"
initiator-name = "iqn.qemu.test:my-initiator"

  # header digest is one of CRC32C|CRC32C-NONE|NONE-CRC32C|NONE
  header-digest = "CRC32C"
@end example
Quoted 2 lines

As far as I can see, "id" suboption is actually never used by iscsi code, only initiator-name is.

It's used:

    list = qemu_find_opts("iscsi");
    if (list) {
        opts = qemu_opts_find(list, target);
        if (!opts) {
            opts = QTAILQ_FIRST(&list->head);
        }
        if (opts) {
            name = qemu_opt_get(opts, "initiator-name");
            if (name) {
                return g_strdup(name);
            }
        }
    }

qemu_opts_find(list, target) returns the option set whose id is equal to target.

Quoted 1 line

What this change is for?

Better documentation. :)

Paolo