ia64/xen-unstable

changeset 11091:befab551b0e1

[HVM] HVMOP_get_param return parameter value within the provided parameter struct,
not as a direct return value.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Aug 13 09:44:07 2006 +0100 (2006-08-13)
parents 0340e579f065
children 21240dc9f2e8
files xen/arch/x86/hvm/hvm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Sat Aug 12 16:18:08 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Sun Aug 13 09:44:07 2006 +0100
     1.3 @@ -568,7 +568,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
     1.4          else if ( IS_PRIV(current->domain) )
     1.5          {
     1.6              d = find_domain_by_id(a.domid);
     1.7 -            if ( !d )
     1.8 +            if ( d == NULL )
     1.9                  return -ESRCH;
    1.10          }
    1.11          else
    1.12 @@ -578,22 +578,24 @@ long do_hvm_op(unsigned long op, XEN_GUE
    1.13  
    1.14          if ( op == HVMOP_set_param )
    1.15          {
    1.16 +            d->arch.hvm_domain.params[a.index] = a.value;
    1.17              rc = 0;
    1.18 -            d->arch.hvm_domain.params[a.index] = a.value;
    1.19          }
    1.20          else
    1.21          {
    1.22 -            rc = d->arch.hvm_domain.params[a.index];
    1.23 +            a.value = d->arch.hvm_domain.params[a.index];
    1.24 +            rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
    1.25          }
    1.26  
    1.27          put_domain(d);
    1.28 -        return rc;
    1.29 +        break;
    1.30      }
    1.31  
    1.32      default:
    1.33      {
    1.34          DPRINTK("Bad HVM op %ld.\n", op);
    1.35          rc = -ENOSYS;
    1.36 +        break;
    1.37      }
    1.38      }
    1.39