qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Lieven <pl@kamp.de>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] blkdebug: Simplify and improve filename generation
Date: Wed, 12 Nov 2014 13:54:29 -0700	[thread overview]
Message-ID: <5463C905.6010005@redhat.com> (raw)
In-Reply-To: <1415697825-26678-2-git-send-email-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

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 <mreitz@redhat.com>
> ---
>  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 <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-11-12 20:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11  9:23 [Qemu-devel] [PATCH v3 0/2] block: Improve filename generation for blkdebug Max Reitz
2014-11-11  9:23 ` [Qemu-devel] [PATCH v3 1/2] blkdebug: Simplify and improve filename generation Max Reitz
2014-11-12 20:54   ` Eric Blake [this message]
2014-11-11  9:23 ` [Qemu-devel] [PATCH v3 2/2] iotests: Plain blkdebug " Max Reitz
2014-11-12 20:55   ` Eric Blake
2014-11-26 15:53 ` [Qemu-devel] [PATCH v3 0/2] block: Improve filename generation for blkdebug Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5463C905.6010005@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).