From: George Dunlap Subject: [PATCH 3 of 4 RFC] imported patch CA-72761-libxc-error.patch Date: Fri, 8 Jun 2012 12:54:53 +0100 Message-ID: <7cb3f51992976cf00cab.1339156493@elijah> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: george.dunlap@eu.citrix.com List-Id: xen-devel@lists.xenproject.org diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -87,8 +87,8 @@ static ssize_t rdexact(xc_interface *xch if ( (len == -1) && ((errno == EINTR) || (errno == EAGAIN)) ) continue; if ( len == 0 ) { - ERROR("0-length read"); - errno = 0; + errno = EPIPE; + return -1; } if ( len <= 0 ) { ERROR("read_exact_timed failed (read rc: %d, errno: %d, size %d, offset %d)", @@ -1253,7 +1253,7 @@ int xc_domain_restore(xc_interface *xch, if ( !ctx->completed ) { pagebuf.nr_physpages = pagebuf.nr_pages = 0; if ( pagebuf_get_one(xch, ctx, &pagebuf, io_fd, dom) < 0 ) { - DPERROR(tdom, "Error when reading batch"); + /* pagebuf_get_one already returned a proper error */ goto out; } }