ia64/xen-unstable

changeset 12755:107f74d363ea

[XEN] Allow shutdown code to be set at most once per domain.
SIgned-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Dec 01 17:29:04 2006 +0000 (2006-12-01)
parents 69efe6730fb1
children 4b577c1909a9
files xen/common/domain.c
line diff
     1.1 --- a/xen/common/domain.c	Fri Dec 01 09:01:04 2006 -0800
     1.2 +++ b/xen/common/domain.c	Fri Dec 01 17:29:04 2006 +0000
     1.3 @@ -283,8 +283,8 @@ void domain_shutdown(struct domain *d, u
     1.4      if ( d->domain_id == 0 )
     1.5          dom0_shutdown(reason);
     1.6  
     1.7 -    d->shutdown_code = reason;
     1.8 -    set_bit(_DOMF_shutdown, &d->domain_flags);
     1.9 +    if ( !test_and_set_bit(_DOMF_shutdown, &d->domain_flags) )
    1.10 +        d->shutdown_code = reason;
    1.11  
    1.12      for_each_vcpu ( d, v )
    1.13          vcpu_sleep_nosync(v);