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] Fix troublesome mlock() calls

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix troublesome mlock() calls
From: Russ Blaine <russell.blaine@xxxxxxx>
Date: Thu, 25 Jan 2007 14:37:40 -0800
Delivery-date: Thu, 25 Jan 2007 14:36:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20061113)
# HG changeset patch
# User russell.blaine@xxxxxxx
# Date 1169764305 28800
# Node ID e013822b121117a2ee7b4ebb879eda2676d263ce
# Parent  092c502fb7a8f0cd406c36e16f40660db25d64c3
Fix troublesome mlock() calls

Signed-off-by: Russell Blaine <russell.blaine@xxxxxxx>

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -110,10 +110,10 @@ int xc_hvm_set_pci_intx_level(
     arg.intx   = intx;
     arg.level  = level;

-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }

     rc = do_xen_hypercall(xc_handle, &hypercall);
@@ -140,10 +140,10 @@ int xc_hvm_set_isa_irq_level(
     arg.isa_irq = isa_irq;
     arg.level   = level;

-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }

     rc = do_xen_hypercall(xc_handle, &hypercall);
@@ -168,10 +168,10 @@ int xc_hvm_set_pci_link_route(
     arg.link    = link;
     arg.isa_irq = isa_irq;

-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }

     rc = do_xen_hypercall(xc_handle, &hypercall);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix troublesome mlock() calls, Russ Blaine <=