1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(logs): libvirt prints no errors on the processes' stderr

libvirt's default handler printed each error on stderr without saying
where it came from: in Docker those lines went to docker logs, and a
VM page read of a shut-off VM left one there. Every process that talks to
libvirt imports vrtManager.connection, which now registers a silent
handler; the errors still reach their callers as exceptions. The
console callback's own registration is dropped.
This commit is contained in:
catborise 2026-11-05 15:12:06 +03:00
parent 5d90d3fcf9
commit f670ee7333
3 changed files with 17 additions and 3 deletions

View file

@ -58,6 +58,10 @@ CLOSE_REASONS = {
SSH_COMMAND = os.path.join(os.path.dirname(os.path.abspath(__file__)), "libvirt-ssh")
logger = logging.getLogger(__name__)
# libvirt prints each error on stderr without saying where it came from; every
# process that talks to libvirt imports this module. The errors are raised to
# the callers, which handle or report them.
libvirt.registerErrorHandler(lambda context, error: None, None)
class wvmEventLoop(threading.Thread):