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
};
-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;
int active;
int disabled;
- struct guest_info * vm;
+ struct v3_vm_info * vm;
struct swap_state * swap_info;
int symbiotic;
#endif
-static int connect_fn(struct guest_info * info,
+static int connect_fn(struct v3_vm_info * vm,
void * frontend_data,
struct v3_dev_blk_ops * ops,
v3_cfg_tree_t * cfg,
swap = (struct swap_state *)V3_Malloc(sizeof(struct swap_state));
- swap->vm = info;
+ swap->vm = vm;
swap->cache_size = cache_size;
swap->io_flag = 0;
swap->seek_usecs = seek_us;
memset(swap->cache, 0, swap->cache_size);
}
- if (v3_dev_connect_blk(info, v3_cfg_val(frontend_cfg, "tag"),
+ if (v3_dev_connect_blk(vm, v3_cfg_val(frontend_cfg, "tag"),
&blk_ops, frontend_cfg, swap) == -1) {
PrintError("Could not connect to frontend %s\n",
v3_cfg_val(frontend_cfg, "tag"));
#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
- if (info->enable_telemetry == 1) {
- v3_add_telemetry_cb(info, telemetry_cb, swap);
+ if (vm->enable_telemetry == 1) {
+ v3_add_telemetry_cb(vm, telemetry_cb, swap);
}
#endif
-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) {
char * name = v3_cfg_val(cfg, "name");
if (shdw_ptr_list == NULL) {
shdw_ptr_list = (struct list_head *)V3_Malloc(sizeof(struct list_head *));
+#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
swap_state->list_size++;
+#endif
INIT_LIST_HEAD(shdw_ptr_list);
v3_htable_insert(swap_state->shdw_ptr_ht, (addr_t)*(uint32_t *)guest_pte, (addr_t)shdw_ptr_list);
}
if (shdw_ptr == NULL) {
PrintError("MEMORY LEAK\n");
+#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
telemetry_cb(info, NULL, "");
+#endif
return 0;
}