qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pino Toscano <ptoscano@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] iSCSI options for IQN with colons
Date: Tue, 01 Dec 2015 14:26:06 +0100	[thread overview]
Message-ID: <2538292.Alk3jII4Z9@pendragon.usersys.redhat.com> (raw)
In-Reply-To: <871tb6tt6n.fsf@blackfin.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 2561 bytes --]

On Tuesday 01 December 2015 10:27:28 Markus Armbruster wrote:
> Beware, I know next to nothing about iSCSI.
> 
> Pino Toscano <ptoscano@redhat.com> writes:
> 
> > Hi,
> >
> > while testing the integration of QEMU with iSCSI, I was setting up an
> > environment with both target and initiator IQNs with colons. Then I
> > tried to connect to two different targets using two different initiator
> > IQN, like the following:
> >
> >   $ qemu ... \
> >       -iscsi id=iqn.2015-11.com.bla:suffix1,initiator-name=iqn.2015-11.com.bla:suffix1-initiator \
> >       -iscsi id=iqn.2015-11.com.bla:suffix2,initiator-name=iqn.2015-11.com.bla:suffix2-initiator \
> >       -drive file=iscsi://server/iqn.2015-11.com.bla%3Asuffix1/0,format=raw,id=hd1,if=none \
> >       -drive file=iscsi://server/iqn.2015-11.com.bla%3Asuffix2/0,format=raw,id=hd2,if=none \
> >       ...
> >
> > which didn't work at first:
> >
> >   qemu-system-x86_64: -iscsi id=iqn.2015-11.com.bla:suffix1,initiator-name=iqn.2015-11.com.bla:suffix1-initiator: Parameter 'id' expects an identifier
> >
> > which, according to id_wellformed in id.c, is true. Allowing colons in
> > id=... like in the following patch
> >
> > diff --git a/util/id.c b/util/id.c
> > index bcc64d8..25fca9d 100644
> > --- a/util/id.c
> > +++ b/util/id.c
> > @@ -20,7 +20,7 @@ bool id_wellformed(const char *id)
> >          return false;
> >      }
> >      for (i = 1; id[i]; i++) {
> > -        if (!qemu_isalnum(id[i]) && !strchr("-._", id[i])) {
> > +        if (!qemu_isalnum(id[i]) && !strchr("-._:", id[i])) {
> >              return false;
> >          }
> >      }
> >
> > allowed me to work run QEMU with the attached disks.
> >
> > The question basically boils down to whether it is right to reject
> > colons in id:
> > - if so, then there should be a way to allow them only in id of -iscsi
> >   (since colons can be part of IQNs)
> > - if not, whether allowing them could cause regressions in option
> >   parsing
> 
> Have you tried
> 
>     -iscsi id=iscsi.1,initiator-name=iqn.2015-11.com.bla:suffix1-initiator \
>     -iscsi id=iscsi.2,initiator-name=iqn.2015-11.com.bla:suffix2-initiator \
>     -drive file=iscsi://server/iqn.2015-11.com.bla%3Asuffix1/0,format=raw,id=hd1,if=none \
>     -drive file=iscsi://server/iqn.2015-11.com.bla%3Asuffix2/0,format=raw,id=hd2,if=none \

This won't work, as the various parse_* in iscsi.c (e.g.
parse_initiator_name for the above cases) use the target IQN as
identifier for the parameters.

-- 
Pino Toscano

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-12-01 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 15:31 [Qemu-devel] iSCSI options for IQN with colons Pino Toscano
2015-12-01  9:27 ` Markus Armbruster
2015-12-01 13:26   ` Pino Toscano [this message]
2015-12-01 13:43     ` Markus Armbruster
2015-12-01 13:55       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2538292.Alk3jII4Z9@pendragon.usersys.redhat.com \
    --to=ptoscano@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).