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>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __VMM_CHECKPOINT_H__
21 #define __VMM_CHECKPOINT_H__
25 #include <palacios/vmm.h>
32 struct v3_chkpt * chkpt;
33 struct v3_chkpt_ctx * parent;
38 #define V3_CHKPT_STD_SAVE(ctx,x) v3_chkpt_save(ctx,#x,sizeof(x),&(x))
39 #define V3_CHKPT_STD_LOAD(ctx,x) v3_chkpt_load(ctx,#x,sizeof(x),&(x))
43 int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf);
44 int v3_chkpt_load(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf);
46 static inline int v3_chkpt_save_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
47 return v3_chkpt_save(ctx, tag, 8, buf);
49 static inline int v3_chkpt_save_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
50 return v3_chkpt_save(ctx, tag, 4, buf);
52 static inline int v3_chkpt_save_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
53 return v3_chkpt_save(ctx, tag, 2, buf);
55 static inline int v3_chkpt_save_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
56 return v3_chkpt_save(ctx, tag, 1, buf);
59 static inline int v3_chkpt_load_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
60 return v3_chkpt_load(ctx, tag, 8, buf);
62 static inline int v3_chkpt_load_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
63 return v3_chkpt_load(ctx, tag, 4, buf);
65 static inline int v3_chkpt_load_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
66 return v3_chkpt_load(ctx, tag, 2, buf);
68 static inline int v3_chkpt_load_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) {
69 return v3_chkpt_load(ctx, tag, 1, buf);
74 int v3_chkpt_close_ctx(struct v3_chkpt_ctx * ctx);
75 struct v3_chkpt_ctx * v3_chkpt_open_ctx(struct v3_chkpt * chkpt, struct v3_chkpt_ctx * parent, char * name);
77 int v3_chkpt_save_vm(struct v3_vm_info * vm, char * store, char * url);
78 int v3_chkpt_load_vm(struct v3_vm_info * vm, char * store, char * url);
80 int V3_init_checkpoint();
81 int V3_deinit_checkpoint();