/* Set the pool of pages to the required number of pages.
* Returns 0 for success, non-zero for failure. */
-static unsigned int
+static int
hap_set_allocation(struct domain *d, unsigned int pages, int *preempted)
{
struct page_info *pg;
old_pages = d->arch.paging.hap.total_pages;
if ( old_pages == 0 )
{
- unsigned int r;
paging_lock(d);
- r = hap_set_allocation(d, 256, NULL);
- if ( r != 0 )
+ rv = hap_set_allocation(d, 256, NULL);
+ if ( rv != 0 )
{
hap_set_allocation(d, 0, NULL);
paging_unlock(d);
- rv = -ENOMEM;
goto out;
}
paging_unlock(d);
* Input will be rounded up to at least shadow_min_acceptable_pages(),
* plus space for the p2m table.
* Returns 0 for success, non-zero for failure. */
-static unsigned int sh_set_allocation(struct domain *d,
- unsigned int pages,
- int *preempted)
+static int sh_set_allocation(struct domain *d,
+ unsigned int pages,
+ int *preempted)
{
struct page_info *sp;
unsigned int lower_bound;
old_pages = d->arch.paging.shadow.total_pages;
if ( old_pages == 0 )
{
- unsigned int r;
paging_lock(d);
- r = sh_set_allocation(d, 1024, NULL); /* Use at least 4MB */
- if ( r != 0 )
+ rv = sh_set_allocation(d, 1024, NULL); /* Use at least 4MB */
+ if ( rv != 0 )
{
sh_set_allocation(d, 0, NULL);
- rv = -ENOMEM;
goto out_locked;
}
paging_unlock(d);