From patchwork Thu Nov 10 12:41:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 124866 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 973F51007D1 for ; Thu, 10 Nov 2011 23:43:58 +1100 (EST) Received: from localhost ([::1]:32866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTyl-0006fE-Vr for incoming@patchwork.ozlabs.org; Thu, 10 Nov 2011 07:43:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]:58288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTyU-0006Ys-AL for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROTyS-0006qV-Ta for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTyS-0006qE-Kf for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:43:20 -0500 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 pAAChILu013187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2011 07:43:18 -0500 Received: from blackpad.lan.raisama.net (ovpn-113-78.phx2.redhat.com [10.3.113.78]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAAChIDD028521; Thu, 10 Nov 2011 07:43:18 -0500 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id CB69E202C6C; Thu, 10 Nov 2011 10:41:48 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 10 Nov 2011 10:41:39 -0200 Message-Id: <1320928908-19076-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1320928908-19076-1-git-send-email-ehabkost@redhat.com> References: <1320928908-19076-1-git-send-email-ehabkost@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 Cc: Michael Roth , Juan Quintela Subject: [Qemu-devel] [PATCH 01/10] savevm: use qemu_file_set_error() instead of setting last_error directly 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 Some code uses qemu_file_set_error() already, so use it everywhere when setting last_error, for consistency. Signed-off-by: Eduardo Habkost --- savevm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/savevm.c b/savevm.c index bee16c0..2dab5dc 100644 --- a/savevm.c +++ b/savevm.c @@ -448,7 +448,7 @@ void qemu_fflush(QEMUFile *f) if (len > 0) f->buf_offset += f->buf_index; else - f->last_error = -EINVAL; + qemu_file_set_error(f, -EINVAL); f->buf_index = 0; } } @@ -479,7 +479,7 @@ static void qemu_fill_buffer(QEMUFile *f) } else if (len == 0) { f->last_error = -EIO; } else if (len != -EAGAIN) - f->last_error = len; + qemu_file_set_error(f, len); } int qemu_fclose(QEMUFile *f)