diff options
author | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-05-23 22:34:18 +0000 |
---|---|---|
committer | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-05-23 22:34:18 +0000 |
commit | 35db9d71b6f65c80fce40a110d0e8a58af8437b5 (patch) | |
tree | 9f765d6fd0353c76c8f13cf4459471e671eea95a /tools/xcutils/xc_restore.c | |
parent | dad197b071e41ba1a969fe10fc6fda20d5b46fef (diff) | |
download | xen-35db9d71b6f65c80fce40a110d0e8a58af8437b5.tar.gz xen-35db9d71b6f65c80fce40a110d0e8a58af8437b5.tar.bz2 xen-35db9d71b6f65c80fce40a110d0e8a58af8437b5.zip |
bitkeeper revision 1.1513.1.1 (42925a6aSZSwfyaVsNzV4psPmpZwZg)
Execute xc_linux_restore in a seperate process so that it can't
crash xend. Also handle errors passed from xc_linux_restore and
log info messages from xc_linux_restore.
XendDomain.py:
Popen xc_restore instead of calling xc_linux_restore directly.
xc.c:
Add pyxc_handle exporting the file descriptor to the control interface.
Remove xc_linux_restore -- replaced by popen of xc_restore directly
from python.
xc_linux_restore.c:
Enable debug output.
xpopen.py:
Add xpopen functionality:
Optionally exclude a list of file descriptors from being closed, allowing
access to those file descriptors from the command.
Remove unused parts.
xpopen.py, Makefile, xc_restore.c:
new file
Makefile:
Add xcutils subdir.
ignore:
Add tools/xcutils/xc_restore.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools/xcutils/xc_restore.c')
-rw-r--r-- | tools/xcutils/xc_restore.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c new file mode 100644 index 0000000000..ebba6d698f --- /dev/null +++ b/tools/xcutils/xc_restore.c @@ -0,0 +1,30 @@ +/* + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file "COPYING" in the main directory of + * this archive for more details. + * + * Copyright (C) 2005 by Christian Limpach + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <err.h> + +#include <xc.h> + +int +main(int argc, char **argv) +{ + unsigned int xc_fd, io_fd, domid, nr_pfns; + + if (argc != 5) + errx(1, "usage: %s xcfd iofd domid nr_pfns", argv[0]); + + xc_fd = atoi(argv[1]); + io_fd = atoi(argv[2]); + domid = atoi(argv[3]); + nr_pfns = atoi(argv[4]); + + return xc_linux_restore(xc_fd, io_fd, domid, nr_pfns); +} |