qemu-e2k/include
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
..
block nbd: Always call "close_fn" in nbd_client_new 2016-01-15 18:58:01 +01:00
crypto crypto: Fix typo in example 2016-01-11 11:39:28 +03:00
disas disas: Add print_insn to disassemble info 2015-07-09 15:20:40 +02:00
exec ivshmem: Store file descriptor for vhost-user negotiation 2016-01-09 23:20:20 +02:00
fpu
hw vmw_pvscsi: x-disable-pcie, x-old-pci-configuration back-compat props are 2.5 specific 2016-01-15 18:58:01 +01:00
io io: add QIOChannelBuffer class 2015-12-18 12:18:31 +00:00
libdecnumber
migration migration: Add state records for migration incoming 2016-01-13 16:01:24 +05:30
monitor monitor/target-ppc: Define target_get_monitor_def 2015-11-12 14:53:36 +11:00
net ether/slirp: Avoid redefinition of the same constants 2016-01-11 11:01:35 +08:00
qapi error: New error_prepend(), error_reportf_err() 2016-01-13 15:16:17 +01:00
qemu qemu-char: delete send_all/recv_all helper methods 2016-01-15 18:58:01 +01:00
qom qom: Update documentation comment of struct Object 2015-12-03 20:10:22 +01:00
standard-headers linux-headers: update from kvm/next 2015-12-17 15:24:34 +01:00
sysemu qemu-char: add logfile facility to all chardev backends 2016-01-15 18:58:02 +01:00
ui sdl2/opengl: add opengl context and scanout support 2016-01-08 12:20:15 +01:00
config.h
elf.h elf: add arm note types 2016-01-15 14:55:16 +00:00
glib-compat.h glib: add compatibility interface for g_hash_table_add() 2015-10-30 09:01:03 +01:00
qemu-common.h osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h 2016-01-11 11:39:28 +03:00
qemu-io.h
qjson.h
trace-tcg.h
trace.h