diff options
author | Keir Fraser <keir@xensource.com> | 2007-06-27 21:43:43 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-06-27 21:43:43 +0100 |
commit | 41b3adc9252a1d70ea1e7a4f67696227adbed2ca (patch) | |
tree | 666a8e9f493ceb8b3a3eccf9abb0d73dd6eb8795 /xen/common/sysctl.c | |
parent | 9ba645fd7db85d46ea47e8020752ad971f233f61 (diff) | |
download | xen-41b3adc9252a1d70ea1e7a4f67696227adbed2ca.tar.gz xen-41b3adc9252a1d70ea1e7a4f67696227adbed2ca.tar.bz2 xen-41b3adc9252a1d70ea1e7a4f67696227adbed2ca.zip |
More getcpuinfo sysctl cleanup.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/sysctl.c')
-rw-r--r-- | xen/common/sysctl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 16a6b5fb31..efc7c2fd1a 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -136,13 +136,13 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) } break; - case XEN_SYSCTL_cpuinfo: + case XEN_SYSCTL_getcpuinfo: { uint32_t i, nr_cpus; - uint64_t idletime; + struct xen_sysctl_cpuinfo cpuinfo; struct vcpu *v; - nr_cpus = min_t(uint32_t, op->u.cpuinfo.max_cpus, NR_CPUS); + nr_cpus = min_t(uint32_t, op->u.getcpuinfo.max_cpus, NR_CPUS); for ( i = 0; i < nr_cpus; i++ ) { @@ -150,18 +150,18 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) if ( (v = idle_vcpu[i]) == NULL ) break; - idletime = v->runstate.time[RUNSTATE_running]; + cpuinfo.idletime = v->runstate.time[RUNSTATE_running]; if ( v->is_running ) - idletime += NOW() - v->runstate.state_entry_time; + cpuinfo.idletime += NOW() - v->runstate.state_entry_time; - if ( copy_to_guest_offset(op->u.cpuinfo.buffer, i, &idletime, 1) ) + if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) ) { ret = -EFAULT; break; } } - op->u.cpuinfo.nr_cpus = i; + op->u.getcpuinfo.nr_cpus = i; ret = 0; if ( copy_to_guest(u_sysctl, op, 1) ) |