2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2011, Kyle C. Hale <kh@u.norhtwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Kyle C. Hale <kh@u.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #include <palacios/vmm.h>
22 #include <palacios/vm_guest.h>
23 #include <palacios/vmm_intr.h>
24 #include <palacios/vmm_syscall_hijack.h>
25 #include <palacios/vmm_mpi_accel.h>
26 #include <palacios/vmm_process_environment.h>
27 #include <palacios/vmm_execve_hook.h>
30 int v3_init_mpi_accel (struct guest_info * core) {
31 //binfile = "./envtest";
32 //args[1] = "LD_PRELOAD=./libcwrap.so";
34 v3_hook_swintr(core, 0x80, v3_syscall_handler, NULL);
35 v3_hook_syscall(core, 11, v3_sysexecve_handler, NULL);
36 v3_hook_executable(core, "./envtest", v3_mpi_preload_handler, NULL);
42 int v3_deinit_mpi_accel (struct guest_info * core) {
48 int v3_mpi_preload_handler (struct guest_info * core, void * priv_data) {
51 a[0] = "TEST=HITHERE";
52 a[1] = "TEST2=/blah/blah/blah";
53 a[2] = "LD_PRELOAD=./libcwrap.so";
55 int ret = v3_inject_strings(core, (const char**)NULL, (const char**)a, 0, 3);
57 PrintDebug("Error injecting strings in execve handler\n");