X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=c7282233eb4793276cbb1b75ae884f3214d8789e;hb=068d7e66db537f981fde19a098a12e4390fa3de4;hp=af45a0a4be050f1d1f0d0eea83d48df6d96428e4;hpb=f3eb8bbb7c58c98b03797f2188e6c1d2a7610c15;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index af45a0a..c728223 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -39,7 +39,7 @@ #include #include -#include +#include @@ -57,7 +57,7 @@ static int configure_generic(struct guest_info * info, struct v3_vm_config * con -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASSTHROUGH_VIDEO static int passthrough_mem_write(addr_t guest_addr, void * src, uint_t length, void * priv_data) { return length; @@ -70,11 +70,13 @@ static int passthrough_mem_write(addr_t guest_addr, void * src, uint_t length, v #endif int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) { - extern v3_cpu_arch_t v3_cpu_type; + extern v3_cpu_arch_t v3_cpu_types[]; // Amount of ram the Guest will have, rounded to a 4K page boundary info->mem_size = config_ptr->mem_size & ~(addr_t)0xfff; + info->cpu_id = config_ptr->guest_cpu; + /* * Initialize the subsystem data strutures */ @@ -110,7 +112,7 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p // Initialize the memory map v3_init_shadow_map(info); - if ((v3_cpu_type == V3_SVM_REV3_CPU) && + if ((v3_cpu_types[info->cpu_id] == V3_SVM_REV3_CPU) && (config_ptr->enable_nested_paging == 1)) { PrintDebug("Guest Page Mode: NESTED_PAGING\n"); info->shdw_pg_mode = NESTED_PAGING; @@ -178,7 +180,7 @@ int v3_post_config_guest(struct guest_info * info, struct v3_vm_config * config_ */ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * config_ptr) { -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASSTHROUGH_VIDEO PrintDebug("Setting up memory map (memory size=%dMB)\n", (uint_t)(info->mem_size / (1024 * 1024))); // VGA frame buffer @@ -244,6 +246,11 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_create_device(info, "VMNET", NULL); + v3_create_device(info, "CGA_VIDEO", (void *)1); + { + struct telnet_cons_cfg cons_cfg = {"CGA_VIDEO", 19997}; + v3_create_device(info, "TELNET_CONSOLE", &cons_cfg); + } if (config_ptr->enable_pci == 1) { struct ide_cfg ide_config = {"PCI", "PIIX3"}; @@ -258,8 +265,6 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_create_device(info, "LNX_VIRTIO_BALLOON", "PCI"); v3_create_device(info, "SYM_SWAP", "LNX_VIRTIO_BLK"); - v3_create_device(info, "VIDEO", "PCI"); - v3_create_device(info, "IDE", &ide_config); } else { v3_create_device(info, "IDE", NULL); @@ -447,7 +452,7 @@ static int configure_generic(struct guest_info * info, struct v3_vm_config * con #endif -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASTHROUGH_VIDEO // Monitor graphics card operations