diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-08-25 18:39:10 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-08-25 18:39:10 +0100 |
commit | 1df421476a141955f4f04b7ad0fbaf73e57c8358 (patch) | |
tree | 6500dea6303559d54abd1b0ff49db083c463d0d8 /tools/libxc/xc_misc.c | |
parent | e76cb15dcecf1b78ecb1365ea0f955a97c5d2dd1 (diff) | |
download | xen-1df421476a141955f4f04b7ad0fbaf73e57c8358.tar.gz xen-1df421476a141955f4f04b7ad0fbaf73e57c8358.tar.bz2 xen-1df421476a141955f4f04b7ad0fbaf73e57c8358.zip |
Replace dom0_ops hypercall with three new hypercalls:
1. platform_op -- used by dom0 kernel to perform actions on the
hardware platform (e.g., MTRR access, microcode update, platform
quirks, ...)
2. domctl -- used by management tools to control a specified domain
3. sysctl -- used by management tools for system-wide actions
Benefits include more sensible factoring of actions to
hypercalls. Also allows tool compatibility to be tracked separately
from the dom0 kernel. The assumption is that it will be easier to
replace libxenctrl, libxenguest and Xen as a matched set if the
dom0 kernel does not need to be replaced too (e.g., because that
would require vendor revalidation).
From here on we hope to maintain dom0 kernel compatibility. This
promise is not extended to tool compatibility beyond the existing
guarantee that compatibility will not be broken within a three-level
stable release [3.0.2, 3.0.3, etc.].
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r-- | tools/libxc/xc_misc.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index 3fc8536a47..7b598124c4 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -12,20 +12,20 @@ int xc_readconsolering(int xc_handle, int clear) { int ret; - DECLARE_DOM0_OP; + DECLARE_SYSCTL; char *buffer = *pbuffer; unsigned int nr_chars = *pnr_chars; - op.cmd = DOM0_READCONSOLE; - set_xen_guest_handle(op.u.readconsole.buffer, buffer); - op.u.readconsole.count = nr_chars; - op.u.readconsole.clear = clear; + sysctl.cmd = XEN_SYSCTL_readconsole; + set_xen_guest_handle(sysctl.u.readconsole.buffer, buffer); + sysctl.u.readconsole.count = nr_chars; + sysctl.u.readconsole.clear = clear; if ( (ret = mlock(buffer, nr_chars)) != 0 ) return ret; - if ( (ret = do_dom0_op(xc_handle, &op)) == 0 ) - *pnr_chars = op.u.readconsole.count; + if ( (ret = do_sysctl(xc_handle, &sysctl)) == 0 ) + *pnr_chars = sysctl.u.readconsole.count; safe_munlock(buffer, nr_chars); @@ -36,15 +36,14 @@ int xc_physinfo(int xc_handle, xc_physinfo_t *put_info) { int ret; - DECLARE_DOM0_OP; + DECLARE_SYSCTL; - op.cmd = DOM0_PHYSINFO; - op.interface_version = DOM0_INTERFACE_VERSION; + sysctl.cmd = XEN_SYSCTL_physinfo; - if ( (ret = do_dom0_op(xc_handle, &op)) != 0 ) + if ( (ret = do_sysctl(xc_handle, &sysctl)) != 0 ) return ret; - memcpy(put_info, &op.u.physinfo, sizeof(*put_info)); + memcpy(put_info, &sysctl.u.physinfo, sizeof(*put_info)); return 0; } @@ -53,15 +52,14 @@ int xc_sched_id(int xc_handle, int *sched_id) { int ret; - DECLARE_DOM0_OP; + DECLARE_SYSCTL; - op.cmd = DOM0_SCHED_ID; - op.interface_version = DOM0_INTERFACE_VERSION; + sysctl.cmd = XEN_SYSCTL_sched_id; - if ( (ret = do_dom0_op(xc_handle, &op)) != 0 ) + if ( (ret = do_sysctl(xc_handle, &sysctl)) != 0 ) return ret; - *sched_id = op.u.sched_id.sched_id; + *sched_id = sysctl.u.sched_id.sched_id; return 0; } @@ -74,19 +72,19 @@ int xc_perfc_control(int xc_handle, int *nbr_val) { int rc; - DECLARE_DOM0_OP; + DECLARE_SYSCTL; - op.cmd = DOM0_PERFCCONTROL; - op.u.perfccontrol.op = opcode; - set_xen_guest_handle(op.u.perfccontrol.desc, desc); - set_xen_guest_handle(op.u.perfccontrol.val, val); + sysctl.cmd = XEN_SYSCTL_perfc_op; + sysctl.u.perfc_op.cmd = opcode; + set_xen_guest_handle(sysctl.u.perfc_op.desc, desc); + set_xen_guest_handle(sysctl.u.perfc_op.val, val); - rc = do_dom0_op(xc_handle, &op); + rc = do_sysctl(xc_handle, &sysctl); if (nbr_desc) - *nbr_desc = op.u.perfccontrol.nr_counters; + *nbr_desc = sysctl.u.perfc_op.nr_counters; if (nbr_val) - *nbr_val = op.u.perfccontrol.nr_vals; + *nbr_val = sysctl.u.perfc_op.nr_vals; return rc; } |