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.


symswap updates for multicore
[palacios.releases.git] / palacios / src / devices / sym_swap.c
index 49b0f32..ac0f0c9 100644 (file)
@@ -20,6 +20,7 @@
 #include <palacios/vmm.h>
 #include <palacios/vmm_dev_mgr.h>
 #include <palacios/vmm_sym_swap.h>
+#include <palacios/vm_guest.h>
 
 
 #ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
@@ -69,7 +70,7 @@ struct swap_state {
     uint8_t * swap_space;
     addr_t swap_base_addr;
 
-    struct guest_info * vm;
+    struct v3_vm_info * vm;
 
     uint8_t usage_map[0]; // This must be the last structure member
 };
@@ -146,10 +147,10 @@ static int swap_read(uint8_t * buf, uint64_t lba, uint64_t num_bytes, void * pri
     uint32_t length = num_bytes;
 
   
-    /*  
-       PrintDebug("SymSwap: Reading %d bytes to %p from %p\n", length,
-       buf, (void *)(swap->swap_space + offset));
-    */
+      
+    PrintDebug("SymSwap: Reading %d bytes to %p from %p\n", length,
+              buf, (void *)(swap->swap_space + offset));
+       
 
     if (length % 4096) {
        PrintError("Swapping in length that is not a page multiple\n");
@@ -268,7 +269,7 @@ static void telemetry_cb(struct guest_info * info, void * private_data, char * h
 
 
 
-static int swap_init(struct guest_info * vm, v3_cfg_tree_t * cfg) {
+static int swap_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     struct swap_state * swap = NULL;
     v3_cfg_tree_t * frontend_cfg = v3_cfg_subtree(cfg, "frontend");
     uint32_t capacity = atoi(v3_cfg_val(cfg, "size")) * 1024 * 1024;
@@ -314,7 +315,7 @@ static int swap_init(struct guest_info * vm, v3_cfg_tree_t * cfg) {
     }
 
 #ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
-    if (vm->enable_telemetry) {
+    if (vm->enable_telemetry == 1) {
        v3_add_telemetry_cb(vm, telemetry_cb, dev);
     }
 #endif