Even if unlikely, donate_page() should not ignore the possible need to
obtain a domain reference. To make people look more closely when they
add new uses of domain_adjust_tot_pages(), force its return value to be
checked. This in turn requires a benign change to assign_pages().
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
{
if ( d->tot_pages >= d->max_pages )
goto fail;
- domain_adjust_tot_pages(d, 1);
+ if ( unlikely(domain_adjust_tot_pages(d, 1) == 1) )
+ get_knownalive_domain(d);
}
page->count_info = PGC_allocated | 1;
goto out;
}
- if ( unlikely(d->tot_pages == 0) )
+ if ( unlikely(domain_adjust_tot_pages(d, 1 << order) == (1 << order)) )
get_knownalive_domain(d);
-
- domain_adjust_tot_pages(d, 1 << order);
}
for ( i = 0; i < (1 << order); i++ )
*/
int populate_pt_range(unsigned long virt, unsigned long nr_mfns);
/* Claim handling */
-unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+unsigned long __must_check domain_adjust_tot_pages(struct domain *d,
+ long pages);
int domain_set_outstanding_pages(struct domain *d, unsigned long pages);
void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages);