X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fcga.c;h=ee94f84f343fba49599eb433ec7f9e72722c64b7;hp=567a50c31565a50a622abb20a76e7039e493f54f;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hpb=0e232390dba4ac9732d934315688ecb99effe4f8 diff --git a/palacios/src/devices/cga.c b/palacios/src/devices/cga.c index 567a50c..ee94f84 100644 --- a/palacios/src/devices/cga.c +++ b/palacios/src/devices/cga.c @@ -28,12 +28,12 @@ -/* + #ifndef DEBUG_CGA #undef PrintDebug #define PrintDebug(fmt, args...) #endif -*/ + #define START_ADDR 0xB8000 #define END_ADDR 0xC0000 @@ -310,18 +310,20 @@ static struct v3_device_ops dev_ops = { .stop = NULL, }; -static int cga_init(struct guest_info * vm, void * cfg_data) { +static int cga_init(struct guest_info * vm, v3_cfg_tree_t * cfg) { struct video_internal * video_state = (struct video_internal *)V3_Malloc(sizeof(struct video_internal)); addr_t frame_buf_pa = 0; - uint32_t enable_passthrough = (uint32_t)(addr_t)cfg_data; + int enable_passthrough = 0; + char * name = v3_cfg_val(cfg, "name"); + enable_passthrough = (strcasecmp(v3_cfg_val(cfg, "passthrough"), "enable") == 0) ? 1 : 0; PrintDebug("video: init_device\n"); - struct vm_device * dev = v3_allocate_device("CGA_VIDEO", &dev_ops, video_state); + struct vm_device * dev = v3_allocate_device(name, &dev_ops, video_state); if (v3_attach_device(vm, dev) == -1) { - PrintError("Could not attach device %s\n", "CGA_VIDEO"); + PrintError("Could not attach device %s\n", name); return -1; }