WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64] update xc_set_hvm_param(), add xc_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] update xc_set_hvm_param(), add xc_get_hvm_param()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 09 Dec 2006 15:44:10 +0000
Delivery-date: Sat, 09 Dec 2006 07:46:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] update xc_set_hvm_param(), add xc_get_hvm_param(), Xen patchbot-unstable <=