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 and sanity-checking of unintentional integer overflow, unsigned/zero comparis...
[palacios.git] / palacios / src / devices / tmpdisk.c
index 0b5fb1f..9a4371c 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <palacios/vmm.h>
 #include <palacios/vmm_dev_mgr.h>
-
+#include <palacios/vm_guest.h>
 
 struct blk_state {
     uint64_t capacity;
@@ -101,7 +101,7 @@ static int blk_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     struct blk_state * blk = NULL;
     v3_cfg_tree_t * frontend_cfg = v3_cfg_subtree(cfg, "frontend");
     char * dev_id = v3_cfg_val(cfg, "ID");
-    uint64_t capacity = atoi(v3_cfg_val(cfg, "size")) * 1024 * 1024;
+    uint64_t capacity = atoi(v3_cfg_val(cfg, "size")) * 1024ULL * 1024ULL;
     
     if (!frontend_cfg) {
        PrintError(vm, VCORE_NONE, "Frontend Configuration not present\n");