]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virLXCProcessReadLogOutputData: Refill buffer after filtering out noise
authorPeter Krempa <pkrempa@redhat.com>
Wed, 2 Aug 2023 07:20:24 +0000 (09:20 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 4 Aug 2023 08:04:21 +0000 (10:04 +0200)
commit1f8558cf9a32dea4ec785d060317acc84e485155
treebdd9867be114c965206015444d9ad7906895dd35
parent4b57c5fecf928e10ee04b7e411ddc3c9cc6078c2
virLXCProcessReadLogOutputData: Refill buffer after filtering out noise

The caller passes in a 1k buffer, which when debug logging is in use is
easily filled with debug messages only. Thus after the first pass which
is common if the controller process already terminated the buffer will
not contain the real error, but rather a truncated debug message,
which will result in an error such as:

  error: internal error: guest failed to start: 2023-08-01 12:58:31.948+0000: 798195: i

instead of the proper error:

 error: internal error: guest failed to start: Failure in libvirt_lxc startup: Failed to create /home/rootfs/.oldroot: Permission denied

To fix the above retry the reading loop if the filtering function made
space in the buffer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_process.c