From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaJo4-0004jX-Lz for qemu-devel@nongnu.org; Mon, 29 Feb 2016 04:07:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaJnz-00041Z-K8 for qemu-devel@nongnu.org; Mon, 29 Feb 2016 04:07:56 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:33189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaJnz-00040T-Ca for qemu-devel@nongnu.org; Mon, 29 Feb 2016 04:07:51 -0500 Received: by mail-wm0-x234.google.com with SMTP id l68so27111826wml.0 for ; Mon, 29 Feb 2016 01:07:51 -0800 (PST) Sender: Paolo Bonzini References: <1456320461-26756-1-git-send-email-pbonzini@redhat.com> <1456320461-26756-15-git-send-email-pbonzini@redhat.com> <20160229085711.GA26830@dnr.brq.redhat.com> From: Paolo Bonzini Message-ID: <56D40A63.2060302@redhat.com> Date: Mon, 29 Feb 2016 10:07:47 +0100 MIME-Version: 1.0 In-Reply-To: <20160229085711.GA26830@dnr.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PULL 14/19] log: Redirect stderr to logfile if deamonized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?J=c3=a1n_Tomko?= Cc: qemu-devel@nongnu.org, Dimitris Aragiorgis On 29/02/2016 09:57, Ján Tomko wrote: > qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -M none > -qmp unix:/var/lib/libvirt/qemu/capabilities.monitor.sock,server,nowait > -pidfile /var/lib/libvirt/qemu/capabilities.pidfile -daemonize Can you test this patch? diff --git a/util/log.c b/util/log.c index 4dff00b..9402880 100644 --- a/util/log.c +++ b/util/log.c @@ -56,7 +56,8 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers) #ifdef CONFIG_TRACE_LOG qemu_loglevel |= LOG_TRACE; #endif - if ((qemu_loglevel || is_daemonized()) && !qemu_logfile) { + if (!qemu_logfile && + (qemu_loglevel || (is_daemonized() && logfilename)) { if (logfilename) { qemu_logfile = fopen(logfilename, log_append ? "a" : "w"); if (!qemu_logfile) { Thanks, Paolo