summaryrefslogtreecommitdiff
path: root/ui/console.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-05console: add QemuUIInfoGerd Hoffmann1-0/+17
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-03-05console: add head to index to qemu consoles.Gerd Hoffmann1-4/+24
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-03-05console: export QemuConsole index,width,heightGerd Hoffmann1-0/+24
Add functions to query QemuConsole properties. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-12-02misc: Replace 'struct QEMUTimer' by 'QEMUTimer'Stefan Weil1-1/+1
Most code already used QEMUTimer without the redundant 'struct' keyword. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-12-02console: Replace conditional debug messages by trace methodsStefan Weil1-8/+3
Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-12-02trace: Remove trace.h from console.h (less dependencies)Stefan Weil1-0/+1
This reduces the dependencies on trace.h. Only two source files which need console.h also need trace.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13console: Remove unused debug codeStefan Weil1-33/+0
The local function console_print_text_attributes is no longer used since commit 7d6ba01c3741bc32ae252bf64a5fd3f930c2df4f. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh1-15/+15
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-06-28console: Hook QemuConsoles into qom treeGerd Hoffmann1-0/+10
Put them named "console[$index]" below "/backend", so you can list & inspect them via QMP. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1372150171-8707-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-10qemu-char: don't issue CHR_EVENT_OPEN in a BHMichael Roth1-0/+4
When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET, and it was issued as a bottom-half: 86e94dea5b740dad65446c857f6959eae43e0ba6 Which we basically used to print out a greeting/prompt for the monitor. AFAICT the only reason this was ever done in a BH was because in some cases we'd modify the chr_write handler for a new chardev backend *after* the site where we issued the reset (see: 86e94d:qemu_chr_open_stdio()) At some point this event was renamed to CHR_EVENT_OPENED, and we've maintained the use of this BH ever since. However, due to 9f939df955a4152aad69a19a77e0898631bb2c18, we schedule the BH via g_idle_add(), which is causing events to sometimes be delivered after we've already begun processing data from backends, leading to: known bugs: QMP: session negotation resets with OPENED event, in some cases this is causing new sessions to get sporadically reset potential bugs: hw/usb/redirect.c: can_read handler checks for dev->parser != NULL, which may be true if CLOSED BH has not been executed yet. In the past, OPENED quiesced outstanding CLOSED events prior to us reading client data. If it's delayed, our check may allow reads to occur even though we haven't processed the OPENED event yet, and when we do finally get the OPENED event, our state may get reset. qtest.c: can begin session before OPENED event is processed, leading to a spurious reset of the system and irq_levels gdbstub.c: may start a gdb session prior to the machine being paused To fix these, let's just drop the BH. Since the initial reasoning for using it still applies to an extent, work around that by deferring the delivery of CHR_EVENT_OPENED until after the chardevs have been fully initialized, toward the end of qmp_chardev_add() (or some cases, qemu_chr_new_from_opts()). This defers delivery long enough that we can be assured a CharDriverState is fully initialized before CHR_EVENT_OPENED is sent. Also, rather than requiring each chardev to do an explicit open, do it automatically, and allow the small few who don't desire such behavior to suppress the OPENED-on-init behavior by setting a 'explicit_be_open' flag. We additionally add missing OPENED events for stdio backends on w32, which were previously not being issued, causing us to not recieve the banner and initial prompts for qmp/hmp. Reported-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1370636393-21044-1-git-send-email-mdroth@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-25console: add dummy surface for guests without graphic cardGerd Hoffmann1-2/+32
So users get a notification instead of a crash. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-25console: zap ds arg from register_displaychangelistenerGerd Hoffmann1-5/+5
We don't have multiple DisplayStates any more, so passing it in as argument is not needed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-25console: switch ppm_save to qemu_openGerd Hoffmann1-2/+4
... so it works with fdset. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-25console: add qemu_console_lookup_by_deviceGerd Hoffmann1-0/+19
Look up the QemuConsole for a given device, using the new link. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-25console: add device link to QemuConsolesGerd Hoffmann1-1/+14
So it is possible to figure which qemu console displays which device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-25console: qom-ify QemuConsoleGerd Hoffmann1-1/+14
Just the minimal bits to turn QemuConsoles into Objects. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: allow pinning displaychangelisteners to consolesGerd Hoffmann1-30/+73
DisplayChangeListener gets a new QemuConsole field, which can be set to non-NULL before registering. This will pin the QemuConsole, so that particular DisplayChangeListener will not follow console switches. spice+gtk (which don't support text console input anyway) are switched over to be pinned to console 0, which usually is the graphical display. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: add qemu_console_is_*Gerd Hoffmann1-26/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16xen: re-enable refresh interval reporting for xenfbGerd Hoffmann1-0/+6
xenfb informs the guest about the gui refresh interval so it can avoid pointless work. That logic was temporarely disabled for the DisplayState reorganization. Restore it now, with a proper interface for it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: gui timer fixesGerd Hoffmann1-5/+29
Make gui update rate adaption code in gui_update() actually work. Sprinkle in a tracepoint so you can see the code at work. Remove the update rate adaption code in vnc and make vnc simply use the generic bits instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: add GraphicHwOpsGerd Hoffmann1-17/+16
Pass a single GraphicHwOps struct pointer to graphic_console_init, instead of a bunch of function pointers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: make DisplayState private to console.cGerd Hoffmann1-0/+8
With gui_* being moved to console.c nobody outside console.c needs access to DisplayState fields any more. Make the struct private. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: move gui_update+gui_setup_refresh from vl.c into console.cGerd Hoffmann1-0/+50
Pure code motion, no functional changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: zap g_width + g_heightGerd Hoffmann1-23/+9
We have a surface per QemuConsole now, so there is no need to keep track of the QemuConsole size any more as we can query the surface size directly at any time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: simplify screendumpGerd Hoffmann1-19/+53
Screendumps are alot simpler as we can update non-active QemuConsoles now. So we only need to update the QemuConsole we want write out, then dump the DisplaySurface content into a ppm file. Done. No console switching needed. No special support code in the gfx card emulation needed. Zap it all. Also move ppm_save out of the vga code and next to the qmp_screendump function. For now screen dumping is limited to console #0 (like it used to be), even though it is dead simple to extend it to other consoles. I wanna finish the console cleanup before setting new qapi interfaces into stone. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
2013-04-16console: give each QemuConsole its own DisplaySurfaceGerd Hoffmann1-27/+69
Go away from the global DisplaySurface, give one to each QemuConsole instead. With this patch applied it is possible to call graphics_hw_* functions with qemu consoles which are not the current foreground console. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: rename vga_hw_*, add QemuConsole paramGerd Hoffmann1-19/+30
Add QemuConsole parameter to vga_hw_*, so the interface allows to update non-active consoles (the actual code can't handle this yet, see next patch). Passing NULL is allowed and updates the active console, like the functions do today. While touching all vga_hw_* calls anyway rename that to the functions to hardware-neutral graphics_hw_* Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: displaystate init revampGerd Hoffmann1-39/+34
We have only one DisplayState, so there is no need for the "next" linking, rip it. Also consolidate all displaystate initialization into init_displaystate(). This function is called by vl.c after creating the devices (and thus all QemuConsoles) and before initializing DisplayChangeListensers (aka gtk/sdl/vnc/spice ui). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: add trace eventsGerd Hoffmann1-0/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: switch color_table_rgb to pixman_color_tGerd Hoffmann1-16/+8
Now that all text console rendering uses pixman we can easily switch the color tables to use pixman_color_t directly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: use pixman for font renderingGerd Hoffmann1-99/+11
Zap homegrown font rendering code, use pixman calls instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-16console: use pixman for fill+blitGerd Hoffmann1-55/+10
Zap homegrown pixel shuffeling code, use pixman calls instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-15sysemu: avoid proliferation of include/ subdirectoriesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-03-27qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_openHans de Goede1-1/+1
To better reflect that it is for handling a backend being opened. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-03-18console: remove ds_get_* helper functionsGerd Hoffmann1-63/+79
Switch the few remaining ds_get_* uses in console.c over to the new surface_* accessors. While doing so tripped over a few leftovers from commit a93a4a226a2afba147ba5df688b85d844f537c68 (code using depth == 0 as indicator for textmode rendering). Fixed them up. Finally dropped ds_get_* helper helpers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: zap color_tableGerd Hoffmann1-77/+6
qemu_create_surface hands out 32bpp surfaces. So we can just use color_table_rgb directly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: stop using DisplayState in gfx hardware emulationGerd Hoffmann1-47/+47
Use QemuConsole instead. Updates interfaces in console.[ch] and adapts gfx hardware emulation code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: zap displaystate from dcl callbacksGerd Hoffmann1-11/+11
Now that nobody depends on DisplayState in DisplayChangeListener callbacks any more we can remove the parameter from all callbacks. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: rework DisplaySurface handling [dcl/ui side]Gerd Hoffmann1-4/+4
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener callbacks with a dpy_gfx_switch callback which notifies the ui code when the framebuffer backing storage changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: rework DisplaySurface handling [vga emu side]Gerd Hoffmann1-42/+29
Decouple DisplaySurface allocation & deallocation from DisplayState. Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surface function. This handles the graphic hardware emulation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-18console: fix displaychangelisteners interfaceGerd Hoffmann1-0/+144
Split callbacks into separate Ops struct. Pass DisplayChangeListener pointer as first argument to all callbacks. Uninline a bunch of display functions and move them from console.h to console.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-13chardev: add vc support to qapiGerd Hoffmann1-12/+49
This patch adds 'vc' support to qapi and also switches over the vc chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-03-08qemu-char: move text console init to console.cAnthony Liguori1-0/+7
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Message-id: 17cefde0a8d7807294bab95e93c3328a20d3f2ed.1362505276.git.amit.shah@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-21console: allow VCs to be overridden by UIAnthony Liguori1-1/+13
We want to expose VCs using a VteTerminal widget. We need access to provide our own CharDriverState in order to do this. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
2013-02-21vga: fix byteswapping.Gerd Hoffmann1-2/+7
In case host and guest endianness differ the vga code first creates a shared surface (using qemu_create_displaysurface_from), then goes patch the surface format to indicate that the bytes must be swapped. The switch to pixman broke that hack as the format patching isn't propagated into the pixman image, so ui code using the pixman image directly (such as vnc) uses the wrong format. Fix that by adding a byteswap parameter to qemu_create_displaysurface_from, so we'll use the correct format when creating the surface (and the pixman image) and don't have to patch the format afterwards. [ v2: unbreak xen build ] Cc: qemu-stable@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Cc: agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1361349432-23884-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-11error: Strip trailing '\n' from error string arguments (again)Markus Armbruster1-1/+1
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming back. Tracked down with this Coccinelle semantic patch: @r@ expression err, eno, cls, fmt; position p; @@ ( error_report(fmt, ...)@p | error_set(err, cls, fmt, ...)@p | error_set_errno(err, eno, cls, fmt, ...)@p | error_setg(err, fmt, ...)@p | error_setg_errno(err, eno, fmt, ...)@p ) @script:python@ fmt << r.fmt; p << r.p; @@ if "\\n" in str(fmt): print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt) Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1360354939-10994-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19softmmu: move remaining include files to include/ subdirectoriesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19ui: move files to ui/ and include/ui/Paolo Bonzini1-0/+1724
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>