All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Orit Wasserman <owasserm@redhat.com>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap
Date: Wed, 31 Oct 2012 13:24:16 +0200	[thread overview]
Message-ID: <50910A60.3030305@redhat.com> (raw)
In-Reply-To: <1351682381-8793-1-git-send-email-owasserm@redhat.com>

On 10/31/2012 01:19 PM, Orit Wasserman wrote:
> 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;
>  

The original code calculates 1 for your example case.


-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2012-10-31 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 11:19 [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap Orit Wasserman
2012-10-31 11:24 ` Avi Kivity [this message]
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=50910A60.3030305@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=owasserm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.