[Top][All Lists]

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

Re: General question about parsing an rbd filename

From: Connor Kuehl
Subject: Re: General question about parsing an rbd filename
Date: Fri, 9 Apr 2021 12:06:50 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

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,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]