From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, agraf@suse.de, quintela@redhat.com
Subject: [Qemu-devel] [PATCH] Peek dont read for vmdescription
Date: Mon, 22 Jun 2015 15:49:34 +0100 [thread overview]
Message-ID: <1434984574-21037-1-git-send-email-dgilbert@redhat.com> (raw)
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The VMDescription section maybe after the EOF mark, the current code
does a 'qemu_get_byte' and either gets the header byte identifying the
description or an error (which it ignores). Doing the 'get' upsets
RDMA which hangs on old machine types without the VMDescription.
Using 'qemu_peek_byte' avoids that.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/savevm.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 2004dce..4bd3709 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1128,9 +1128,14 @@ int qemu_loadvm_state(QEMUFile *f)
* Try to read in the VMDESC section as well, so that dumping tools that
* intercept our migration stream have the chance to see it.
*/
- if (qemu_get_byte(f) == QEMU_VM_VMDESCRIPTION) {
- uint32_t size = qemu_get_be32(f);
+ if (qemu_peek_byte(f, 0) == QEMU_VM_VMDESCRIPTION) {
uint8_t *buf = g_malloc(0x1000);
+ uint32_t size;
+
+ /* Consume the peeked byte */
+ size = qemu_get_byte(f);
+
+ size = qemu_get_be32(f);
while (size > 0) {
uint32_t read_chunk = MIN(size, 0x1000);
--
2.4.3
next reply other threads:[~2015-06-22 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 14:49 Dr. David Alan Gilbert (git) [this message]
2015-06-22 22:18 ` [Qemu-devel] [PATCH] Peek dont read for vmdescription Alexander Graf
2015-06-23 8:37 ` Dr. David Alan Gilbert
2015-06-23 16:37 ` Dr. David Alan Gilbert
2015-06-23 22:01 ` Alexander Graf
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=1434984574-21037-1-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=agraf@suse.de \
--cc=amit.shah@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).