In case filter is new one an oom error message is reported.
This bug is introduced in 51b2606f. However this error does
not get into the log in the default configuration. To trigger
it one need to specify log outputs in LIBVIRT_LOG_OUTPUTS
variable.
---
src/util/virlog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virlog.c b/src/util/virlog.c
index 06f9a60..f5b88b6 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -335,11 +335,12 @@ virLogDefineFilter(const char *match,
goto cleanup;
virLogFiltersSerial++;
+ ret = virLogNbFilters - 1;
cleanup:
virLogUnlock();
if (ret < 0)
virReportOOMError();
- return virLogNbFilters;
+ return ret;
}
/**
--
1.8.3.1