[PATCH 09/33] lxc_process: Remove OOM handling from logging setup

Peter Krempa pkrempa at redhat.com
Wed Feb 24 16:16:44 UTC 2021


'virLogGetFilters' doesn't return failure and 'virLogGetOutputs' reports
it's own errors.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/lxc/lxc_process.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index cbc04a3dcd..679709605e 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -960,21 +960,14 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,

     if (virLogGetNbFilters() > 0) {
         filterstr = virLogGetFilters();
-        if (!filterstr) {
-            virReportOOMError();
-            goto error;
-        }

         virCommandAddEnvPair(cmd, "LIBVIRT_LOG_FILTERS", filterstr);
     }

     if (cfg->log_libvirtd) {
         if (virLogGetNbOutputs() > 0) {
-            outputstr = virLogGetOutputs();
-            if (!outputstr) {
-                virReportOOMError();
+            if (!(outputstr = virLogGetOutputs()))
                 goto error;
-            }

             virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
         }
-- 
2.29.2




More information about the libvir-list mailing list