X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_checkpoint.c;h=a67560e99351e61d89f734f3d5980d3812eaa325;hb=c0ecfba627c1d6c3f46d59bd4e5e6f883a494dc4;hp=82c505b9d68905b5474b343b2b0f2a3fbb403175;hpb=022f63d320c2837822dc7f6be84f860a01f02d7c;p=palacios.git diff --git a/palacios/src/palacios/vmm_checkpoint.c b/palacios/src/palacios/vmm_checkpoint.c index 82c505b..a67560e 100644 --- a/palacios/src/palacios/vmm_checkpoint.c +++ b/palacios/src/palacios/vmm_checkpoint.c @@ -260,7 +260,7 @@ int v3_chkpt_close_ctx(struct v3_chkpt_ctx * ctx) { int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf) { - struct v3_chkpt * chkpt = ctx->chkpt; + struct v3_chkpt * chkpt; int rc; if (!ctx) { @@ -268,6 +268,8 @@ int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * bu return -1; } + chkpt = ctx->chkpt; + if (chkpt->current_ctx != ctx) { PrintError(VM_NONE, VCORE_NONE, "Attempt to save on context that is not the current context for the store\n"); return -1; @@ -285,13 +287,15 @@ int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * bu int v3_chkpt_load(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf) { - struct v3_chkpt * chkpt = ctx->chkpt; + struct v3_chkpt * chkpt; int rc; if (!ctx) { PrintError(VM_NONE, VCORE_NONE, "Attempt to load tag %s from null context\n",tag); return -1; } + + chkpt = ctx->chkpt; if (chkpt->current_ctx != ctx) { PrintError(VM_NONE, VCORE_NONE, "Attempt to load from context that is not the current context for the store\n");