0. Introduction

To support VM images, we will add mods to the Wrapper program. Need to support both UNIX and WIN32 host systems. Let's go through some of the code in order. My comments are in BOLD...

// wrapper.C
// wrapper program - lets you use non-BOINC apps with BOINC
//
// Handles:
// - suspend/resume/quit/abort
// - reporting CPU time
// - loss of heartbeat from core client
//
// Does NOT handle:
// - checkpointing
// If your app does checkpointing,
// and there's some way to figure out when it's done it,
// this program could be modified to report to the core client.

This version I used DOES handle checkpointing - code exists in many places!

//
// See http://boinc.berkeley.edu/wrapper.php for details
// Contributor: Andrew J. Younge (ajy4490@umiacs.umd.edu)

1. Run a VM image

Need to add code to:

int TASK::run(int argct, char** argvt) 

Currently this just fork()'s and execv()'s the legacy app for UNIX or uses CreateProcess() for WIN32.
We need to use the VIX API to connect to, open and power-on the VM using VixHost_Connect(), VixVM_Open() and VixVM_PowerOn().

2. Poll a running VM and get its CPU use

Need to add code to:

bool TASK::poll(int& status)  and:  double TASK::cpu_time()

Currently the Wrapper just waits for the app to terminate and calculates the total CPU time.
We need to do the same for the guest machine's CPU using VixJob_Wait() and the VMware Guest SDK.

(It may well be possible to get the guest machine's CPU usage DURING execution too, which would allow issuing partial credit for long-running VM's. Would need to look how this is done in BOINC for e.g.  the ClimatePrediction project).

3. Kill a running VM

Need to add code to:

void TASK::kill()

Call VixVM_PowerOff() instead of kill() or TerminateProcess().

4. Suspend a running VM

Need to add code to:

void TASK::stop()

Call VixVM_Suspend()

5. Resume a suspended VM

Need to add code to:

void TASK::resume()

Call VixVM_PowerOn() again

6. Checkpoint support

This probably just needs judicious use of VixVM_Suspend() and VixVM_PowerOn().