From: Olaf Hering <olaf@aepfle.de>
To: Patrick Colp <pjcolp@cs.ubc.ca>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] xenpaging: avoid empty pagefile on unsupported hardware
Date: Wed, 15 Sep 2010 18:12:32 +0200 [thread overview]
Message-ID: <20100915161232.GD16689@aepfle.de> (raw)
In-Reply-To: <20100915160521.GA16644@aepfle.de>
Open paging file only if xenpaging_init() succeeds.
It can fail if the host does not support the required virtualization features such as EPT.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/xenpaging/xenpaging.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--- xen-unstable.hg-4.1.22101.orig/tools/xenpaging/xenpaging.c
+++ xen-unstable.hg-4.1.22101/tools/xenpaging/xenpaging.c
@@ -501,15 +501,6 @@ int main(int argc, char *argv[])
victims = calloc(num_pages, sizeof(xenpaging_victim_t));
- /* Open file */
- sprintf(filename, "page_cache_%d", domain_id);
- fd = open(filename, open_flags, open_mode);
- if ( fd < 0 )
- {
- perror("failed to open file");
- return -1;
- }
-
/* Seed random-number generator */
srand(time(NULL));
@@ -521,6 +512,15 @@ int main(int argc, char *argv[])
goto out;
}
+ /* Open file */
+ sprintf(filename, "page_cache_%d", domain_id);
+ fd = open(filename, open_flags, open_mode);
+ if ( fd < 0 )
+ {
+ perror("failed to open file");
+ return -1;
+ }
+
/* Evict pages */
memset(victims, 0, sizeof(xenpaging_victim_t) * num_pages);
for ( i = 0; i < num_pages; i++ )
next prev parent reply other threads:[~2010-09-15 16:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-15 16:05 xenpaging fixes for kernel and hypervisor Olaf Hering
2010-09-15 16:08 ` [PATCH] xenpaging: handle GNTST_eagain in kernel drivers Olaf Hering
2010-09-16 3:44 ` Patrick Colp
2010-09-16 9:05 ` Keir Fraser
2010-09-16 13:33 ` Olaf Hering
2010-09-15 16:10 ` [PATCH] xenpaging: page-in granttable entries Olaf Hering
2010-09-15 16:11 ` [PATCH] xenpaging: fix crash in notify_via_xen_event_channel Olaf Hering
2010-09-15 16:12 ` Olaf Hering [this message]
2010-09-22 15:38 ` [PATCH] xenpaging: handle XENMEM_decrease_reservation Olaf Hering
2010-09-22 15:40 ` [PATCH] xenpaging: break endless loop during inital page-out with large pagefiles Olaf Hering
2010-09-22 15:41 ` [PATCH] xenpaging: allow only one xenpaging call per guest Olaf Hering
2010-09-22 15:48 ` xenpaging fixes for kernel and hypervisor Olaf Hering
2010-09-22 16:49 ` Patrick Colp
2010-09-22 17:13 ` Keir Fraser
2010-09-22 17:14 ` Keir Fraser
2010-09-22 17:20 ` Olaf Hering
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=20100915161232.GD16689@aepfle.de \
--to=olaf@aepfle.de \
--cc=pjcolp@cs.ubc.ca \
--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.