summaryrefslogtreecommitdiff
path: root/build-aux/syntax-check.mk
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2021-02-24 11:34:00 +0100
committerPeter Krempa <pkrempa@redhat.com>2021-03-02 09:50:20 +0100
commitfd8bfd522b6547d28028904e42312cba29304358 (patch)
tree62c5b1ec26ee3965fa130cad437b1ce8074dc9e4 /build-aux/syntax-check.mk
parentd877eb1ddcfe6204b80937e019531f501c6c57e7 (diff)
downloadlibvirt-fd8bfd522b6547d28028904e42312cba29304358.tar.gz
util: virerror: Remove virReportOOMError
Trying to report an OOM error is pointless since our infrastructure to report error needs to allocate memory to report the error. In addition our code mistakenly reported OOM errors even in cases where a function could fail for another reason, which would make issues harder to debug. Remove the virReportOOMError and backend so that programmers are forced to think about what can happen. In case when there's another failure possible a specific error should be reported and otherwise a direct abort() is better since the logger would abort on g_new anyways. This patch also removes the syntas-check which forces use of virReportOOMError instead of using VIR_ERR_NO_MEMORY with other functions. This allows possible future use when we'd end up in a situation where trying to recover from an OOM would make sense, such as when attempting to allocate a massive buffer. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
Diffstat (limited to 'build-aux/syntax-check.mk')
-rw-r--r--build-aux/syntax-check.mk8
1 files changed, 0 insertions, 8 deletions
diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index e51877648a..e1ccb74986 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -490,11 +490,6 @@ sc_prohibit_gettext_noop:
halt='use N_, not gettext_noop' \
$(_sc_search_regexp)
-sc_prohibit_VIR_ERR_NO_MEMORY:
- @prohibit='\<VIR_ERR_NO_MEMORY\>' \
- halt='use virReportOOMError, not VIR_ERR_NO_MEMORY' \
- $(_sc_search_regexp)
-
sc_prohibit_PATH_MAX:
@prohibit='\<PATH_MAX\>' \
halt='dynamically allocate paths, do not use PATH_MAX' \
@@ -1895,9 +1890,6 @@ exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$|tests/commandtest.c$$)
-exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \
- ^(build-aux/syntax-check\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$
-
exclude_file_name_regexp--sc_prohibit_PATH_MAX = \
^build-aux/syntax-check\.mk$$