[PATCH] virkmodtest: Don't fail if modprobe doesn't exist

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

 



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@xxxxxxxxxx>
---
 tests/virkmodtest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c
index c90830a23c..80029244ff 100644
--- a/tests/virkmodtest.c
+++ b/tests/virkmodtest.c
@@ -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;
-- 
2.19.2


[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]

  Powered by Linux