From patchwork Tue Oct 25 17:18:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 121767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 89E2E1007D9 for ; Wed, 26 Oct 2011 04:20:30 +1100 (EST) Received: from localhost ([::1]:49174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIkfq-0002D5-RF for incoming@patchwork.ozlabs.org; Tue, 25 Oct 2011 13:20:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:42396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIkfk-0002Co-Ta for qemu-devel@nongnu.org; Tue, 25 Oct 2011 13:20:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIkfg-0003CE-TB for qemu-devel@nongnu.org; Tue, 25 Oct 2011 13:20:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIkfg-0003C2-Dx for qemu-devel@nongnu.org; Tue, 25 Oct 2011 13:20:16 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9PHK7mR008748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Oct 2011 13:20:07 -0400 Received: from neno.neno. (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9PHK5sC006777; Tue, 25 Oct 2011 13:20:06 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2011 19:18:58 +0200 Message-Id: <1319563138-21631-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] savevm: qemu_fille_buffer() used to return one error for reads of size 0. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela Reviewed-by: Markus Armbruster --- savevm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/savevm.c b/savevm.c index f01838f..bee16c0 100644 --- a/savevm.c +++ b/savevm.c @@ -476,6 +476,8 @@ static void qemu_fill_buffer(QEMUFile *f) if (len > 0) { f->buf_size += len; f->buf_offset += len; + } else if (len == 0) { + f->last_error = -EIO; } else if (len != -EAGAIN) f->last_error = len; }