From: Orit Wasserman <owasserm@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, aliguori@us.ibm.com,
Orit Wasserman <owasserm@redhat.com>,
avi@redhat.com, quintela@redhat.com
Subject: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap
Date: Wed, 31 Oct 2012 13:19:41 +0200 [thread overview]
Message-ID: <1351682381-8793-1-git-send-email-owasserm@redhat.com> (raw)
The number of bits is off by one, for example if last_ram_offset
is 0x1000 (the guest has one page) we get 0 bits instead of 1.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
arch_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch_init.c b/arch_init.c
index b75a4c5..a80c3c8 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -565,7 +565,7 @@ static void reset_ram_globals(void)
static int ram_save_setup(QEMUFile *f, void *opaque)
{
RAMBlock *block;
- int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
+ int64_t ram_pages = (last_ram_offset() >> TARGET_PAGE_BITS) + 1;
migration_bitmap = bitmap_new(ram_pages);
bitmap_set(migration_bitmap, 0, ram_pages);
--
1.7.11.7
next reply other threads:[~2012-10-31 11:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 11:19 Orit Wasserman [this message]
2012-10-31 11:24 ` [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap Avi Kivity
2012-10-31 12:00 ` Orit Wasserman
2012-10-31 11:25 ` Peter Maydell
2012-10-31 12:04 ` Orit Wasserman
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=1351682381-8793-1-git-send-email-owasserm@redhat.com \
--to=owasserm@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=pbonzini@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).