All of lore.kernel.org
 help / color / mirror / Atom feed
From: ronnie sahlberg <ronniesahlberg@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] iSCSI: add configuration variables for iSCSI
Date: Thu, 26 Jan 2012 20:18:54 +1100	[thread overview]
Message-ID: <CAN05THQuOkdQ+gcZbQ57Kkpqo6o_ZEqkniPymOUZwPmToQM4yQ@mail.gmail.com> (raw)
In-Reply-To: <4F211813.7060404@redhat.com>

Kevin,

Collissions are bad, but what about

IF ! STRNCMP (filename, "/proc/self/fd/", 14)  THEN
         fopen(filename, "r")
ELSE
        fdopen(atoi(filename+14), "r")
FI

modulo better validation for the atio() arguments.


Probability of anyone using "/proc/self/fd/" as a prefix for normal
files is very small.
Small enough it will be justifiable to say "do that and you are on your own". ?


regards
ronnie sahlberg

On Thu, Jan 26, 2012 at 8:08 PM, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 25.01.2012 16:57, schrieb Eric Blake:
>> On 01/24/2012 11:47 PM, ronnie sahlberg wrote:
>>> Read from an arbitra filedescriptor inherited from the parent process :
>>> 9<iscsi.conf ./x86_64-softmmu/qemu-system-x86_64 -enable-kvm -display
>>> vnc=127.0.0.1:0 -drive file=iscsi://127.0.0.1/iqn.ronnie.test/1
>>> -readconfig /proc/self/fd/9
>>
>> That requires the existence of procfs, which is not portable (although
>> it does work on Linux).  I'd rather see:
>>
>> -readconfig fd:9
>>
>> which matches things for -incoming; that is, if -readconfig starts with
>> '/' or '.', it is a filename; otherwise, it is a protocol:value
>> designation, where we recognize at least the fd: protocol where a value
>> is the incoming fd, but we could also recognize things like exec:
>> protocol which is an arbitrary command to use via popen.
>
> Magic prefixes like this have one big problem: What if someone has a
> config file called "fd:9"? We have the very same problem with protocols
> in the block layer and while in the general case it's a convenient
> syntax, we've come to hate it in cases where it misinterprets things.
>
> Kevin

  reply	other threads:[~2012-01-26  9:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 10:03 [Qemu-devel] [PATCH] Add configuration variables for iscsi Ronnie Sahlberg
2012-01-21 10:03 ` [Qemu-devel] [PATCH] iSCSI: add configuration variables for iSCSI Ronnie Sahlberg
2012-01-23 18:07   ` Eric Blake
2012-01-25  6:47     ` ronnie sahlberg
2012-01-25 15:57       ` Eric Blake
2012-01-25 22:17         ` ronnie sahlberg
2012-01-26  9:08         ` Kevin Wolf
2012-01-26  9:18           ` ronnie sahlberg [this message]
2012-01-26  9:27             ` Kevin Wolf
2012-01-26  9:54               ` ronnie sahlberg
2012-01-26 14:55                 ` Michael Tokarev
2012-01-26 16:08                   ` Michael Tokarev
2012-01-26 15:01                 ` Daniel P. Berrange
2012-01-26  9:50           ` Michael Tokarev
  -- strict thread matches above, loose matches on Subject: below --
2012-01-25 22:39 [Qemu-devel] [PATCH 0/0] Add " Ronnie Sahlberg
2012-01-25 22:39 ` [Qemu-devel] [PATCH] iSCSI: add " Ronnie Sahlberg
2012-01-25 22:53   ` Eric Blake
2012-01-26 10:58   ` Kevin Wolf
2011-12-18  4:48 [Qemu-devel] Patch to add iSCSI configuration optionsi. Version 2 Ronnie Sahlberg
2011-12-18  4:48 ` [Qemu-devel] [PATCH] iSCSI: add configuration variables for iSCSI Ronnie Sahlberg
2011-12-18 13:48   ` Paolo Bonzini
2011-12-22 20:51     ` ronnie sahlberg
2011-12-23  9:08       ` Paolo Bonzini
2011-12-23  9:54         ` ronnie sahlberg
2012-01-03 10:12         ` Daniel P. Berrange
2012-01-19 12:17   ` Kevin Wolf
2012-01-20  8:58     ` ronnie sahlberg
2012-01-20  9:34       ` Kevin Wolf
2011-11-26 23:24 [Qemu-devel] Patch to add iSCSI configuration options Ronnie Sahlberg
2011-11-26 23:24 ` [Qemu-devel] [PATCH] iSCSI: add configuration variables for iSCSI Ronnie Sahlberg
2011-11-27  8:47   ` Orit Wasserman

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=CAN05THQuOkdQ+gcZbQ57Kkpqo6o_ZEqkniPymOUZwPmToQM4yQ@mail.gmail.com \
    --to=ronniesahlberg@gmail.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.