mirror_qemu/ui
Daniel P. Berrange d0d7708ba2 qemu-char: add logfile facility to all chardev backends
Typically a UNIX guest OS will log boot messages to a serial
port in addition to any graphical console. An admin user
may also wish to use the serial port for an interactive
console. A virtualization management system may wish to
collect system boot messages by logging the serial port,
but also wish to allow admins interactive access.

Currently providing such a feature forces the mgmt app
to either provide 2 separate serial ports, one for
logging boot messages and one for interactive console
login, or to proxy all output via a separate service
that can multiplex the two needs onto one serial port.
While both are valid approaches, they each have their
own downsides. The former causes confusion and extra
setup work for VM admins creating disk images. The latter
places an extra burden to re-implement much of the QEMU
chardev backends logic in libvirt or even higher level
mgmt apps and adds extra hops in the data transfer path.

A simpler approach that is satisfactory for many use
cases is to allow the QEMU chardev backends to have a
"logfile" property associated with them.

 $QEMU -chardev socket,host=localhost,port=9000,\
                server=on,nowait,id-charserial0,\
		logfile=/var/log/libvirt/qemu/test-serial0.log
       -device isa-serial,chardev=charserial0,id=serial0

This patch introduces a 'ChardevCommon' struct which
is setup as a base for all the ChardevBackend types.
Ideally this would be registered directly as a base
against ChardevBackend, rather than each type, but
the QAPI generator doesn't allow that since the
ChardevBackend is a non-discriminated union. The
ChardevCommon struct provides the optional 'logfile'
parameter, as well as 'logappend' which controls
whether QEMU truncates or appends (default truncate).

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1452516281-27519-1-git-send-email-berrange@redhat.com>
[Call qemu_chr_parse_common if cd->parse is NULL. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-01-15 18:58:02 +01:00
..
shader console-gl: add opengl rendering helper functions 2015-05-05 10:48:22 +02:00
Makefile.objs gtk/opengl: add opengl context and scanout support (GtkGLArea) 2015-10-08 10:34:53 +02:00
cocoa.m qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
console-gl.c shaders: initialize vertexes once 2015-10-08 10:31:35 +02:00
console.c qemu-char: add logfile facility to all chardev backends 2016-01-15 18:58:02 +01:00
curses.c ui/curses: Fix color attribute of monitor for curses 2016-01-08 12:20:07 +01:00
curses_keys.h ui/curses: Fix pageup/pagedown on -curses 2015-11-03 10:12:46 +01:00
cursor.c ui: move files to ui/ and include/ui/ 2012-12-19 08:31:30 +01:00
cursor_hidden.xpm ui: move files to ui/ and include/ui/ 2012-12-19 08:31:30 +01:00
cursor_left_ptr.xpm ui: move files to ui/ and include/ui/ 2012-12-19 08:31:30 +01:00
egl-context.c opengl: add egl-context.[ch] helpers 2015-10-08 10:34:53 +02:00
egl-helpers.c ui: add egl-helpers 2015-05-29 11:11:38 +02:00
gtk-egl.c gtk/opengl: add opengl context and scanout support (egl) 2015-10-08 10:34:53 +02:00
gtk-gl-area.c gtk/opengl: add opengl context and scanout support (GtkGLArea) 2015-10-08 10:34:53 +02:00
gtk.c qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
input-keymap.c qapi: Don't let implicit enum MAX member collide 2015-12-17 08:21:28 +01:00
input-legacy.c qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
input.c qapi: Don't let implicit enum MAX member collide 2015-12-17 08:21:28 +01:00
keymaps.c ui: Use g_new() & friends where that makes obvious sense 2015-11-06 15:42:38 +03:00
keymaps.h
qemu-pixman.c ui/pixman: add qemu_pixman_check_format 2015-01-19 13:33:26 +01:00
qemu-x509.h ui: move files to ui/ and include/ui/ 2012-12-19 08:31:30 +01:00
sdl.c qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
sdl2-2d.c sdl2: stop flickering 2015-10-08 10:31:35 +02:00
sdl2-gl.c sdl2/opengl: add opengl context and scanout support 2016-01-08 12:20:15 +01:00
sdl2-input.c sdl2: move SDL_* includes to sdl2.h 2015-05-05 10:48:26 +02:00
sdl2-keymap.h sdl2: keymap fixups 2014-09-16 08:07:05 +02:00
sdl2.c sdl2/opengl: add opengl context and scanout support 2016-01-08 12:20:15 +01:00
sdl_keysym.h ui/sdl2 : initial port to SDL 2.0 (v2.0) 2014-03-05 09:52:05 +01:00
sdl_zoom.c sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits 2013-01-15 18:25:30 -06:00
sdl_zoom.h
sdl_zoom_template.h sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits 2013-01-15 18:25:30 -06:00
shader.c shaders: initialize vertexes once 2015-10-08 10:31:35 +02:00
spice-core.c qapi: Unbox base members 2015-11-02 08:30:26 +01:00
spice-display.c spice: surface switch fast path requires same format too. 2015-09-21 09:52:07 +02:00
spice-input.c qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
vgafont.h ui: move files to ui/ and include/ui/ 2012-12-19 08:31:30 +01:00
vnc-auth-sasl.c ui: convert VNC server to use QIOChannelSocket 2015-12-18 15:02:11 +00:00
vnc-auth-sasl.h aio / timers: Untangle include files 2013-08-22 19:10:27 +02:00
vnc-auth-vencrypt.c ui: convert VNC server to use QIOChannelTLS 2015-12-18 15:02:11 +00:00
vnc-auth-vencrypt.h
vnc-enc-hextile-template.h pixman/vnc: use pixman images in vnc. 2012-11-01 14:00:04 +01:00
vnc-enc-hextile.c pixman/vnc: remove dead code. 2012-11-01 14:00:05 +01:00
vnc-enc-tight.c vnc-enc-tight: fix Arguments in wrong order 2014-12-10 10:08:12 +01:00
vnc-enc-tight.h
vnc-enc-zlib.c
vnc-enc-zrle-template.c
vnc-enc-zrle.c pixman/vnc: use pixman images in vnc. 2012-11-01 14:00:04 +01:00
vnc-enc-zrle.h
vnc-enc-zywrle-template.c
vnc-enc-zywrle.h misc: Spelling and grammar fixes in comments 2013-10-26 13:06:45 +04:00
vnc-jobs.c ui: convert VNC server to use QIOChannelSocket 2015-12-18 15:02:11 +00:00
vnc-jobs.h ui/vnc: Remove vnc_stop_worker_thread() 2015-03-10 08:15:33 +03:00
vnc-palette.c ui/vnc-palette.c: Include headers it needs 2012-12-06 09:17:05 +01:00
vnc-palette.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
vnc-ws.c ui: convert VNC server to use QIOChannelWebsock 2015-12-18 15:02:11 +00:00
vnc-ws.h ui: convert VNC server to use QIOChannelWebsock 2015-12-18 15:02:11 +00:00
vnc.c error: Use error_reportf_err() where it makes obvious sense 2016-01-13 15:16:17 +01:00
vnc.h ui: convert VNC server to use QIOChannelWebsock 2015-12-18 15:02:11 +00:00
vnc_keysym.h qemu-char: add cyrillic characters 'numerosign' to VNC keysyms 2015-03-10 08:15:34 +03:00
x_keymap.c kbd: add brazil kbd keys to x11 evdev map 2015-05-29 10:30:06 +02:00
x_keymap.h