qemu-nbd: properly report error on error in dup2() after qemu_daemon()
commite0892ced0534b1009d009e32c3e338456018ab15
authorDenis V. Lunev <den@openvz.org>
Mon, 17 Jul 2023 14:55:42 +0000 (17 16:55 +0200)
committerEric Blake <eblake@redhat.com>
Wed, 19 Jul 2023 20:25:27 +0000 (19 15:25 -0500)
tree2be6d2e5d06253bc2d07bdb4513dc59efdcf49df
parent1dc8215118ca5b99669c3bf27082a365aef16ea6
qemu-nbd: properly report error on error in dup2() after qemu_daemon()

We are trying to temporarily redirect stderr of daemonized process to
a pipe to report a error and get failed. In that case we could not
use error_report() helper, but should write the message directly into
the problematic pipe.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20230717145544.194786-4-den@openvz.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: rearrange patch series, fix typo]
Signed-off-by: Eric Blake <eblake@redhat.com>
qemu-nbd.c