|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 10 of 12] xenpaging: add helper function for unlinkin
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1307437220 -7200
# Node ID fb445bd61233844f4b9d42b6eca172670f75eb98
# Parent 48244bc8156ff8eca82ce9ab811516aae3d3fe32
xenpaging: add helper function for unlinking pagefile
Unlink pagefile in the signal handler and also in the exit path.
This does not leave a stale pagefile if an error occoured.
Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
diff -r 48244bc8156f -r fb445bd61233 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c Tue Jun 07 11:00:18 2011 +0200
+++ b/tools/xenpaging/xenpaging.c Tue Jun 07 11:00:20 2011 +0200
@@ -41,11 +41,20 @@
static char filename[80];
static int interrupted;
+
+static void unlink_pagefile(void)
+{
+ if ( filename[0] )
+ {
+ unlink(filename);
+ filename[0] = '\0';
+ }
+}
+
static void close_handler(int sig)
{
interrupted = sig;
- if ( filename[0] )
- unlink(filename);
+ unlink_pagefile();
}
static void *init_page(void)
@@ -679,6 +688,7 @@ int main(int argc, char *argv[])
out:
close(fd);
+ unlink_pagefile();
free(victims);
/* Tear down domain paging */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 03 of 12] xenpaging: remove srand call, (continued)
- [Xen-devel] [PATCH 03 of 12] xenpaging: remove srand call, Olaf Hering
- [Xen-devel] [PATCH 04 of 12] xenpaging: remove return values from functions that can not fail, Olaf Hering
- [Xen-devel] [PATCH 05 of 12] xenpaging: catch xc_mem_paging_resume errors, Olaf Hering
- [Xen-devel] [PATCH 06 of 12] xenpaging: remove local domain_id variable, Olaf Hering
- [Xen-devel] [PATCH 08 of 12] xenpaging: start paging in the middle of gfn range, Olaf Hering
- [Xen-devel] [PATCH 07 of 12] xenpaging: move num_pages into xenpaging struct, Olaf Hering
- [Xen-devel] [PATCH 09 of 12] xenpaging: pass integer to xenpaging_populate_page, Olaf Hering
- [Xen-devel] [PATCH 11 of 12] xenpaging: add watch thread to catch guest shutdown, Olaf Hering
- [Xen-devel] [PATCH 10 of 12] xenpaging: add helper function for unlinking pagefile,
Olaf Hering <=
- [Xen-devel] [PATCH 02 of 12] xenpaging: do not bounce p2mt to xenpaging, Olaf Hering
- [Xen-devel] [PATCH 12 of 12] xenpaging: implement stopping of pager by sending SIGTERM/SIGINT, Olaf Hering
- Re: [Xen-devel] [PATCH 00 of 12] xenpaging fixes for xen-unstable, Keir Fraser
|
|
|
|
|