ia64/xen-unstable

changeset 15754:0d367c186e8c

[xen, xencomm] xencomm trivial bug fix
- fix return address of xencomm_copy_to_guest()
- fix xencomm_add_offset()
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Tue Aug 14 16:01:08 2007 +0100 (2007-08-14)
parents e9a5c6b2acbe
children 3db3c4868568
files xen/common/xencomm.c
line diff
     1.1 --- a/xen/common/xencomm.c	Tue Aug 14 15:58:16 2007 +0100
     1.2 +++ b/xen/common/xencomm.c	Tue Aug 14 16:01:08 2007 +0100
     1.3 @@ -232,7 +232,7 @@ xencomm_copy_to_guest(void *to, const vo
     1.4  
     1.5              dest_maddr = paddr_to_maddr(dest_paddr + chunk_skip);
     1.6              if (dest_maddr == 0)
     1.7 -                return -1;
     1.8 +                return n - from_pos;
     1.9  
    1.10              if (xencomm_debug)
    1.11                  printk("%lx[%d] -> %lx\n", source, bytes, dest_maddr);
    1.12 @@ -280,6 +280,11 @@ int xencomm_add_offset(void **handle, un
    1.13          unsigned int chunksz;
    1.14          unsigned int chunk_skip;
    1.15  
    1.16 +        if (dest_paddr == XENCOMM_INVALID) {
    1.17 +            i++;
    1.18 +            continue;
    1.19 +        }
    1.20 +
    1.21          pgoffset = dest_paddr % PAGE_SIZE;
    1.22          chunksz = PAGE_SIZE - pgoffset;
    1.23  
    1.24 @@ -291,6 +296,8 @@ int xencomm_add_offset(void **handle, un
    1.25              desc->address[i] += chunk_skip;
    1.26          }
    1.27          bytes -= chunk_skip;
    1.28 +
    1.29 +        i++;
    1.30      }
    1.31      return 0;
    1.32  }