]> git.ipfire.org Git - thirdparty/libvirt.git/commit
syntax-check: sc_avoid_write: Don't use blanket file exceptions
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Feb 2022 15:39:00 +0000 (16:39 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Feb 2022 08:32:23 +0000 (09:32 +0100)
commit654486bd57e056f0db1f4f1187337fbef65dd02d
tree9a9d19a408ecb5b298721ec6fe828925aabec5fb
parent7c35c483eaa78eb847e0865cbb210d5355f75d7a
syntax-check: sc_avoid_write: Don't use blanket file exceptions

Adding an exception for the whole file usually defeats the purpose of a
syntax check and is also likely to get forgotten once the file is
removed.

In case of the suggestion of using 'safewrite' instead of write even the
comment for safewrite states that the function needs to be used only in
certain cases.

Remove the blanket exceptions for files and use an exclude string
instead. The only instance where we keep the full file exception is for
src/libvirt-stream.c as there are multiple uses in example code in
comments where I couldn't find a nicer targetted wapproach.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
14 files changed:
build-aux/syntax-check.mk
src/locking/lock_daemon.c
src/logging/log_daemon.c
src/lxc/lxc_controller.c
src/qemu/qemu_monitor.c
src/remote/remote_ssh_helper.c
src/rpc/virnetsocket.c
src/util/vircommand.c
src/util/virfdstream.c
src/util/virfile.c
tests/shunloadtest.c
tests/vircgroupmock.c
tests/virnettlssessiontest.c
tools/virsh-console.c