On 11/10/2014 09:59 AM, Max Reitz wrote: > Instead of actually recreating the options from scratch, just reuse the > options given for creating the BDS, which are the configuration file > name and additional options. In case there are no additional options we > can thus create a plain filename. > > This obviously results in a different output for qemu-iotest 099 which > exactly tests this filename generation. Fix it up as well. > > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > block/blkdebug.c | 98 > +++++++++++++--------------------------------- > tests/qemu-iotests/099.out | 4 +- > 2 files changed, 29 insertions(+), 73 deletions(-) >
> > + if (!force_json && bs->file->exact_filename[0]) { > + snprintf(bs->exact_filename, sizeof(bs->exact_filename), > + "blkdebug:%s:%s", qdict_get_try_str(bs->options, "config"), If there is no "config" entry, this can pass NULL as a %s counterpart to snprintf, which is undefined behavior (works on glibc, but might crash elsewhere). Everything else looked okay, but I'm afraid I may have given you reason to post a v3 and make a kitten cry :( -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature