From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:32829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPxV-0003K1-LO for qemu-devel@nongnu.org; Thu, 28 Apr 2011 08:04:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFPxV-0002gQ-0U for qemu-devel@nongnu.org; Thu, 28 Apr 2011 08:04:37 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:33249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPxU-0002gK-RR for qemu-devel@nongnu.org; Thu, 28 Apr 2011 08:04:36 -0400 Received: by wyb42 with SMTP id 42so2343702wyb.4 for ; Thu, 28 Apr 2011 05:04:36 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DB957D0.9000407@redhat.com> Date: Thu, 28 Apr 2011 14:04:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1303907511-4092-1-git-send-email-Jes.Sorensen@redhat.com> <1303907511-4092-2-git-send-email-Jes.Sorensen@redhat.com> <4DB914E3.7000107@redhat.com> In-Reply-To: <4DB914E3.7000107@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] Add dd-style SIGUSR1 progress reporting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: kwolf@redhat.com, Markus Armbruster , qemu-devel@nongnu.org On 04/28/2011 09:18 AM, Jes Sorensen wrote: > On 04/27/11 18:14, Markus Armbruster wrote: >>> +static void progress_simple_init(void) >>> +{ >>> + state.print = progress_simple_print; >>> + state.end = progress_simple_end; >>> +} >>> + >>> +#ifdef CONFIG_POSIX >>> +static void sigusr_print(int signal) >>> +{ >>> + printf(" (%3.2f/100%%)\n", state.current); >> >> printf() is not async-signal-safe. I don't think you can safely call it >> in a signal handler. > > Grrrr, you're absolutely right! Back to the drawing board! Let's add our own version of strtol to QEMU. :) Paolo