#include <palacios/vmm_host_events.h>
-#include <palacios/vmm_socket.h>
#include "vmm_config_class.h"
static int setup_memory_map(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
+static int setup_extensions(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
static int setup_devices(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
PrintError("Setting up guest memory map failed...\n");
return -1;
}
-
- //v3_hook_io_port(info, 1234, &IO_Read, NULL, info);
-
+
+ /*
+ * Initialize configured extensions
+ */
+ if (setup_extensions(vm, cfg) == -1) {
+ PrintError("Failed to setup extensions\n");
+ return -1;
+ }
+
+ /*
+ * Initialize configured devices
+ */
if (setup_devices(vm, cfg) == -1) {
PrintError("Failed to setup devices\n");
return -1;
info->core_run_state = CORE_STOPPED;
+ if (v3_init_core_extensions(info) == -1) {
+ PrintError("Error intializing extension core states\n");
+ return -1;
+ }
+
if (info->vm_info->vm_class == V3_PC_VM) {
if (post_config_pc_core(info, cfg) == -1) {
PrintError("PC Post configuration failure\n");
+
static int setup_memory_map(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
v3_cfg_tree_t * mem_region = v3_cfg_subtree(v3_cfg_subtree(cfg, "memmap"), "region");
}
+static int setup_extensions(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
+ v3_cfg_tree_t * extension = v3_cfg_subtree(v3_cfg_subtree(cfg, "extensions"), "extension");
+
+ while (extension) {
+ char * ext_name = v3_cfg_val(extension, "name");
+
+ V3_Print("Configuring extension %s\n", ext_name);
+
+ if (v3_add_extension(vm, ext_name, extension) == -1) {
+ PrintError("Error adding extension %s\n", ext_name);
+ return -1;
+ }
+
+ extension = v3_cfg_next_branch(extension);
+ }
+
+ return 0;
+}
static int setup_devices(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
-