[libvirt PATCH 1/7] testutilsxen: error out on initialization failure

Ján Tomko jtomko at redhat.com
Sat Feb 22 14:25:05 UTC 2020


libxlDriverConfigNew can possibly fail on wrong
firmware values (unlikely) or on failure to create
the log directory (possible if you're debugging
tests with VIR_FILE_ACCESS)

Signed-off-by: Ján Tomko <jtomko at redhat.com>
Fixes: 4a4132b4625778cf80acb9c92d06351b44468ac3
---
 tests/testutilsxen.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c
index b73c79581d..76da33826c 100644
--- a/tests/testutilsxen.c
+++ b/tests/testutilsxen.c
@@ -94,7 +94,8 @@ libxlDriverPrivatePtr testXLInitDriver(void)
         return NULL;
     }
 
-    driver->config = libxlDriverConfigNew();
+    if (!(driver->config = libxlDriverConfigNew()))
+        return NULL;
 
     driver->config->caps = testXLInitCaps();
 
-- 
2.24.1




More information about the libvir-list mailing list