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

[Xen-changelog] [xen-unstable] [HVM] Save/restore cleanups 04: Move new domctls out of common code.



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1169291861 0
# Node ID 1fd5f1754ceacdd0a1468535ac53144317e9be6f
# Parent  2457741f4ec308b1dd3368296df88a3806249afe
[HVM] Save/restore cleanups 04: Move new domctls out of common code.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/domctl.c |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++
 xen/common/domain.c   |    1 
 xen/common/domctl.c   |   73 -------------------------------------------------
 3 files changed, 74 insertions(+), 74 deletions(-)

diff -r 2457741f4ec3 -r 1fd5f1754cea xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Sat Jan 20 11:17:40 2007 +0000
+++ b/xen/arch/x86/domctl.c     Sat Jan 20 11:17:41 2007 +0000
@@ -293,6 +293,80 @@ _long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_sethvmcontext:
+    { 
+        struct hvm_domain_context *c;
+        struct domain             *d;
+        struct vcpu               *v;
+
+        ret = -ESRCH;
+        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
+            break;
+
+        ret = -ENOMEM;
+        if ( (c = xmalloc(struct hvm_domain_context)) == NULL )
+            goto sethvmcontext_out;
+
+        v = d->vcpu[0];
+        
+        ret = -EFAULT;
+
+#ifndef CONFIG_COMPAT
+        if ( copy_from_guest(c, domctl->u.hvmcontext.ctxt, 1) != 0 )
+            goto sethvmcontext_out;
+
+        ret = arch_sethvm_ctxt(v, c);
+#endif
+
+        xfree(c);
+
+    sethvmcontext_out:
+        put_domain(d);
+
+    }
+    break;
+
+
+    case XEN_DOMCTL_gethvmcontext:
+    { 
+        struct hvm_domain_context *c;
+        struct domain             *d;
+        struct vcpu               *v;
+
+        ret = -ESRCH;
+        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
+            break;
+
+        ret = -ENOMEM;
+        if ( (c = xmalloc(struct hvm_domain_context)) == NULL )
+            goto gethvmcontext_out;
+
+        v = d->vcpu[0];
+
+        ret = -ENODATA;
+        if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
+            goto gethvmcontext_out;
+        
+        ret = 0;
+        if (arch_gethvm_ctxt(v, c) == -1)
+            ret = -EFAULT;
+
+#ifndef CONFIG_COMPAT
+        if ( copy_to_guest(domctl->u.hvmcontext.ctxt, c, 1) )
+            ret = -EFAULT;
+
+        xfree(c);
+#endif
+
+        if ( copy_to_guest(u_domctl, domctl, 1) )
+            ret = -EFAULT;
+
+    gethvmcontext_out:
+        put_domain(d);
+
+    }
+    break;
+
     default:
         ret = -ENOSYS;
         break;
diff -r 2457741f4ec3 -r 1fd5f1754cea xen/common/domain.c
--- a/xen/common/domain.c       Sat Jan 20 11:17:40 2007 +0000
+++ b/xen/common/domain.c       Sat Jan 20 11:17:41 2007 +0000
@@ -24,7 +24,6 @@
 #include <xen/percpu.h>
 #include <xen/multicall.h>
 #include <asm/debugger.h>
-#include <asm/hvm/support.h>
 #include <public/sched.h>
 #include <public/vcpu.h>
 #ifdef CONFIG_COMPAT
diff -r 2457741f4ec3 -r 1fd5f1754cea xen/common/domctl.c
--- a/xen/common/domctl.c       Sat Jan 20 11:17:40 2007 +0000
+++ b/xen/common/domctl.c       Sat Jan 20 11:17:41 2007 +0000
@@ -218,39 +218,6 @@ ret_t do_domctl(XEN_GUEST_HANDLE(xen_dom
     }
     break;
 
-    case XEN_DOMCTL_sethvmcontext:
-    { 
-        struct hvm_domain_context *c;
-        struct domain             *d;
-        struct vcpu               *v;
-
-        ret = -ESRCH;
-        if ( (d = find_domain_by_id(op->domain)) == NULL )
-            break;
-
-        ret = -ENOMEM;
-        if ( (c = xmalloc(struct hvm_domain_context)) == NULL )
-            goto sethvmcontext_out;
-
-        v = d->vcpu[0];
-        
-        ret = -EFAULT;
-
-#ifndef CONFIG_COMPAT
-        if ( copy_from_guest(c, op->u.hvmcontext.ctxt, 1) != 0 )
-            goto sethvmcontext_out;
-
-        ret = arch_sethvm_ctxt(v, c);
-#endif
-
-        xfree(c);
-
-    sethvmcontext_out:
-        put_domain(d);
-
-    }
-    break;
-
     case XEN_DOMCTL_pausedomain:
     {
         struct domain *d = find_domain_by_id(op->domain);
@@ -605,46 +572,6 @@ ret_t do_domctl(XEN_GUEST_HANDLE(xen_dom
     }
     break;
 
-    case XEN_DOMCTL_gethvmcontext:
-    { 
-        struct hvm_domain_context *c;
-        struct domain             *d;
-        struct vcpu               *v;
-
-        ret = -ESRCH;
-        if ( (d = find_domain_by_id(op->domain)) == NULL )
-            break;
-
-        ret = -ENOMEM;
-        if ( (c = xmalloc(struct hvm_domain_context)) == NULL )
-            goto gethvmcontext_out;
-
-        v = d->vcpu[0];
-
-        ret = -ENODATA;
-        if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
-            goto gethvmcontext_out;
-        
-        ret = 0;
-        if (arch_gethvm_ctxt(v, c) == -1)
-            ret = -EFAULT;
-
-#ifndef CONFIG_COMPAT
-        if ( copy_to_guest(op->u.hvmcontext.ctxt, c, 1) )
-            ret = -EFAULT;
-
-        xfree(c);
-#endif
-
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
-
-    gethvmcontext_out:
-        put_domain(d);
-
-    }
-    break;
-
     case XEN_DOMCTL_getvcpuinfo:
     { 
         struct domain *d;

_______________________________________________
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®.