ia64/xen-unstable

changeset 2150:e991e54df4a7

bitkeeper revision 1.1159.12.2 (4117f3b8rwM8OBu0SxwoWkvUXsjLTQ)

add migration support to ngio frontend blk driver.
author iap10@labyrinth.cl.cam.ac.uk
date Mon Aug 09 21:59:20 2004 +0000 (2004-08-09)
parents d5848b157343
children 0b883cd8b325
files BitKeeper/etc/ignore linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c
line diff
     1.1 --- a/BitKeeper/etc/ignore	Mon Aug 09 21:46:57 2004 +0000
     1.2 +++ b/BitKeeper/etc/ignore	Mon Aug 09 21:59:20 2004 +0000
     1.3 @@ -16,9 +16,11 @@ docs/*.aux
     1.4  docs/*.log
     1.5  docs/*.pdf
     1.6  docs/*.ps
     1.7 +docs/*.dvi
     1.8  docs/*.toc
     1.9  docs/interface/*
    1.10  docs/user/*
    1.11 +docs/xend/*
    1.12  extras/mini-os/h/hypervisor-ifs
    1.13  install
    1.14  install/*
    1.15 @@ -51,4 +53,3 @@ xen/tools/figlet/figlet
    1.16  xen/xen
    1.17  xen/xen-syms
    1.18  xen/xen.*
    1.19 -xen/common/sched_atropos.c.smh
     2.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 09 21:46:57 2004 +0000
     2.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 09 21:59:20 2004 +0000
     2.3 @@ -303,6 +303,26 @@ static void kick_pending_request_queues(
     2.4  }
     2.5  
     2.6  
     2.7 +/* Upon block read completion, issue a dummy machphys update for the
     2.8 +pages in the buffer, just in case we're being migrated. */
     2.9 +
    2.10 +static void blkif_read_completion(struct request *req)
    2.11 +{
    2.12 +	struct bio *bio;
    2.13 +	struct bio_vec *bvec;
    2.14 +	int idx;
    2.15 +	unsigned long mfn, pfn
    2.16 +
    2.17 +	rq_for_each_bio(bio, req) {
    2.18 +		bio_for_each_segment(bvec, bio, idx) {
    2.19 +		    mfn = page_to_phys(bvec->bv_page)>>PAGE_SHIFT;
    2.20 +		    pfn = machine_to_phys_mapping[mfn];
    2.21 +		    queue_machphys_update(mfn, pfn);
    2.22 +		}
    2.23 +	}
    2.24 +}
    2.25 +
    2.26 +
    2.27  static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs)
    2.28  {
    2.29  	struct request *req;
    2.30 @@ -334,6 +354,9 @@ static irqreturn_t blkif_int(int irq, vo
    2.31  				BUG();
    2.32  
    2.33  			end_that_request_last(req);
    2.34 +
    2.35 +			if( bret->operation == BLKIF_OP_READ )
    2.36 +			    blkif_read_completion( req );
    2.37  			break;
    2.38                  case BLKIF_OP_PROBE:
    2.39                          memcpy(&blkif_control_rsp, bret, sizeof(*bret));
     3.1 --- a/tools/libxc/xc_linux_restore.c	Mon Aug 09 21:46:57 2004 +0000
     3.2 +++ b/tools/libxc/xc_linux_restore.c	Mon Aug 09 21:59:20 2004 +0000
     3.3 @@ -214,7 +214,8 @@ int xc_linux_restore(int xc_handle, XcIO
     3.4      if ( xc_domain_setinitialmem(xc_handle, dom, 
     3.5                                   nr_pfns * (PAGE_SIZE / 1024)) )
     3.6      {
     3.7 -        xcio_error(ioctxt, "Could not set domain initial memory");
     3.8 +        xcio_error(ioctxt, "Could not set domain %d initial memory. pfns=%d, %dKB",
     3.9 +		   dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
    3.10          goto out;
    3.11      }
    3.12  
     4.1 --- a/tools/libxc/xc_linux_save.c	Mon Aug 09 21:46:57 2004 +0000
     4.2 +++ b/tools/libxc/xc_linux_save.c	Mon Aug 09 21:59:20 2004 +0000
     4.3 @@ -632,7 +632,7 @@ int xc_linux_save(int xc_handle, XcIOCon
     4.4                  pfn_batch[batch] = n;
     4.5                  pfn_type[batch] = live_pfn_to_mfn_table[n];
     4.6  
     4.7 -                if( pfn_type[batch] == 0x80000004 ){
     4.8 +                if( pfn_type[batch] == 0x80000001 ){
     4.9                      /* not currently in pusedo-physical map -- set bit
    4.10                         in to_fix that we must send this page in last_iter
    4.11                         unless its sent sooner anyhow */