From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: [PATCH] tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly
Date: Thu, 26 Jan 2012 14:36:30 +0100 [thread overview]
Message-ID: <aa0d678fece208975984.1327584990@probook.site> (raw)
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1327584962 -3600
# Node ID aa0d678fece208975984e8e59ca223c07fc50c06
# Parent 89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly
If the first ioctl fails with ENOENT it means the command is known. If a
second attempt to map each gfn happens to fail then there is no need to
run the fallback code. Some gfns are paged and the fallback code would
not fix the failure. Instead return the EINVAL to the caller.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
diff -r 89fdabcf315f -r aa0d678fece2 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -217,6 +217,7 @@ static void *linux_privcmd_map_foreign_b
rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
+ /* Command was recognized, some gfn in arr are in paging state */
if ( rc < 0 && errno == ENOENT )
{
for ( i = rc = 0; rc == 0 && i < num; i++ )
@@ -235,8 +236,8 @@ static void *linux_privcmd_map_foreign_b
} while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
}
}
-
- if ( rc < 0 && errno == EINVAL && (int)num > 0 )
+ /* Command was not recognized, use fall back */
+ else if ( rc < 0 && errno == EINVAL && (int)num > 0 )
{
/*
* IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
next reply other threads:[~2012-01-26 13:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 13:36 Olaf Hering [this message]
[not found] <mailman.1637.1327585244.1471.xen-devel@lists.xensource.com>
2012-01-26 16:19 ` [PATCH] tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly Andres Lagar-Cavilla
2012-01-27 18:33 ` Ian Jackson
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=aa0d678fece208975984.1327584990@probook.site \
--to=olaf@aepfle.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).