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, Madhav Suresh <madhav@u.northwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Authors: Madhav Suresh <madhav@u.northwestern.edu>
15 * Mark Cartwright <mcartwright@gmail.com> (live migration)
17 * This is free software. You are permitted to use,
18 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #ifndef __VMM_CHECKPOINT_H__
22 #define __VMM_CHECKPOINT_H__
26 #include <palacios/vmm.h>
33 struct v3_chkpt * chkpt;
34 struct v3_chkpt_ctx * parent;
39 #define V3_CHKPT_STD_SAVE(ctx,x) v3_chkpt_save(ctx,#x,sizeof(x),&(x))
40 #define V3_CHKPT_STD_LOAD(ctx,x) v3_chkpt_load(ctx,#x,sizeof(x),&(x))
44 int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf);
45 int v3_chkpt_load(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf);
47 static inline int v3_chkpt_save_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
48 return v3_chkpt_save(ctx, tag, 8, buf);
50 static inline int v3_chkpt_save_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
51 return v3_chkpt_save(ctx, tag, 4, buf);
53 static inline int v3_chkpt_save_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
54 return v3_chkpt_save(ctx, tag, 2, buf);
56 static inline int v3_chkpt_save_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
57 return v3_chkpt_save(ctx, tag, 1, buf);
60 static inline int v3_chkpt_load_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
61 return v3_chkpt_load(ctx, tag, 8, buf);
63 static inline int v3_chkpt_load_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
64 return v3_chkpt_load(ctx, tag, 4, buf);
66 static inline int v3_chkpt_load_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
67 return v3_chkpt_load(ctx, tag, 2, buf);
69 static inline int v3_chkpt_load_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
70 return v3_chkpt_load(ctx, tag, 1, buf);
75 int v3_chkpt_close_ctx(struct v3_chkpt_ctx * ctx);
76 struct v3_chkpt_ctx * v3_chkpt_open_ctx(struct v3_chkpt * chkpt, struct v3_chkpt_ctx * parent, char * name);
78 int v3_chkpt_save_vm(struct v3_vm_info * vm, char * store, char * url);
79 int v3_chkpt_load_vm(struct v3_vm_info * vm, char * store, char * url);
81 #ifdef V3_CONFIG_LIVE_MIGRATION
82 int v3_chkpt_send_vm(struct v3_vm_info * vm, char * store, char * url);
83 int v3_chkpt_receive_vm(struct v3_vm_info * vm, char * store, char * url);
86 int V3_init_checkpoint();
87 int V3_deinit_checkpoint();