direct-io.hg

changeset 14327:8fa8de63abf4

xen: Fix VCPUOP_set_periodic_timer return value.
Clean up vcpu_op() code, and fix a couple of comments.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Sat Mar 10 16:22:52 2007 +0000 (2007-03-10)
parents cedf9e4ac6ff
children 7f624c770dbd
files xen/common/domain.c xen/common/schedule.c
line diff
     1.1 --- a/xen/common/domain.c	Fri Mar 09 19:36:24 2007 +0000
     1.2 +++ b/xen/common/domain.c	Sat Mar 10 16:22:52 2007 +0000
     1.3 @@ -546,16 +546,12 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
     1.4      {
     1.5      case VCPUOP_initialise:
     1.6          if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
     1.7 -        {
     1.8 -            rc = -ENOMEM;
     1.9 -            break;
    1.10 -        }
    1.11 +            return -ENOMEM;
    1.12  
    1.13          if ( copy_from_guest(ctxt, arg, 1) )
    1.14          {
    1.15              xfree(ctxt);
    1.16 -            rc = -EFAULT;
    1.17 -            break;
    1.18 +            return -EFAULT;
    1.19          }
    1.20  
    1.21          LOCK_BIGLOCK(d);
    1.22 @@ -569,9 +565,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
    1.23  
    1.24      case VCPUOP_up:
    1.25          if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
    1.26 -            rc = -EINVAL;
    1.27 -        else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
    1.28 +            return -EINVAL;
    1.29 +
    1.30 +        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
    1.31              vcpu_wake(v);
    1.32 +
    1.33          break;
    1.34  
    1.35      case VCPUOP_down:
    1.36 @@ -596,13 +594,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
    1.37      {
    1.38          struct vcpu_set_periodic_timer set;
    1.39  
    1.40 -        rc = -EFAULT;
    1.41          if ( copy_from_guest(&set, arg, 1) )
    1.42 -            break;
    1.43 +            return -EFAULT;
    1.44  
    1.45 -        rc = -EINVAL;
    1.46          if ( set.period_ns < MILLISECS(1) )
    1.47 -            break;
    1.48 +            return -EINVAL;
    1.49  
    1.50          v->periodic_period = set.period_ns;
    1.51          vcpu_force_reschedule(v);
     2.1 --- a/xen/common/schedule.c	Fri Mar 09 19:36:24 2007 +0000
     2.2 +++ b/xen/common/schedule.c	Sat Mar 10 16:22:52 2007 +0000
     2.3 @@ -110,7 +110,7 @@ int sched_init_vcpu(struct vcpu *v, unsi
     2.4      else
     2.5          cpus_setall(v->cpu_affinity);
     2.6  
     2.7 -    /* Initialise the per-domain timers. */
     2.8 +    /* Initialise the per-vcpu timers. */
     2.9      init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
    2.10                 v, v->processor);
    2.11      init_timer(&v->singleshot_timer, vcpu_singleshot_timer_fn,
    2.12 @@ -471,7 +471,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
    2.13  
    2.14  #ifndef COMPAT
    2.15  
    2.16 -/* Per-domain one-shot-timer hypercall. */
    2.17 +/* Per-vcpu oneshot-timer hypercall. */
    2.18  long do_set_timer_op(s_time_t timeout)
    2.19  {
    2.20      struct vcpu *v = current;