qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Raphael Pour <raphael.pour@hetzner.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [PATCH] qemu-nbd: Close inherited stderr
Date: Wed, 13 May 2020 08:02:44 -0500	[thread overview]
Message-ID: <090a7294-4f13-dc8b-cfc3-e4e432aa5f2c@redhat.com> (raw)
In-Reply-To: <fa1525c8-879a-56cd-5585-e855c7c1abce@hetzner.com>

On 5/13/20 2:14 AM, Raphael Pour wrote:
> On 5/12/20 3:57 PM, Eric Blake wrote:
>> Wouldn't it just be simpler to not dup in the first place?
>>
>> diff --git i/qemu-nbd.c w/qemu-nbd.c
>> index 4aa005004ebd..6ba2544feb3a 100644
>> --- i/qemu-nbd.c
>> +++ w/qemu-nbd.c
>> @@ -916,7 +916,9 @@ int main(int argc, char **argv)
>>           } else if (pid == 0) {
>>               close(stderr_fd[0]);
>>
>> -            old_stderr = dup(STDERR_FILENO);
>> +            if (fork_process) {
>> +                old_stderr = dup(STDERR_FILENO);
>> +            }
>>               ret = qemu_daemon(1, 0);
>>
>>               /* Temporarily redirect stderr to the parent's pipe...  */
> 
> Yes, you're right. We tested your patch and it also fixes the unwanted
> open stderr.
> 
> Could you consider this patch in one of the next releases?

Yes, now that we know about it, the bug will be fixed in 5.1; we can 
also cc: qemu-stable to get it backported to the next 5.0.x release 
(downstream developers are also more likely to backport it to their 
ports as well if it lands on qemu-stable).  Would you like to try your 
hand at a v2 patch, or shall I just turn my proposal into a formal patch 
and mention you as the reporter?  Time-wise, it may be faster for me to 
just take over the patch than to spend the time coaching you through to 
the point of your first successful submission, but project-wise, it is 
always better to welcome in new contributors and share the wealth, 
rather than making maintainers become the bottleneck.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-05-13 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12  8:56 [PATCH] qemu-nbd: Close inherited stderr Raphael Pour
2020-05-12 13:57 ` Eric Blake
2020-05-13  7:14 ` Raphael Pour
2020-05-13 13:02   ` Eric Blake [this message]
2020-05-14  5:33   ` Raphael Pour

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=090a7294-4f13-dc8b-cfc3-e4e432aa5f2c@redhat.com \
    --to=eblake@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.pour@hetzner.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).