virkmodtest: Don't fail if modprobe doesn't exist

On some very basic installations (e.g. some container images) the
modprobe binary might be missing. If that is the case, don't fail
virkmodtest.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2019-02-14 16:25:44 +01:00
parent d3e5c3605a
commit fa5db009c9

View File

@ -46,7 +46,12 @@ testKModConfig(const void *args ATTRIBUTE_UNUSED)
*/
outbuf = virKModConfig();
if (!outbuf) {
fprintf(stderr, "Failed to get config\n");
if (virFileIsExecutable(MODPROBE)) {
fprintf(stderr, "Failed to get config\n");
} else {
/* modprobe doesn't exist, do not claim error. */
ret = 0;
}
goto cleanup;
}
ret = 0;