Received: from eggs.gnu.org ([2001:4830:134:3::10]:34767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brhtx-0005LK-1E for qemu-devel@nongnu.org; Wed, 05 Oct 2016 04:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brhtr-0003BF-FT for qemu-devel@nongnu.org; Wed, 05 Oct 2016 04:50:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brhtr-0003Aq-AG for qemu-devel@nongnu.org; Wed, 05 Oct 2016 04:50:03 -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 C313D31B313 for ; Wed, 5 Oct 2016 08:50:02 +0000 (UTC) From: Juan Quintela In-Reply-To: <1475002565-30170-3-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 27 Sep 2016 19:56:05 +0100") References: <1475002565-30170-1-git-send-email-dgilbert@redhat.com> <1475002565-30170-3-git-send-email-dgilbert@redhat.com> Reply-To: quintela@redhat.com Date: Wed, 05 Oct 2016 10:49:58 +0200 Message-ID: <877f9nw56x.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/2] migration: Report values for comparisons List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, amit.shah@redhat.com "Dr. David Alan Gilbert (git)" wrote: > 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 > --- > 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; > } Applied, thanks.