]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: read all types of kernel messages
authorKarel Zak <kzak@redhat.com>
Tue, 3 Dec 2024 17:56:41 +0000 (18:56 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 8 Jan 2025 12:58:13 +0000 (13:58 +0100)
commit33c42f5b1728585c012f01121a6126e845e8e68b
tree7757c08165e63033baeb36dd7aa33eecb1ce698e
parentdf67bcc130daf634b190082cd8199e4ec64723ec
libmount: read all types of kernel messages

Previously, libmount only read error messages from fsopen() file
descriptor. This commit improves the library to read all messages
and keep them in their original format ("<type> <mesg>") in the library mount context.
Applications can now read all messages by using mnt_context_get_mesgs().

Furthermore, private functions have been implemented to include new
library-specific messages in the log. Currently, these messages are
only managed in mnt_context_get_excode(), but it would be beneficial
to relocate them to the appropriate locations where errors are
triggered.

In the future, mnt_context_get_excode() should only be utilized by
basic applications that require an one error message. For more
critical purposes (e.g. mount(8)), it will be recommended to utilize
the messages array.

The public function mnt_context_get_excode() has been modified to use
the new functionality and provide messages in a backwardly compatible
way.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/docs/libmount-sections.txt
libmount/src/context.c
libmount/src/context_mount.c
libmount/src/hook_loopdev.c
libmount/src/hook_mount.c
libmount/src/libmount.h.in
libmount/src/libmount.sym
libmount/src/mountP.h