ia64/xen-unstable

changeset 6708:aa0990ef260f

merge
author iap10@freefall.cl.cam.ac.uk
date Thu Sep 08 17:42:49 2005 +0000 (2005-09-08)
parents 3bde4219c681 a27e28d38d52
children c7999d49ecf7
files tools/libxc/xc_domain.c tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_private.c tools/libxc/xenctrl.h tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/image.py xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/mm.c xen/common/grant_table.c xen/common/trace.c xen/common/xmalloc.c xen/drivers/char/console.c xen/drivers/char/serial.c xen/include/asm-x86/page.h
line diff
    12.1 --- a/xen/common/grant_table.c	Thu Sep 08 17:40:37 2005 +0000
    12.2 +++ b/xen/common/grant_table.c	Thu Sep 08 17:42:49 2005 +0000
    12.3 @@ -815,19 +815,24 @@ gnttab_donate(gnttab_donate_t *uop, unsi
    12.4  #endif
    12.5          page = &frame_table[gop->mfn];
    12.6          
    12.7 -        if (unlikely(IS_XEN_HEAP_FRAME(page))) { 
    12.8 +        if ( unlikely(IS_XEN_HEAP_FRAME(page)))
    12.9 +        { 
   12.10              printk("gnttab_donate: xen heap frame mfn=%lx\n", 
   12.11                     (unsigned long) gop->mfn);
   12.12              gop->status = GNTST_bad_virt_addr;
   12.13              continue;
   12.14          }
   12.15 -        if (unlikely(!pfn_valid(page_to_pfn(page)))) {
   12.16 +        
   12.17 +        if ( unlikely(!pfn_valid(page_to_pfn(page))) )
   12.18 +        {
   12.19              printk("gnttab_donate: invalid pfn for mfn=%lx\n", 
   12.20                     (unsigned long) gop->mfn);
   12.21              gop->status = GNTST_bad_virt_addr;
   12.22              continue;
   12.23          }
   12.24 -        if (unlikely((e = find_domain_by_id(gop->domid)) == NULL)) {
   12.25 +
   12.26 +        if ( unlikely((e = find_domain_by_id(gop->domid)) == NULL) )
   12.27 +        {
   12.28              printk("gnttab_donate: can't find domain %d\n", gop->domid);
   12.29              gop->status = GNTST_bad_domain;
   12.30              continue;
   12.31 @@ -881,13 +886,14 @@ gnttab_donate(gnttab_donate_t *uop, unsi
   12.32           * headroom.  Also, a domain mustn't have PGC_allocated
   12.33           * pages when it is dying.
   12.34           */
   12.35 -        ASSERT(e->tot_pages <= e->max_pages);
   12.36 -        if (unlikely(test_bit(DOMFLAGS_DYING, &e->domain_flags)) ||
   12.37 -            unlikely(e->tot_pages == e->max_pages) ||
   12.38 -            unlikely(!gnttab_prepare_for_transfer(e, d, gop->handle))) {
   12.39 -            printk("gnttab_donate: Transferee has no reservation headroom (%d,"
   12.40 -                   "%d) or provided a bad grant ref (%08x) or is dying (%p)\n",
   12.41 -                   e->tot_pages, e->max_pages, gop->handle, e->d_flags);
   12.42 +        if ( unlikely(test_bit(DOMFLAGS_DYING, &e->domain_flags)) ||
   12.43 +             unlikely(e->tot_pages >= e->max_pages) ||
   12.44 +             unlikely(!gnttab_prepare_for_transfer(e, d, gop->handle)) )
   12.45 +        {
   12.46 +            DPRINTK("gnttab_donate: Transferee has no reservation headroom "
   12.47 +                    "(%d,%d) or provided a bad grant ref (%08x) or "
   12.48 +                    "is dying (%lx)\n",
   12.49 +                    e->tot_pages, e->max_pages, gop->handle, e->domain_flags);
   12.50              spin_unlock(&e->page_alloc_lock);
   12.51              put_domain(e);
   12.52              gop->status = result = GNTST_general_error;
   12.53 @@ -895,9 +901,8 @@ gnttab_donate(gnttab_donate_t *uop, unsi
   12.54          }
   12.55  
   12.56          /* Okay, add the page to 'e'. */
   12.57 -        if (unlikely(e->tot_pages++ == 0)) {
   12.58 +        if ( unlikely(e->tot_pages++ == 0) )
   12.59              get_knownalive_domain(e);
   12.60 -        }
   12.61          list_add_tail(&page->list, &e->page_list);
   12.62          page_set_owner(page, e);
   12.63          
   12.64 @@ -913,6 +918,7 @@ gnttab_donate(gnttab_donate_t *uop, unsi
   12.65          
   12.66          gop->status = GNTST_okay;
   12.67      }
   12.68 +
   12.69      return result;
   12.70  }
   12.71