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-devel

[Xen-devel] [PATCH 15 of 24] libxc: convert watchdog interface over to h

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 15 of 24] libxc: convert watchdog interface over to hypercall buffers
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 06 Sep 2010 14:38:35 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 06:56:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1283780300@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1283779691 -3600
# Node ID 44b73f8b623f9e9567d0188f1fa1a566f4e00b1b
# Parent  92e9795d06413325c84f2220cf33c0dd831e8355
libxc: convert watchdog interface over to hypercall buffers

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 92e9795d0641 -r 44b73f8b623f tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Mon Sep 06 14:28:11 2010 +0100
+++ b/tools/libxc/xc_domain.c   Mon Sep 06 14:28:11 2010 +0100
@@ -378,24 +378,25 @@ int xc_watchdog(xc_interface *xch,
                 uint32_t timeout)
 {
     int ret = -1;
-    sched_watchdog_t arg;
     DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(sched_watchdog_t, arg);
 
-    hypercall.op     = __HYPERVISOR_sched_op;
-    hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
-    hypercall.arg[1] = (unsigned long)&arg;
-    arg.id = id;
-    arg.timeout = timeout;
-
-    if ( lock_pages(xch, &arg, sizeof(arg)) != 0 )
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out1;
     }
 
+    hypercall.op     = __HYPERVISOR_sched_op;
+    hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+    arg->id = id;
+    arg->timeout = timeout;
+
     ret = do_xen_hypercall(xch, &hypercall);
 
-    unlock_pages(xch, &arg, sizeof(arg));
+    xc_hypercall_buffer_free(xch, arg);
 
  out1:
     return ret;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>