[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen: Fix VCPUOP_set_periodic_timer return value.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173543772 0
# Node ID 8fa8de63abf48473e06755bd1f4f4ea29386e592
# Parent  cedf9e4ac6ff6c3541d90b2ad5db6e224e3e574d
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@xxxxxxxxxxxxx>
---
 xen/common/domain.c   |   22 +++++++++-------------
 xen/common/schedule.c |    4 ++--
 2 files changed, 11 insertions(+), 15 deletions(-)

diff -r cedf9e4ac6ff -r 8fa8de63abf4 xen/common/domain.c
--- a/xen/common/domain.c       Fri Mar 09 19:36:24 2007 +0000
+++ b/xen/common/domain.c       Sat Mar 10 16:22:52 2007 +0000
@@ -546,16 +546,12 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
     {
     case VCPUOP_initialise:
         if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
-        {
-            rc = -ENOMEM;
-            break;
-        }
+            return -ENOMEM;
 
         if ( copy_from_guest(ctxt, arg, 1) )
         {
             xfree(ctxt);
-            rc = -EFAULT;
-            break;
+            return -EFAULT;
         }
 
         LOCK_BIGLOCK(d);
@@ -569,9 +565,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
 
     case VCPUOP_up:
         if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
-            rc = -EINVAL;
-        else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+            return -EINVAL;
+
+        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
             vcpu_wake(v);
+
         break;
 
     case VCPUOP_down:
@@ -596,13 +594,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
     {
         struct vcpu_set_periodic_timer set;
 
-        rc = -EFAULT;
         if ( copy_from_guest(&set, arg, 1) )
-            break;
-
-        rc = -EINVAL;
+            return -EFAULT;
+
         if ( set.period_ns < MILLISECS(1) )
-            break;
+            return -EINVAL;
 
         v->periodic_period = set.period_ns;
         vcpu_force_reschedule(v);
diff -r cedf9e4ac6ff -r 8fa8de63abf4 xen/common/schedule.c
--- a/xen/common/schedule.c     Fri Mar 09 19:36:24 2007 +0000
+++ b/xen/common/schedule.c     Sat Mar 10 16:22:52 2007 +0000
@@ -110,7 +110,7 @@ int sched_init_vcpu(struct vcpu *v, unsi
     else
         cpus_setall(v->cpu_affinity);
 
-    /* Initialise the per-domain timers. */
+    /* Initialise the per-vcpu timers. */
     init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
                v, v->processor);
     init_timer(&v->singleshot_timer, vcpu_singleshot_timer_fn,
@@ -471,7 +471,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
 
 #ifndef COMPAT
 
-/* Per-domain one-shot-timer hypercall. */
+/* Per-vcpu oneshot-timer hypercall. */
 long do_set_timer_op(s_time_t timeout)
 {
     struct vcpu *v = current;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.