From patchwork Thu Dec 6 12:08:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 204213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5BD452C031A for ; Thu, 6 Dec 2012 23:08:44 +1100 (EST) Received: from localhost ([::1]:51356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaFu-0004r8-5u for incoming@patchwork.ozlabs.org; Thu, 06 Dec 2012 07:08:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaFg-0004cW-QR for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:08:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgaFc-0005Hx-JA for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:08:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaFc-0005Hr-4n; Thu, 06 Dec 2012 07:08:24 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB6C8N0x004784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Dec 2012 07:08:23 -0500 Received: from Host-001.privatebox (vpn1-6-33.ams2.redhat.com [10.36.6.33]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB6C8Li2002242; Thu, 6 Dec 2012 07:08:22 -0500 From: Alon Levy To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Thu, 6 Dec 2012 14:08:20 +0200 Message-Id: <1354795700-3052-1-git-send-email-alevy@redhat.com> In-Reply-To: <1354795349-2613-1-git-send-email-alevy@redhat.com> References: <1354795349-2613-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] arch_init/ram_load: add error message for block length mismatch 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: Alon Levy --- Please ignore previous version, accidentally removed goto done and used wrong format size specifiers. arch_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch_init.c b/arch_init.c index e6effe8..fba24f3 100644 --- a/arch_init.c +++ b/arch_init.c @@ -808,6 +808,9 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) QLIST_FOREACH(block, &ram_list.blocks, next) { if (!strncmp(id, block->idstr, sizeof(id))) { if (block->length != length) { + fprintf(stderr, "Length mismatch: %s: %ld " + "in != %ld\n", id, length, + block->length); ret = -EINVAL; goto done; }