[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 71/78] qemu-nbd: Close inherited stderr
From: |
Michael Roth |
Subject: |
[PATCH 71/78] qemu-nbd: Close inherited stderr |
Date: |
Tue, 16 Jun 2020 09:15:40 -0500 |
From: Raphael Pour <raphael.pour@hetzner.com>
Close inherited stderr of the parent if fork_process is false.
Otherwise no one will close it. (introduced by e6df58a5)
This only affected 'qemu-nbd -c /dev/nbd0'.
Signed-off-by: Raphael Pour <raphael.pour@hetzner.com>
Message-Id: <d8ddc993-9816-836e-a3de-c6edab9d9c49@hetzner.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: Enhance commit message]
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 0eaf453ebf6788885fbb5d40426b154ef8805407)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qemu-nbd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 108a51f7eb..38031310af 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -1022,7 +1022,11 @@ int main(int argc, char **argv)
} else if (pid == 0) {
close(stderr_fd[0]);
- old_stderr = dup(STDERR_FILENO);
+ /* Remember parent's stderr if we will be restoring it. */
+ if (fork_process) {
+ old_stderr = dup(STDERR_FILENO);
+ }
+
ret = qemu_daemon(1, 0);
/* Temporarily redirect stderr to the parent's pipe... */
--
2.17.1
- [PATCH 62/78] qemu-ga: document vsock-listen in the man page, (continued)
- [PATCH 62/78] qemu-ga: document vsock-listen in the man page, Michael Roth, 2020/06/16
- [PATCH 63/78] hw/i386/amd_iommu.c: Fix corruption of log events passed to guest, Michael Roth, 2020/06/16
- [PATCH 64/78] tcg/i386: Fix INDEX_op_dup2_vec, Michael Roth, 2020/06/16
- [PATCH 65/78] dump: Fix writing of ELF section, Michael Roth, 2020/06/16
- [PATCH 66/78] xen-block: Fix double qlist remove and request leak, Michael Roth, 2020/06/16
- [PATCH 67/78] vhost-user-gpu: Release memory returned by vu_queue_pop() with free(), Michael Roth, 2020/06/16
- [PATCH 68/78] target/ppc: Fix mtmsr(d) L=1 variant that loses interrupts, Michael Roth, 2020/06/16
- [PATCH 69/78] hostmem: don't use mbind() if host-nodes is empty, Michael Roth, 2020/06/16
- [PATCH 70/78] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*, Michael Roth, 2020/06/16
- [PATCH 06/78] block: Activate recursively even for already active nodes, Michael Roth, 2020/06/16
- [PATCH 71/78] qemu-nbd: Close inherited stderr,
Michael Roth <=
- [PATCH 72/78] 9p: Lock directory streams with a CoMutex, Michael Roth, 2020/06/16
[PATCH 73/78] net: Do not include a newline in the id of -nic devices, Michael Roth, 2020/06/16
[PATCH 75/78] virtio-balloon: fix free page hinting without an iothread, Michael Roth, 2020/06/16
[PATCH 76/78] virtio-balloon: fix free page hinting check on unrealize, Michael Roth, 2020/06/16
[PATCH 74/78] nbd/server: Avoid long error message assertions CVE-2020-10761, Michael Roth, 2020/06/16