qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v2 4/9] rbd: Clean up after the previous com


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v2 4/9] rbd: Clean up after the previous commit
Date: Fri, 24 Mar 2017 13:44:12 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 03/24/2017 12:44 PM, Markus Armbruster wrote:
> This code in qemu_rbd_parse_filename()
> 
>     found_str = qemu_rbd_next_tok(p, '\0', &p);

This says to take a string starting at p, modify it in place, update p
to point past the delimiter (well, to nowhere since the delimiter of
'\0' means it is the last token parsed), and return the original
starting into found_str....

>     p = found_str;

...and this says to revert the change to p (why we had to pass &p
instead of NULL is beyond me).  Furthermore, reading the modifications
that qemu_rbd_next_tok() does in place (namely, looking for \ escape
sequences), it doesn't do any when delimiter is '\0'.  Prior to patch 3,
it was therefore useful as an idiom for length checking - but as you
killed even that aspect, I agree with your assessment that it is now a
no-op.

> 
> has no effect.  Drop it, and simplify qemu_rbd_next_tok().
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  block/rbd.c | 24 +++++++++---------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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