xen: fix memory size calculation
authorJijiang Liu <jijiang.liu@intel.com>
Tue, 3 Jun 2014 13:00:15 +0000 (21:00 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 9 Jun 2014 15:50:04 +0000 (17:50 +0200)
The unit of allocated_size is MB, so the change below is made.
Otherwise, it will fail to free memory when available memory is not enough.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c

index 03efb4f..edee86e 100644 (file)
@@ -447,7 +447,7 @@ dom0_memory_reserve(uint32_t rsv_size)
                        return -ENOMEM;
                }
 
-               allocated_size += DOM0_MEMBLOCK_SIZE;
+               allocated_size += SIZE_PER_BLOCK;
 
                size = DOM0_MEMBLOCK_SIZE;
                vaddr = vstart;