From: Russ Blaine <russell.blaine@sun.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Fix troublesome mlock() calls
Date: Thu, 25 Jan 2007 14:37:40 -0800 [thread overview]
Message-ID: <45B93134.7080603@sun.com> (raw)
# HG changeset patch
# User russell.blaine@sun.com
# Date 1169764305 28800
# Node ID e013822b121117a2ee7b4ebb879eda2676d263ce
# Parent 092c502fb7a8f0cd406c36e16f40660db25d64c3
Fix troublesome mlock() calls
Signed-off-by: Russell Blaine <russell.blaine@sun.com>
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);
reply other threads:[~2007-01-25 22:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B93134.7080603@sun.com \
--to=russell.blaine@sun.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.