Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJqIS-0006G5-58 for qemu-devel@nongnu.org; Fri, 18 Jul 2008 09:46:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJqIR-0006Fg-FC for qemu-devel@nongnu.org; Fri, 18 Jul 2008 09:46:55 -0400 Received: from [199.232.76.173] (port=40741 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJqIR-0006Fc-8H for qemu-devel@nongnu.org; Fri, 18 Jul 2008 09:46:55 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:2641) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJqIQ-0007Jg-QU for qemu-devel@nongnu.org; Fri, 18 Jul 2008 09:46:54 -0400 Received: from mariner.uk.xensource.com ([10.80.2.22]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m6IDkpbn025441 for ; Fri, 18 Jul 2008 06:46:52 -0700 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1KJqIE-0000gb-HM for qemu-devel@nongnu.org; Fri, 18 Jul 2008 14:46:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18560.40642.531768.121380@mariner.uk.xensource.com> Date: Fri, 18 Jul 2008 14:46:42 +0100 Subject: Re: [Qemu-devel] [PATCH 1/2] unix_write: don't block on non-blocking file handles. In-Reply-To: <1215605958-22623-1-git-send-email-kraxel@redhat.com> References: <1215605958-22623-1-git-send-email-kraxel@redhat.com> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Gerd Hoffmann writes ("[Qemu-devel] [PATCH 1/2] unix_write: don't block on non-blocking file handles."): > - if (errno != EINTR && errno != EAGAIN) > + if (errno == EINTR) { > + continue; > + } else if (errno == EAGAIN) { > + if (!nonblock) > + continue; I think this patch is not harmful. However, it is I think always correct to return EAGAIN to the caller. This is what I have in the Xen qemu tree. I submitted a patch to this effect, which replaced unix_{read,write} with qemu_{read,write}, amongst other error-handling changes, on the 25th of January, under the subject line `[PATCH] check return value from read() and write() properly' There was a small amount of discussion including some critical comments from Anthony Ligouri but I think I addressed all of those at the time. Sadly the patch did not get accepted after that. Ian.