From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, mst@redhat.com, amit.shah@redhat.com,
quintela@redhat.com
Cc: duanj@linux.vnet.ibm.com, cornelia.huck@de.ibm.com
Subject: [Qemu-devel] [RFC 2/6] migration: Report values for comparisons
Date: Wed, 24 Aug 2016 14:42:29 +0100 [thread overview]
Message-ID: <1472046153-22123-3-git-send-email-dgilbert@redhat.com> (raw)
In-Reply-To: <1472046153-22123-1-git-send-email-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
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 <dgilbert@redhat.com>
---
migration/vmstate.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/migration/vmstate.c b/migration/vmstate.c
index 1d637b2..ec7fafc 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("%" PRId32 " != %" PRId32, *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 postiive 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("%" PRIu32 " != %" PRIu32, *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("%" PRIu64 " != %" PRIu64, *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("%u != %u", *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("%u != %u", *v, v2);
return -EINVAL;
}
--
2.7.4
next prev parent reply other threads:[~2016-08-24 13:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 13:42 [Qemu-devel] [RFC 0/6] converting some of virtio to VMState Dr. David Alan Gilbert (git)
2016-08-24 13:42 ` [Qemu-devel] [RFC 1/6] migration: report an error giving the failed field Dr. David Alan Gilbert (git)
2016-08-24 13:42 ` Dr. David Alan Gilbert (git) [this message]
2016-08-24 13:42 ` [Qemu-devel] [RFC 3/6] migration: Add VMSTATE_UNUSED_VARRAY_UINT32 Dr. David Alan Gilbert (git)
2016-08-24 13:42 ` [Qemu-devel] [RFC 4/6] virtio/migration: Add VMStateDescription to VirtioDeviceClass Dr. David Alan Gilbert (git)
2016-08-24 15:29 ` Cornelia Huck
2016-08-24 15:42 ` Dr. David Alan Gilbert
2016-08-24 15:51 ` Cornelia Huck
2016-08-24 13:42 ` [Qemu-devel] [RFC 5/6] virtio/migration: Migrate balloon to VMState Dr. David Alan Gilbert (git)
2016-08-24 13:42 ` [Qemu-devel] [RFC 6/6] virtio/migration: Migrate virtio-net " Dr. David Alan Gilbert (git)
2016-08-24 15:34 ` [Qemu-devel] [RFC 0/6] converting some of virtio " Cornelia Huck
2016-08-24 16:20 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1472046153-22123-3-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=duanj@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).