direct-io.hg

changeset 2324:f606a346ef33

bitkeeper revision 1.1159.45.14 (412629e8AO8Ty3LNUQeMVLVbHFMAQQ)

Fix SET_FOREIGNDOM
author kaf24@scramble.cl.cam.ac.uk
date Fri Aug 20 16:42:16 2004 +0000 (2004-08-20)
parents 274473cddeee
children 5678a9fdb972
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Fri Aug 20 16:23:53 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Fri Aug 20 16:42:16 2004 +0000
     1.3 @@ -864,12 +864,17 @@ static int do_extended_command(unsigned 
     1.4      case MMUEXT_SET_FOREIGNDOM:
     1.5          domid = (domid_t)(val >> 16);
     1.6  
     1.7 +        if ( (e = percpu_info[cpu].foreign) != NULL )
     1.8 +            put_domain(e);
     1.9 +        percpu_info[cpu].foreign = NULL;
    1.10 +
    1.11          if ( !IS_PRIV(d) )
    1.12          {
    1.13              switch ( domid )
    1.14              {
    1.15              case DOMID_IO:
    1.16 -                get_knownalive_domain(e = dom_io);
    1.17 +                get_knownalive_domain(dom_io);
    1.18 +                percpu_info[cpu].foreign = dom_io;
    1.19                  break;
    1.20              default:
    1.21                  MEM_LOG("Dom %u cannot set foreign dom\n", d->domain);
    1.22 @@ -879,19 +884,18 @@ static int do_extended_command(unsigned 
    1.23          }
    1.24          else
    1.25          {
    1.26 -            if ( (e = percpu_info[cpu].foreign) != NULL )
    1.27 -                put_domain(e);
    1.28 -
    1.29              percpu_info[cpu].foreign = e = find_domain_by_id(domid);
    1.30              if ( e == NULL )
    1.31              {
    1.32                  switch ( domid )
    1.33                  {
    1.34                  case DOMID_XEN:
    1.35 -                    get_knownalive_domain(e = dom_xen);
    1.36 +                    get_knownalive_domain(dom_xen);
    1.37 +                    percpu_info[cpu].foreign = dom_xen;
    1.38                      break;
    1.39                  case DOMID_IO:
    1.40 -                    get_knownalive_domain(e = dom_io);
    1.41 +                    get_knownalive_domain(dom_io);
    1.42 +                    percpu_info[cpu].foreign = dom_io;
    1.43                      break;
    1.44                  default:
    1.45                      MEM_LOG("Unknown domain '%u'", domid);