From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8QWR-0005FZ-HP for qemu-devel@nongnu.org; Tue, 10 Jul 2007 20:57:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8QWP-0005ET-37 for qemu-devel@nongnu.org; Tue, 10 Jul 2007 20:57:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8QWO-0005EQ-Tz for qemu-devel@nongnu.org; Tue, 10 Jul 2007 20:57:36 -0400 Received: from an-out-0708.google.com ([209.85.132.242]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8QWO-0005Rj-CY for qemu-devel@nongnu.org; Tue, 10 Jul 2007 20:57:36 -0400 Received: by an-out-0708.google.com with SMTP id d11so426246and for ; Tue, 10 Jul 2007 17:57:35 -0700 (PDT) Message-ID: Date: Tue, 10 Jul 2007 17:57:34 -0700 From: "Yigael Fleishman" Subject: Re: [Qemu-devel] Missing system calls retries in case of EINTR In-Reply-To: <200707061457.07925.rob@landley.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_209718_14841505.1184115454947" References: <200707061457.07925.rob@landley.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rob Landley Cc: qemu-devel@nongnu.org, frederic.roussel@access-company.com ------=_Part_209718_14841505.1184115454947 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Rob, Thanks, that should also work. Seems do_sigaction() in linux-user/signal.c has some code which does that (though obviously not for the signal that I'm receiving). Any idea why SA_RESTART calls are not invoked by default to restart syscalls for all signals? --Yigael On 7/6/07, Rob Landley wrote: > > On Monday 25 June 2007 20:14:24 Yigael Fleishman wrote: > > Running qemu on a Ubuntu Feisty host I've encountered an occasional > > failure-to-launch problem. > > I've used the "-serial /dev/ttyS0" at the command line, and qemu would > > often exit printing "could not open serial device". > > Looking in the srcs I've noticed that qemu_chr_open_tty does not retry > the > > 'open' syscall if it fails and errno=EINTR. > > I've added a retry for such case and it seems to solve that specific > > problem (see the following patch). > > Furthermore, I've noticed that all open, read and some write calls in > > vl.care not retried in such cases. > > Please don't play whack-a-mole with this. You probably want > sigaction(SA_RESTART) when running system emulation. > > Rob > -- > "One of my most productive days was throwing away 1000 lines of code." > - Ken Thompson. > ------=_Part_209718_14841505.1184115454947 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Rob,
Thanks, that should also work.
Seems do_sigaction() in linux-user/signal.c has some code which does that (though obviously not for the signal that I'm receiving).
Any idea why SA_RESTART calls are not invoked by default to restart syscalls for all signals?
--Yigael


On 7/6/07, Rob Landley <rob@landley.net> wrote:
On Monday 25 June 2007 20:14:24 Yigael Fleishman wrote:
> Running qemu on a Ubuntu Feisty host I've encountered an occasional
> failure-to-launch problem.
> I've used the "-serial /dev/ttyS0" at the command line, and qemu would
> often exit printing "could not open serial device".
> Looking in the srcs I've noticed that  qemu_chr_open_tty does not retry the
> 'open' syscall if it fails and errno=EINTR.
> I've added a retry for such case and it seems to solve that specific
> problem (see the following patch).
> Furthermore, I've noticed that all open, read and some write calls in
> vl.care not retried in such cases.

Please don't play whack-a-mole with this.  You probably want
sigaction(SA_RESTART) when running system emulation.

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

------=_Part_209718_14841505.1184115454947--