block/rbd: don't copy strings in qemu_rbd_next_tok()
commit7830f909981361a3d694f4899d5cd7b159841d9e
authorJeff Cody <jcody@redhat.com>
Fri, 24 Feb 2017 15:30:33 +0000 (24 10:30 -0500)
committerJeff Cody <jcody@redhat.com>
Tue, 28 Feb 2017 16:32:06 +0000 (28 11:32 -0500)
tree2a546418ac7c1a883ea0554165fe6d5052cd5ba7
parentc8c0a1a784cdf70ecea50e93213137c6c89337a7
block/rbd: don't copy strings in qemu_rbd_next_tok()

This patch is prep work for parsing options for .bdrv_parse_filename,
and using QDict options.

The function qemu_rbd_next_tok() searched for various key/value pairs,
and copied them into buffers.  This will soon be an unnecessary extra
step, so we will now return found strings by reference only, and
offload the responsibility for safely handling/coping these strings to
the caller.

This also cleans up error handling some, as the callers now rely on
the Error object to determine if there is a parse error.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/rbd.c