From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGoYI-0002Xn-0Y for qemu-devel@nongnu.org; Wed, 26 Sep 2012 06:09:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGoYH-00045K-16 for qemu-devel@nongnu.org; Wed, 26 Sep 2012 06:09:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGoYG-00045F-Os for qemu-devel@nongnu.org; Wed, 26 Sep 2012 06:09:08 -0400 Message-ID: <5062D43B.3000608@redhat.com> Date: Wed, 26 Sep 2012 12:08:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20120924091008.GJ18470@in.ibm.com> <20120924091340.GN18470@in.ibm.com> <5062D24F.7030304@redhat.com> In-Reply-To: <5062D24F.7030304@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v9 4/4] block: Support GlusterFS as a QEMU block backend. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Anthony Liguori , Anand Avati , Vijay Bellur , Stefan Hajnoczi , Harsh Bora , Amar Tumballi , qemu-devel@nongnu.org, "Richard W.M. Jones" , Blue Swirl , Avi Kivity , bharata@linux.vnet.ibm.com, Daniel Veillard Il 26/09/2012 12:00, Kevin Wolf ha scritto: >> > + >> > + ret = write(fd, (void *)&acb, sizeof(acb)); >> > + if (ret >= 0) { >> > + break; >> > + } >> > + if (errno == EINTR) { >> > + continue; >> > + } >> > + if (errno != EAGAIN) { >> > + break; >> > + } > Variatio delectat? ;-) > > How about just do { ... } while (errno == EINTR || errno == EAGAIN); ? That should be while ((ret < 0) && (errno == EINTR || errno == EAGAIN)); However, fd here is blocking, so you can just use qemu_write_full. Paolo