From patchwork Sun May 12 11:16:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 243169 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 480FB2C00A9 for ; Sun, 12 May 2013 21:16:52 +1000 (EST) Received: from localhost ([::1]:43403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbUGo-00061R-FA for incoming@patchwork.ozlabs.org; Sun, 12 May 2013 07:16:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbUGZ-000618-4X for qemu-devel@nongnu.org; Sun, 12 May 2013 07:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbUGY-0002eU-8i for qemu-devel@nongnu.org; Sun, 12 May 2013 07:16:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbUGY-0002eI-1E for qemu-devel@nongnu.org; Sun, 12 May 2013 07:16:34 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4CBGWg6015154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 12 May 2013 07:16:32 -0400 Received: from localhost.localdomain (vpn1-5-38.ams2.redhat.com [10.36.5.38]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4CBGU6l021477; Sun, 12 May 2013 07:16:31 -0400 From: Alon Levy To: qemu-devel@nongnu.org, shajnocz@redhat.com, owasserm@redhat.com Date: Sun, 12 May 2013 14:16:28 +0300 Message-Id: <1368357388-25906-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3] 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 Makes it easier to debug situations where the source and target have different ram blocks in a device and migration fails due to that, for instance a BAR size change on a PCI device. Signed-off-by: Alon Levy Reviewed-by: Juan Quintela --- v3: use RAM_ADDR_FMT arch_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch_init.c b/arch_init.c index 49c5dc2..cd27fcf 100644 --- a/arch_init.c +++ b/arch_init.c @@ -808,6 +808,9 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) QTAILQ_FOREACH(block, &ram_list.blocks, next) { if (!strncmp(id, block->idstr, sizeof(id))) { if (block->length != length) { + fprintf(stderr, "Length mismatch: %s: %ld " + "in != " RAM_ADDR_FMT "\n", id, length, + block->length); ret = -EINVAL; goto done; }