From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME2fP-0006uY-3v for qemu-devel@nongnu.org; Tue, 09 Jun 2009 10:51:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME2fJ-0006nR-R2 for qemu-devel@nongnu.org; Tue, 09 Jun 2009 10:51:10 -0400 Received: from [199.232.76.173] (port=46364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME2fJ-0006nK-NS for qemu-devel@nongnu.org; Tue, 09 Jun 2009 10:51:05 -0400 Received: from mail-bw0-f223.google.com ([209.85.218.223]:46913) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME2fJ-0008E2-5b for qemu-devel@nongnu.org; Tue, 09 Jun 2009 10:51:05 -0400 Received: by bwz23 with SMTP id 23so25788bwz.34 for ; Tue, 09 Jun 2009 07:51:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4A2E3E2D.1030401@redhat.com> References: <1244478441-26288-1-git-send-email-uril@redhat.com> <4A2E3E2D.1030401@redhat.com> Date: Tue, 9 Jun 2009 17:51:02 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] exec-migration: handle EINTR in popen_get_buffer() From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Uri Lublin Cc: qemu-devel@nongnu.org On 6/9/09, Uri Lublin wrote: > On 06/08/2009 07:55 PM, Blue Swirl wrote: > > > On 6/8/09, Uri Lublin wrote: > > > > > Sometimes, upon interrupt, fread returns with no data, and > > > the (incoming exec) migration fails. > > > > > > Fix by retrying on such a case. > > > > > > > Maybe a better solution would be to introduce qemu_{f,}{read,write}, > > which handle EINTR and partial reads/writes. > > > > > > > > The migration code does not care about partial reads/writes (at this > level). Data is read /written to/from a buffer. When needed/available we > retry. > > I can introduce qemu_{f,}{read,write} which only takes care of EINTR (by > retrying) but the caller would have to handle partial reads/writes (and > EAGAIN). Would that be helpful ? Would we really need two functions, one with partial read/write and EAGAIN handling and one with only EINTR? There's fread_targphys which handles partial reads/writes, but not EINTR/EAGAIN, otherwise in many {f]{read,write} use cases there is no handling for any of these.