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

[Xen-changelog] [xen-unstable] [HVM] HVMOP_get_param return parameter value within the provided parameter struct,



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID befab551b0e13c70f11a8b2192e126ab4de47439
# Parent  0340e579f06544431e915d17596ac144145a077e
[HVM] HVMOP_get_param return parameter value within the provided parameter 
struct,
not as a direct return value.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r 0340e579f065 -r befab551b0e1 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Sat Aug 12 16:18:08 2006 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Sun Aug 13 09:44:07 2006 +0100
@@ -568,7 +568,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
         else if ( IS_PRIV(current->domain) )
         {
             d = find_domain_by_id(a.domid);
-            if ( !d )
+            if ( d == NULL )
                 return -ESRCH;
         }
         else
@@ -578,22 +578,24 @@ long do_hvm_op(unsigned long op, XEN_GUE
 
         if ( op == HVMOP_set_param )
         {
+            d->arch.hvm_domain.params[a.index] = a.value;
             rc = 0;
-            d->arch.hvm_domain.params[a.index] = a.value;
         }
         else
         {
-            rc = d->arch.hvm_domain.params[a.index];
+            a.value = d->arch.hvm_domain.params[a.index];
+            rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
         }
 
         put_domain(d);
-        return rc;
+        break;
     }
 
     default:
     {
         DPRINTK("Bad HVM op %ld.\n", op);
         rc = -ENOSYS;
+        break;
     }
     }
 

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