From patchwork Thu Dec 6 12:02:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 204212 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 C218C2C0318 for ; Thu, 6 Dec 2012 23:02:52 +1100 (EST) Received: from localhost ([::1]:47480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaAA-0002LH-SB for incoming@patchwork.ozlabs.org; Thu, 06 Dec 2012 07:02:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaA0-0002JR-Pz for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tga9z-0003mV-Js for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:02:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tga9z-0003mN-Cf; Thu, 06 Dec 2012 07:02:35 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB6C2WUo018092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Dec 2012 07:02:33 -0500 Received: from Host-001.privatebox (vpn1-6-33.ams2.redhat.com [10.36.6.33]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB6C2UVX009142; Thu, 6 Dec 2012 07:02:31 -0500 From: Alon Levy To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Thu, 6 Dec 2012 14:02:29 +0200 Message-Id: <1354795349-2613-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] 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 Reviewed-by: Orit Wasserman --- arch_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch_init.c b/arch_init.c index e6effe8..84bca99 100644 --- a/arch_init.c +++ b/arch_init.c @@ -808,8 +808,10 @@ 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: %d " + "in != %d\n", id, length, + block->length); ret = -EINVAL; - goto done; } break; }