X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fswapbypass_cache.c;h=ec2bba8069afa18f7261c46237c410a3ca4dbe06;hb=7618b2492af387a660879432bcf2d741d546437e;hp=7d6dd8031663009aa231722423a5682f161df72b;hpb=8a8e371fd9be4513214a0013063d87ecbc5582c1;p=palacios.git diff --git a/palacios/src/devices/swapbypass_cache.c b/palacios/src/devices/swapbypass_cache.c index 7d6dd80..ec2bba8 100644 --- a/palacios/src/devices/swapbypass_cache.c +++ b/palacios/src/devices/swapbypass_cache.c @@ -23,7 +23,7 @@ #include -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY #include #endif @@ -60,7 +60,7 @@ struct swap_state { union swap_header * hdr; -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY uint32_t pages_in; uint32_t pages_out; #endif @@ -164,7 +164,7 @@ static int swap_read(uint8_t * buf, uint64_t lba, uint64_t num_bytes, void * pri int i = 0; // Notify the shadow paging layer -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY swap->pages_in += length / 4096; #endif @@ -219,7 +219,7 @@ static int swap_write(uint8_t * buf, uint64_t lba, uint64_t num_bytes, void * p if ((swap->active == 1) && (offset != 0)) { int i = 0; -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY swap->pages_out += length / 4096; #endif @@ -253,7 +253,7 @@ static struct v3_device_ops dev_ops = { }; -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY static void telemetry_cb(struct v3_vm_info * vm, void * private_data, char * hdr) { struct vm_device * dev = (struct vm_device *)private_data; struct swap_state * swap = (struct swap_state *)(dev->private_data); @@ -273,7 +273,7 @@ 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; - char * name = v3_cfg_val(cfg, "name"); + char * dev_id = v3_cfg_val(cfg, "ID"); if (!frontend_cfg) { PrintError("Initializing sym swap without a frontend device\n"); @@ -300,21 +300,21 @@ static int swap_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { memset(swap->usage_map, 0, ((swap->capacity / 4096) / 8)); - struct vm_device * dev = v3_allocate_device(name, &dev_ops, swap); + struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, swap); if (v3_attach_device(vm, dev) == -1) { - PrintError("Could not attach device %s\n", name); + PrintError("Could not attach device %s\n", dev_id); return -1; } if (v3_dev_connect_blk(vm, v3_cfg_val(frontend_cfg, "tag"), &blk_ops, frontend_cfg, swap) == -1) { PrintError("Could not connect %s to frontend %s\n", - name, v3_cfg_val(frontend_cfg, "tag")); + dev_id, v3_cfg_val(frontend_cfg, "tag")); return -1; } -#ifdef CONFIG_SWAPBYPASS_TELEMETRY +#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY if (vm->enable_telemetry == 1) { v3_add_telemetry_cb(vm, telemetry_cb, dev); }