X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fextensions%2Fext_inspector.c;h=db12f05e6bf314f6396bc1be12e7fdd2274a6b19;hb=d22c11cec4e8c3390bfe6bf16ed07f5d073f0d4a;hp=5a440c15822c40d949da8eaa21509e366fb8e2cd;hpb=a8627ddaccf49073eb04286c5ea4767e2903c351;p=palacios.git diff --git a/palacios/src/extensions/ext_inspector.c b/palacios/src/extensions/ext_inspector.c index 5a440c1..db12f05 100644 --- a/palacios/src/extensions/ext_inspector.c +++ b/palacios/src/extensions/ext_inspector.c @@ -38,9 +38,16 @@ struct v3_inspector_state { static int init_inspector(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_data) { struct v3_inspector_state * state = V3_Malloc(sizeof(struct v3_inspector_state)); + + if (!state) { + PrintError(vm, VCORE_NONE, "Cannot allocate state in inspector\n"); + return -1; + } + memset(state, 0, sizeof(struct v3_inspector_state)); strncpy(state->state_tree.name, "vm->name", 50); + state->state_tree.name[49] = 0; state->state_tree.subtree = 1; *priv_data = state; @@ -49,7 +56,7 @@ static int init_inspector(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** p } -static int init_inspector_core(struct guest_info * core, void * priv_data) { +static int init_inspector_core(struct guest_info * core, void * priv_data, void ** core_data) { struct v3_inspector_state * vm_state = priv_data; char core_name[50]; @@ -97,8 +104,9 @@ static int init_inspector_core(struct guest_info * core, void * priv_data) { static struct v3_extension_impl inspector_impl = { .name = "inspector", - .init = init_inspector, - .deinit = NULL, + .init = NULL, + .vm_init = init_inspector, + .vm_deinit = NULL, .core_init = init_inspector_core, .core_deinit = NULL, .on_entry = NULL,