qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH] qemu-nbd: Close inherited stderr


From: Eric Blake
Subject: Re: [PATCH] qemu-nbd: Close inherited stderr
Date: Wed, 13 May 2020 08:02:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]