ia64/xen-unstable

changeset 1513:639166dab6cf

bitkeeper revision 1.990 (40d68397bwq-y7FYqVQDBuzsbxWyNA)

Only pause a domain in getdomainfo if we're reading execution context.
author kaf24@scramble.cl.cam.ac.uk
date Mon Jun 21 06:43:35 2004 +0000 (2004-06-21)
parents af9edd9590d8
children 9e12dfe14287 ba9bae2d9a60 3862329b4861
files xen/common/dom0_ops.c
line diff
     1.1 --- a/xen/common/dom0_ops.c	Mon Jun 21 06:13:50 2004 +0000
     1.2 +++ b/xen/common/dom0_ops.c	Mon Jun 21 06:43:35 2004 +0000
     1.3 @@ -295,21 +295,16 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     1.4  
     1.5          read_unlock_irqrestore(&tasklist_lock, flags);
     1.6  
     1.7 -        op->u.getdomaininfo.flags =
     1.8 -            (test_bit(DF_RUNNING, &d->flags) ? DOMFLAGS_RUNNING : 0);
     1.9 -
    1.10 -        if ( d != current )
    1.11 -            domain_pause(d);
    1.12 -
    1.13          op->u.getdomaininfo.domain = d->domain;
    1.14          strcpy(op->u.getdomaininfo.name, d->name);
    1.15          
    1.16 -        op->u.getdomaininfo.flags |=
    1.17 +        op->u.getdomaininfo.flags =
    1.18              (test_bit(DF_DYING,     &d->flags) ? DOMFLAGS_DYING     : 0) |
    1.19              (test_bit(DF_CRASHED,   &d->flags) ? DOMFLAGS_CRASHED   : 0) |
    1.20              (test_bit(DF_SUSPENDED, &d->flags) ? DOMFLAGS_SUSPENDED : 0) |
    1.21              (test_bit(DF_STOPPED,   &d->flags) ? DOMFLAGS_STOPPED   : 0) |
    1.22 -            (test_bit(DF_BLOCKED,   &d->flags) ? DOMFLAGS_BLOCKED   : 0);
    1.23 +            (test_bit(DF_BLOCKED,   &d->flags) ? DOMFLAGS_BLOCKED   : 0) |
    1.24 +            (test_bit(DF_RUNNING,   &d->flags) ? DOMFLAGS_RUNNING   : 0);
    1.25  
    1.26          op->u.getdomaininfo.flags |= d->processor << DOMFLAGS_CPUSHIFT;
    1.27          op->u.getdomaininfo.flags |= 
    1.28 @@ -326,9 +321,13 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.29              if ( (c = kmalloc(sizeof(*c), GFP_KERNEL)) == NULL )
    1.30              {
    1.31                  ret = -ENOMEM;
    1.32 -                goto gdi_out;
    1.33 +                put_domain(d);
    1.34 +                break;
    1.35              }
    1.36  
    1.37 +            if ( d != current )
    1.38 +                domain_pause(d);
    1.39 +
    1.40              c->flags = 0;
    1.41              memcpy(&c->cpu_ctxt, 
    1.42                     &d->shared_info->execution_context,
    1.43 @@ -376,6 +375,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.44              c->failsafe_callback_eip = 
    1.45                  d->failsafe_address;
    1.46  
    1.47 +            if ( d != current )
    1.48 +                domain_unpause(d);
    1.49 +
    1.50              if ( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) )
    1.51                  ret = -EINVAL;
    1.52  
    1.53 @@ -386,9 +388,6 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.54          if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )     
    1.55              ret = -EINVAL;
    1.56  
    1.57 -    gdi_out:
    1.58 -        if ( d != current )
    1.59 -            domain_unpause(d);
    1.60          put_domain(d);
    1.61      }
    1.62      break;