[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migrat
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap |
Date: |
Wed, 31 Oct 2012 14:00:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
On 10/31/2012 01:24 PM, Avi Kivity wrote:
> 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 <address@hidden>
>> ---
>> 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.
You correct ...
sorry ...
>
>