Skip to contentSkip to conversation

Fix troublesome mlock() calls

PATCH New Russ Blaine 1 participant 1 message Jan 25, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix troublesome mlock() calls

# HG changeset patch
# User [email protected]
# Date 1169764305 28800
# Node ID e013822b121117a2ee7b4ebb879eda2676d263ce # Parent 092c502fb7a8f0cd406c36e16f40660db25d64c3 Fix troublesome mlock() calls

tools/libxc/xc_misc.c +6 -6
@@ -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);