From: Christian Ehrhardt Date: Thu, 16 Jan 2020 08:13:28 +0000 (+0100) Subject: test: let qemuhotplugtest report details of init fails X-Git-Tag: v6.1.0-rc1~459 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e62941f2b5da573a49a8eb66761b75cdcb0baf;p=thirdparty%2Flibvirt.git test: let qemuhotplugtest report details of init fails If virHostdevManagerGetDefault in qemuhotplugtest fails it works for quite a while to later segfault when accessing mgr->activePCIHostdevs. Report the error details and break on a failed init to see the real issue right away. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani Signed-off-by: Christian Ehrhardt --- diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index a60c8d1c93..6a3e61c54b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -634,6 +634,11 @@ mymain(void) return EXIT_FAILURE; driver.hostdevMgr = virHostdevManagerGetDefault(); + if (driver.hostdevMgr == NULL) { + VIR_TEST_VERBOSE("Could not initialize HostdevManager - %s\n", + virGetLastErrorMessage()); + return EXIT_FAILURE; + } #define DO_TEST(file, ACTION, dev, fial, kep, ...) \