mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-29 00:55:22 +00:00
cc9e80c593
The virtualization driver has two connections to the virtlogd daemon, one pipe fd for writing to the log file, and one socket fd for making RPC calls. The typical sequence is to write some data to the pipe fd and then make an RPC call to determine the current log file offset. Unfortunately these two operations are not guaranteed to be handling in order by virtlogd. The event loop for virtlogd may identify an incoming event on both the pipe fd and socket fd in the same iteration of the event loop. It is then entirely possible that it will process the socket fd RPC call before reading the pending log data from the pipe fd. As a result the virtualization driver will get an outdated log file offset reported back. This can be seen with the QEMU driver where, when a guest fails to start, it will randomly include too much data in the error message it has fetched from the log file. The solution is to ensure we have drained all pending data from the pipe fd before reporting the log file offset. The pipe fd is always in blocking mode, so cares needs to be taken to avoid blocking. When draining this is taken care of by using poll(). The extra complication is that they might already be an event loop dispatch pending on the pipe fd. If we have just drained the pipe this pending event will be invalid so must be discarded. See also https://bugzilla.redhat.com/show_bug.cgi?id=1356108 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> |
||
---|---|---|
.. | ||
log_daemon_config.c | ||
log_daemon_config.h | ||
log_daemon_dispatch.c | ||
log_daemon_dispatch.h | ||
log_daemon.c | ||
log_daemon.h | ||
log_handler.c | ||
log_handler.h | ||
log_manager.c | ||
log_manager.h | ||
log_protocol.x | ||
Makefile.inc.am | ||
test_virtlogd.aug.in | ||
virtlogd-admin.socket.in | ||
virtlogd.aug | ||
virtlogd.conf | ||
virtlogd.init.in | ||
virtlogd.pod | ||
virtlogd.service.in | ||
virtlogd.socket.in | ||
virtlogd.sysconf |