mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1385.1.2 (426ebce6uikcKvm56neQ1G3uFEGApw)
Properly set memory parameters for newly created domains. Signed-off-by: Bin Ren <bin.ren@cl.cam.ac.uk>
This commit is contained in:
1 parent
324df1cf56
commit
06418b32fe
3 files changed
+6
-2
No files matched your search
@@ -35,7 +35,7 @@ int xc_domain_create(int xc_handle,
|
||||
goto fail;
|
||||
|
||||
if ( (err = do_dom_mem_op(xc_handle, MEMOP_increase_reservation,
|
||||
NULL, mem_kb/4, 0, *pdomid)) != (mem_kb/4) )
|
||||
NULL, mem_kb/4 + 1, 0, *pdomid)) != (mem_kb/4) )
|
||||
{
|
||||
if ( err > 0 )
|
||||
errno = ENOMEM;
|
||||
|
||||
@@ -411,7 +411,8 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
|
||||
d = find_domain_by_id(op->u.setdomainmaxmem.domain);
|
||||
if ( d != NULL )
|
||||
{
|
||||
d->max_pages = op->u.setdomainmaxmem.max_memkb >> (PAGE_SHIFT-10);
|
||||
d->max_pages = (op->u.setdomainmaxmem.max_memkb +
|
||||
((PAGE_SIZE-1)>>10)) >> (PAGE_SHIFT-10);
|
||||
put_domain(d);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,9 @@ alloc_dom_mem(struct domain *d,
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Initialise the machine-to-phys mapping for this page. */
|
||||
set_machinetophys(page_to_pfn(page), d->tot_pages - 1);
|
||||
|
||||
/* Inform the domain of the new page's machine address. */
|
||||
if ( (extent_list != NULL) &&
|
||||
(__put_user(page_to_pfn(page), &extent_list[i]) != 0) )
|
||||
|
||||