qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/2] blkdebug: Simplify and improve filename


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 1/2] blkdebug: Simplify and improve filename generation
Date: Wed, 12 Nov 2014 13:54:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 11/11/2014 02:23 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 <address@hidden>
> ---
>  block/blkdebug.c           | 99 
> +++++++++++++---------------------------------
>  tests/qemu-iotests/099.out |  4 +-
>  2 files changed, 30 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") ?: "",

This is one case where I _like_ the fact that we allow the gcc extension
operator.  It's so much more verbose to store the function call result
into a temporary to avoid calling it twice.

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]