qemu-e2k/include/sysemu
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
..
accel.h
arch_init.h migration: move ram stuff to migration/ram 2015-06-12 06:40:59 +02:00
balloon.h Inhibit ballooning during postcopy 2015-11-10 15:00:28 +01:00
block-backend.h nbd-server: do not exit on failed memory allocation 2016-01-15 18:58:02 +01:00
blockdev.h qmp: Introduce blockdev-change-medium 2015-11-11 16:22:47 +01:00
bt.h
char.h qemu-char: add logfile facility to all chardev backends 2016-01-15 18:58:02 +01:00
cpus.h Revert "Introduce cpu_clean_all_dirty" 2015-11-05 11:28:23 +01:00
device_tree.h
dma.h exec.c: Make address_space_rw take transaction attributes 2015-04-26 16:49:24 +01:00
dump-arch.h dump: allow target to set the physical base 2016-01-15 14:40:25 +00:00
dump.h dump: allow target to set the physical base 2016-01-15 14:40:25 +00:00
hostmem.h
iothread.h Remove various unused functions 2015-05-08 14:11:10 +03:00
kvm_int.h kvm-all: add support for multiple address spaces 2015-07-06 17:59:43 +02:00
kvm.h kvm: x86: add support for KVM_CAP_SPLIT_IRQCHIP 2015-12-17 17:33:47 +01:00
memory_mapping.h
numa.h numa: API to lookup NUMA node by address 2015-07-03 17:47:58 -03:00
os-posix.h
os-win32.h oslib-win32: Change return type of function getpagesize 2015-11-30 06:47:02 +01:00
qtest.h
replay.h replay: recording of the user input 2015-11-06 10:16:03 +01:00
rng-random.h
rng.h
seccomp.h
sysemu.h Finish non-postcopiable iterative devices before package 2015-11-12 17:52:29 +01:00
tpm_backend_int.h Remove various unused functions 2015-05-08 14:11:10 +03:00
tpm_backend.h Extend TPM TIS interface to support TPM 2 2015-05-31 20:29:02 +02:00
tpm.h TPM: fix build with tpm disabled 2015-06-03 18:19:15 +02:00
watchdog.h
xen-mapcache.h