WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xen: Fix VCPUOP_set_periodic_timer return value.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 10 Mar 2007 10:30:12 -0800
Delivery-date: Sat, 10 Mar 2007 10:29:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xen: Fix VCPUOP_set_periodic_timer return value., Xen patchbot-unstable <=