qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Connor Kuehl <ckuehl@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, dillaman@redhat.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: General question about parsing an rbd filename
Date: Fri, 9 Apr 2021 12:06:50 -0500	[thread overview]
Message-ID: <41af7fc7-a9d5-a299-199e-ec789f7ad47c@redhat.com> (raw)
In-Reply-To: <87wntbfs7x.fsf@dusky.pond.sub.org>

On 4/9/21 9:27 AM, Markus Armbruster wrote:
> Connor Kuehl <ckuehl@redhat.com> writes:
>> block/rbd.c hints that:
>>
>>>   * Configuration values containing :, @, or = can be escaped with a
>>>   * leading "\".
>>
>> Right now, much of the parsing code will allow anyone to escape
>> _anything_ so long as it's preceded by '\'.
>>
>> Is this the intended behavior? Or should the parser be updated to
>> allow escaping only certain sequences.
> 
> I can't answer this question, but perhaps I can get us a bit closer to
> an answer.
> 
> The commend you quoted in part is about "rbd:" pseudo-filenames.
> 
> By "parsing code", you probably mean qemu_rbd_parse_filename().  It uses
> qemu_rbd_next_tok() to split off one part after the other, stopping at a
> special delimiter character, and qemu_rbd_unescape() to unescape most,
> but not all parts.
> 
> Both treat '\' followed by a character other than '\0' specially.
> qemu_rbd_next_tok() doesn't stop at an escaped delimiter character.
> qemu_rbd_unescape() unescapes escaped characters.
> 
> I believe the comment you quoted is basically trying to say "to use a
> character that would normally be a delimiter, escape it with '\'".  It
> doesn't say these are the only characters you may escape.

I agree with your interpretation here.

> Not unescaping some parts feels iffy to me.

I wonder if my reading of it placed too much emphasis on the 
"Configuration values" part of it, which I understand to be the optional 
key,value pairs that come after the image name.

Thank you,

Connor



      reply	other threads:[~2021-04-09 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 21:10 General question about parsing an rbd filename Connor Kuehl
2021-04-09 14:27 ` Markus Armbruster
2021-04-09 17:06   ` Connor Kuehl [this message]

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=41af7fc7-a9d5-a299-199e-ec789f7ad47c@redhat.com \
    --to=ckuehl@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dillaman@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).