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 <arm...@redhat.com> > --- > block/rbd.c | 24 +++++++++--------------- > 1 file changed, 9 insertions(+), 15 deletions(-) > Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature