From: Lei Li <lilei@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, anthony@codemonkey.ws,
mrhines@linux.vnet.ibm.com, Lei Li <lilei@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 3/3 v2] arch_init: right return for ram_save_iterate
Date: Mon, 26 Aug 2013 17:29:28 +0800 [thread overview]
Message-ID: <1377509368-24921-3-git-send-email-lilei@linux.vnet.ibm.com> (raw)
In-Reply-To: <1377509368-24921-1-git-send-email-lilei@linux.vnet.ibm.com>
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Change since v1:
Return fixes and improvement from Paolo Bonzini.
arch_init.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 94d45e1..a26bc89 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -709,15 +709,20 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
*/
ram_control_after_iterate(f, RAM_CONTROL_ROUND);
+ bytes_transferred += total_sent;
+
+ /*
+ * Do not count these 8 bytes into total_sent, so that we can
+ * return 0 if no page had been dirtied.
+ */
+ qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
+ bytes_transferred += 8;
+
+ ret = qemu_file_get_error(f);
if (ret < 0) {
- bytes_transferred += total_sent;
return ret;
}
- qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
- total_sent += 8;
- bytes_transferred += total_sent;
-
return total_sent;
}
--
1.7.7.6
next prev parent reply other threads:[~2013-08-26 9:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 9:29 [Qemu-devel] [PATCH 1/3 v2] savevm: add comments for qemu_file_get_error() Lei Li
2013-08-26 9:29 ` [Qemu-devel] [PATCH 2/3 v2] savevm: fix wrong error set by ram_control_load_hook() Lei Li
2013-08-26 9:29 ` Lei Li [this message]
2013-08-29 9:07 ` [Qemu-devel] [PATCH 3/3 v2] arch_init: right return for ram_save_iterate Lei Li
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=1377509368-24921-3-git-send-email-lilei@linux.vnet.ibm.com \
--to=lilei@linux.vnet.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=mrhines@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).