From patchwork Wed Oct 5 13:44:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 9362959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3149F6075E for ; Wed, 5 Oct 2016 14:03:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 235522865B for ; Wed, 5 Oct 2016 14:03:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 181B028675; Wed, 5 Oct 2016 14:03:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B55C92865B for ; Wed, 5 Oct 2016 14:03:32 +0000 (UTC) Received: from localhost ([::1]:49345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmnD-0002Pj-U3 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Oct 2016 10:03:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmVg-0004Vf-8I for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brmVa-0000Ym-MM for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmVa-0000Yf-G2 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:18 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 006923D97D for ; Wed, 5 Oct 2016 13:45:18 +0000 (UTC) Received: from emacs.mitica (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u95DjCfJ031257; Wed, 5 Oct 2016 09:45:16 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Oct 2016 15:44:56 +0200 Message-Id: <1475675109-8105-3-git-send-email-quintela@redhat.com> In-Reply-To: <1475675109-8105-1-git-send-email-quintela@redhat.com> References: <1475675109-8105-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 05 Oct 2016 13:45:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/15] migration: Report values for comparisons X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amit.shah@redhat.com, dgilbert@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Dr. David Alan Gilbert" Report the values when a comparison fails; together with the previous patch that prints the device and field names this should give a good idea of why loading the migration failed. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: John Snow Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/vmstate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/vmstate.c b/migration/vmstate.c index 1d637b2..0bc9f35 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -557,6 +557,7 @@ static int get_int32_equal(QEMUFile *f, void *pv, size_t size) if (*v == v2) { return 0; } + error_report("%" PRIx32 " != %" PRIx32, *v, v2); return -EINVAL; } @@ -580,6 +581,9 @@ static int get_int32_le(QEMUFile *f, void *pv, size_t size) *cur = loaded; return 0; } + error_report("Invalid value %" PRId32 + " expecting positive value <= %" PRId32, + loaded, *cur); return -EINVAL; } @@ -685,6 +689,7 @@ static int get_uint32_equal(QEMUFile *f, void *pv, size_t size) if (*v == v2) { return 0; } + error_report("%" PRIx32 " != %" PRIx32, *v, v2); return -EINVAL; } @@ -727,6 +732,7 @@ static int get_uint64_equal(QEMUFile *f, void *pv, size_t size) if (*v == v2) { return 0; } + error_report("%" PRIx64 " != %" PRIx64, *v, v2); return -EINVAL; } @@ -748,6 +754,7 @@ static int get_uint8_equal(QEMUFile *f, void *pv, size_t size) if (*v == v2) { return 0; } + error_report("%x != %x", *v, v2); return -EINVAL; } @@ -769,6 +776,7 @@ static int get_uint16_equal(QEMUFile *f, void *pv, size_t size) if (*v == v2) { return 0; } + error_report("%x != %x", *v, v2); return -EINVAL; }