log: do not log if QEMU is daemonized but without -D
Commit 96c33a45 ("log: Redirect stderr to logfile if deamonized", 2016-02-22) wanted to move stderr of a daemonized QEMU to the file specified with -D. However, if -D was not passed, the patch had the side effect of not redirecting stderr to /dev/null. This happened because qemu_logfile was set to stderr rather than the expected value of NULL. The fix is simply in the "if" condition of do_qemu_set_log; the "if" for closing the file is also changed to match. Reported-by: NJan Tomko <jtomko@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Showing
想要评论请 注册 或 登录