ia64/xen-unstable

changeset 14641:31f20aaac818

xen: Pause domain when changing debug status.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Mar 29 13:29:24 2007 +0100 (2007-03-29)
parents a545ac9028d2
children 4b13fc910acf
files xen/common/domctl.c
line diff
     1.1 --- a/xen/common/domctl.c	Thu Mar 29 12:04:35 2007 +0100
     1.2 +++ b/xen/common/domctl.c	Thu Mar 29 13:29:24 2007 +0100
     1.3 @@ -620,29 +620,33 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
     1.4      case XEN_DOMCTL_setdomainhandle:
     1.5      {
     1.6          struct domain *d;
     1.7 +
     1.8          ret = -ESRCH;
     1.9          d = rcu_lock_domain_by_id(op->domain);
    1.10 -        if ( d != NULL )
    1.11 -        {
    1.12 -            memcpy(d->handle, op->u.setdomainhandle.handle,
    1.13 -                   sizeof(xen_domain_handle_t));
    1.14 -            rcu_unlock_domain(d);
    1.15 -            ret = 0;
    1.16 -        }
    1.17 +        if ( d == NULL )
    1.18 +            break;
    1.19 +
    1.20 +        memcpy(d->handle, op->u.setdomainhandle.handle,
    1.21 +               sizeof(xen_domain_handle_t));
    1.22 +        rcu_unlock_domain(d);
    1.23 +        ret = 0;
    1.24      }
    1.25      break;
    1.26  
    1.27      case XEN_DOMCTL_setdebugging:
    1.28      {
    1.29          struct domain *d;
    1.30 +
    1.31          ret = -ESRCH;
    1.32          d = rcu_lock_domain_by_id(op->domain);
    1.33 -        if ( d != NULL )
    1.34 -        {
    1.35 -            d->debugger_attached = !!op->u.setdebugging.enable;
    1.36 -            rcu_unlock_domain(d);
    1.37 -            ret = 0;
    1.38 -        }
    1.39 +        if ( d == NULL )
    1.40 +            break;
    1.41 +
    1.42 +        domain_pause(d);
    1.43 +        d->debugger_attached = !!op->u.setdebugging.enable;
    1.44 +        domain_unpause(d); /* causes guest to latch new status */
    1.45 +        rcu_unlock_domain(d);
    1.46 +        ret = 0;
    1.47      }
    1.48      break;
    1.49