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.


correctly handle NMI exits on VMX architectures
[palacios.releases.git] / palacios / src / palacios / vmm_chkpt_stores.h
index 389a0ca..8feaf5a 100644 (file)
@@ -152,12 +152,20 @@ static int keyed_stream_close_ctx(void * store_data, void * ctx) {
 
 static int keyed_stream_save(void * store_data, void * ctx, 
                                  char * tag, uint64_t len, void * buf) {
-    return v3_keyed_stream_write_key(store_data, ctx, buf, len);
+    if (v3_keyed_stream_write_key(store_data, ctx, buf, len) != len) { 
+       return -1;
+    } else {
+       return 0;
+    }
 }
 
 static int keyed_stream_load(void * store_data, void * ctx, 
                                  char * tag, uint64_t len, void * buf) {
-    return v3_keyed_stream_read_key(store_data, ctx, buf, len);
+    if (v3_keyed_stream_read_key(store_data, ctx, buf, len) != len) { 
+       return -1;
+    } else {
+       return 0;
+    }
 }
 
 
@@ -215,9 +223,23 @@ static void * dir_open_ctx(void * store_data,
 
 
     ctx = V3_Malloc(sizeof(struct file_ctx));
+
+    if (!ctx) {
+       PrintError("Cannot allocate\n");
+       return NULL;
+    }
+
     memset(ctx, 0, sizeof(struct file_ctx));
 
     ctx->filename = V3_Malloc(strlen(url) + strlen(name) + 5);
+
+    if (!ctx->filename) {
+       PrintError("Cannot allocate\n");
+       V3_Free(ctx);
+       return NULL;
+    }
+
+
     memset(ctx->filename, 0, strlen(url) + strlen(name) + 5);
 
     snprintf(ctx->filename, strlen(url) + strlen(name) + 5, "%s/%s", url, name);