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.


Added global initialization hook for extensions to support upcoming scheduling extensions
Patrick G. Bridges [Tue, 5 Feb 2013 20:05:08 +0000 (13:05 -0700)]
palacios/src/extensions/ext_inspector.c
palacios/src/extensions/ext_mcheck.c
palacios/src/extensions/ext_mtrr.c
palacios/src/extensions/ext_vmware.c
palacios/src/palacios/vmm_extensions.c

index f1683a0..18e6a9c 100644 (file)
@@ -103,8 +103,9 @@ static int init_inspector_core(struct guest_info * core, void * priv_data, void
 
 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,
index 704a1f9..1278bc7 100644 (file)
@@ -566,8 +566,9 @@ int v3_mcheck_inject_scrubber_mce(struct v3_vm_info *info, int cpu, uint64_t dst
 
 static struct v3_extension_impl mcheck_impl = {
     .name = MCHECK,
-    .init = init_mcheck,
-    .deinit = deinit_mcheck,
+    .init = NULL,
+    .vm_init = init_mcheck,
+    .vm_deinit = deinit_mcheck,
     .core_init = NULL,
     .core_deinit = NULL,
     .on_entry = NULL,
index 9232bb7..94cb6b9 100644 (file)
@@ -621,8 +621,9 @@ static int init_mtrrs(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_
 
 static struct v3_extension_impl mtrr_impl = {
     .name = "MTRRS",
-    .init = init_mtrrs,
-    .deinit = deinit_mtrrs,
+    .init = NULL,
+    .vm_init = init_mtrrs,
+    .vm_deinit = deinit_mtrrs,
     .core_init = NULL,
     .core_deinit = NULL,
     .on_entry = NULL,
index 552ce28..e9db64c 100644 (file)
@@ -121,8 +121,9 @@ static int vmware_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv
 
 static struct v3_extension_impl vmware_impl = {
     .name = "VMWARE_IFACE",
-    .init = vmware_init,
-    .deinit = NULL,
+    .init = NULL,
+    .vm_init = vmware_init,
+    .vm_deinit = NULL,
     .core_init = NULL,
     .core_deinit = NULL,
     .on_entry = NULL,
index f5a14c3..e9f4a71 100644 (file)
@@ -70,6 +70,11 @@ int V3_init_extensions() {
            return -1;
        }
 
+        if ((*tmp_ext) && (*tmp_ext)->init && ((*tmp_ext)->init() != 0)) {
+           PrintError(VM_NONE, VCORE_NONE, "Could not initialize extension (%s)\n", (*tmp_ext)->name);
+           return -1;
+       } 
+
        tmp_ext = &(__start__v3_extensions[++i]);
     }
 
@@ -110,8 +115,8 @@ int v3_deinit_ext_manager(struct v3_vm_info * vm)  {
     list_for_each_entry_safe(ext, tmp, &(ext_state->extensions), node) {
         
        V3_Print(vm, VCORE_NONE, "Cleaning up Extension (%s)\n", ext->impl->name);
-       if ((ext->impl) && (ext->impl->deinit)) {
-           if (ext->impl->deinit(vm, ext->priv_data) == -1) {
+       if ((ext->impl) && (ext->impl->vm_deinit)) {
+           if (ext->impl->vm_deinit(vm, ext->priv_data) == -1) {
                PrintError(vm, VCORE_NONE, "Error cleaning up extension (%s)\n", ext->impl->name);
                return -1;
            }
@@ -145,7 +150,7 @@ int v3_add_extension(struct v3_vm_info * vm, const char * name, v3_cfg_tree_t *
        return -1;
     }
     
-    V3_ASSERT(vm, VCORE_NONE, impl->init);
+    V3_ASSERT(vm, VCORE_NONE, impl->vm_init);
 
     /* this allows each extension to track its own per-core state */
     ext_size = sizeof(struct v3_extension) + (sizeof(void *) * vm->num_cores);
@@ -158,7 +163,7 @@ int v3_add_extension(struct v3_vm_info * vm, const char * name, v3_cfg_tree_t *
 
     ext->impl = impl;
 
-    if (impl->init(vm, cfg, &(ext->priv_data)) == -1) {
+    if (impl->vm_init(vm, cfg, &(ext->priv_data)) == -1) {
        PrintError(vm, VCORE_NONE,  "Error initializing Extension (%s)\n", name);
        V3_Free(ext);
        return -1;