# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 6fdbf173142d6b4da68d2019f594f9a81fa70d28
# Parent 0705db48d23cca452e33f7ab2bc01b0da27e759d
[IA64] update xc_set_hvm_param(), add xc_get_hvm_param()
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
tools/libxc/ia64/xc_ia64_hvm_build.c | 36 ++++++++++++++++++++++++++++-------
1 files changed, 29 insertions(+), 7 deletions(-)
diff -r 0705db48d23c -r 6fdbf173142d tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c Fri Dec 01 11:40:57 2006 -0700
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c Sat Dec 02 15:19:50 2006 -0700
@@ -41,7 +41,7 @@ error_out:
return -1;
}
-static void
+int
xc_set_hvm_param(int handle, domid_t dom, int param, unsigned long value)
{
DECLARE_HYPERCALL;
@@ -56,15 +56,37 @@ xc_set_hvm_param(int handle, domid_t dom
arg.index = param;
arg.value = value;
- if (mlock(&arg, sizeof(arg)) != 0) {
- PERROR("Could not lock memory for set parameter");
- return;
- }
+ if (mlock(&arg, sizeof(arg)) != 0)
+ return -1;
rc = do_xen_hypercall(handle, &hypercall);
safe_munlock(&arg, sizeof(arg));
- if (rc < 0)
- PERROR("set HVM parameter failed (%d)", rc);
+
+ return rc;
+}
+
+int
+xc_get_hvm_param(int handle, domid_t dom, int param, unsigned long *value)
+{
+ DECLARE_HYPERCALL;
+ xen_hvm_param_t arg;
+ int rc;
+
+ hypercall.op = __HYPERVISOR_hvm_op;
+ hypercall.arg[0] = HVMOP_get_param;
+ hypercall.arg[1] = (unsigned long)&arg;
+
+ arg.domid = dom;
+ arg.index = param;
+
+ if (mlock(&arg, sizeof(arg)) != 0)
+ return -1;
+
+ rc = do_xen_hypercall(handle, &hypercall);
+ safe_munlock(&arg, sizeof(arg));
+
+ *value = arg.value;
+ return rc;
}
#define HOB_SIGNATURE 0x3436474953424f48 // "HOBSIG64"
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|