qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, Li Liu <john.liuli@huawei.com>,
	qemu-devel@nongnu.org, stefanha@redhat.com,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL
Date: Tue, 19 Aug 2014 13:58:23 +0200	[thread overview]
Message-ID: <20140819115823.GD4638@noname.redhat.com> (raw)
In-Reply-To: <1408362096-10482-1-git-send-email-mjt@msgid.tls.msk.ru>

Am 18.08.2014 um 13:41 hat Michael Tokarev geschrieben:
> Just log to stderr unconditionally, like other similar code does.
> 
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  block/vvfat.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/block/vvfat.c b/block/vvfat.c
> index 70176b1..ea37023 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -1082,11 +1082,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
>      vvv = s;
>  #endif
>  
> -DLOG(if (stderr == NULL) {
> -    stderr = fopen("vvfat.log", "a");
> -    setbuf(stderr, NULL);
> -})
> -
>      opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
>      qemu_opts_absorb_qdict(opts, options, &local_err);
>      if (local_err) {

Michael, it's fine to merge trivial block patches through your tree, but
can you please keep Stefan and me CCed anyway?

This specific patch isn't as trivial as it might look at the first
sight (in other words: it's wrong). The part that you probably missed is
that stderr isn't the real one when DEBUG is set:

    #undef stderr
    #define stderr STDERR
    FILE* stderr = NULL;

So now you have a lot of fprintf(NULL, ...), which obviously makes qemu
segfault as soon as you enable debugging for vvfat.

Kevin

  parent reply	other threads:[~2014-08-19 11:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 11:41 [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL Michael Tokarev
2014-08-18 11:45 ` Peter Maydell
2014-08-19 11:58 ` Kevin Wolf [this message]
2014-08-19 12:02   ` Peter Maydell
2014-08-19 12:06   ` Eric Blake
2014-08-19 12:25     ` Kevin Wolf

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=20140819115823.GD4638@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=john.liuli@huawei.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.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).