From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMH1U-0004BA-N2 for qemu-devel@nongnu.org; Fri, 04 Nov 2011 06:29:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMH1Q-0007JX-Mj for qemu-devel@nongnu.org; Fri, 04 Nov 2011 06:29:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMH1Q-0007JM-Bz for qemu-devel@nongnu.org; Fri, 04 Nov 2011 06:29:16 -0400 Message-ID: <4EB3BF1D.8070108@redhat.com> Date: Fri, 04 Nov 2011 11:31:57 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1319797077-25441-1-git-send-email-pbonzini@redhat.com> <1319797077-25441-5-git-send-email-pbonzini@redhat.com> <67C69C1A-BA12-4DD6-8CFE-F97011B68258@irisa.fr> <4EAA98B4.4030800@redhat.com> <90216E5F-CF18-4A44-BBCF-0DFB68259296@irisa.fr> <4EAA9D65.1080108@redhat.com> <4EB3B48D.706@redhat.com> In-Reply-To: <4EB3B48D.706@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] qemu-nbd: do not start the block layer in the parent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Pierre Riteau Am 04.11.2011 10:46, schrieb Paolo Bonzini: > On 10/28/2011 02:17 PM, Paolo Bonzini wrote: >>> Yes, it would be better if we could have error output on stderr. Now, >>> "simple" errors such as a missing image file (or wrong path to the >>> image) are reported to syslog instead. It could be the source of some >>> headaches... >>> >>> Is there a way we could have the child send the error to the parent >>> over a pipe and have the parent print it on stderr? >> >> A way could be to change the fork() into a separate thread, so that you >> can daemonize as soon as you accept the socket rather than having to do >> it early. > > I tried implementing this, but in general daemonization (which forks and > leave only the children) breaks the threading. > > So we could either keep this series (which moves all errors to syslog, > but doesn't otherwise change behavior), or I can finish and post an > alternative series that removes all forking from qemu-nbd *but* changes > behavior in that "qemu-nbd -c" will not daemonize anymore. > > Since this is 1.0 after all, I'm slightly more inclined towards the latter. > > Opinions? Kevin, Anthony? I'm surprised that -c is what causes trouble. As far as I understand, the code for implementing -c doesn't use the qemu block layer at all. So why can't we just change the code to fork before it initialises the block layer and opens the image file? Kevin