Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup based on cppcheck pass (Core)
[palacios.git] / palacios / src / palacios / vmm_checkpoint.c
index 82c505b..a67560e 100644 (file)
@@ -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");