[PATCH 1/3] tests: Don't crash when creating the config object fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As observed when building in a chroot and QEMU_USER doesn't exist
---
 tests/qemuargv2xmltest.c | 3 +++
 tests/qemuxml2argvtest.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index 6d7e23e..4cc3749 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -128,6 +128,9 @@ mymain(void)
     int ret = 0;
 
     driver.config = virQEMUDriverConfigNew(false);
+    if (driver.config == NULL)
+        return EXIT_FAILURE;
+
     if ((driver.caps = testQemuCapsInit()) == NULL)
         return EXIT_FAILURE;
 
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 56854dc..13ed4f6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -501,6 +501,9 @@ mymain(void)
     }
 
     driver.config = virQEMUDriverConfigNew(true);
+    if (driver.config == NULL)
+        return EXIT_FAILURE;
+
     VIR_FREE(driver.config->spiceListen);
     VIR_FREE(driver.config->vncListen);
 
-- 
1.9.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]