1 - used pages of hypervisor memory pool
2 - number of pages in hypervisor remapping pool
3 - used pages of hypervisor remapping pool
+ 4 - number of registered cells
Return code: requested value (>=0) or negative error code
struct jailhouse_system *system_config;
static DEFINE_SPINLOCK(shutdown_lock);
+static unsigned int num_cells = 1;
#define for_each_cell(c) for (c = &linux_cell; c; c = c->next)
while (last->next)
last = last->next;
last->next = cell;
+ num_cells++;
/* update cell references and clean up before releasing the cpus of
* the new cell */
while (previous->next != cell)
previous = previous->next;
previous->next = cell->next;
+ num_cells--;
page_free(&mem_pool, cell, cell->data_pages);
page_map_dump_stats("after cell destruction");
return remap_pool.pages;
case JAILHOUSE_INFO_REMAP_POOL_USED:
return remap_pool.used_pages;
+ case JAILHOUSE_INFO_NUM_CELLS:
+ return num_cells;
default:
return -EINVAL;
}
#define JAILHOUSE_INFO_MEM_POOL_USED 1
#define JAILHOUSE_INFO_REMAP_POOL_SIZE 2
#define JAILHOUSE_INFO_REMAP_POOL_USED 3
+#define JAILHOUSE_INFO_NUM_CELLS 4
/* CPU state */
#define JAILHOUSE_CPU_RUNNING 0