]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove redundant virFileIsExecutable check
authorRadostin Stoyanov <rstoyanov1@gmail.com>
Fri, 13 Apr 2018 06:01:45 +0000 (07:01 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Apr 2018 06:51:33 +0000 (08:51 +0200)
Remove unnecessary virFileIsExecutable check after virFindFileInPath.
Since the commit 9ae992f virFindFileInPath will reject non-executables.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/bhyve/bhyve_capabilities.c
src/qemu/qemu_capabilities.c

index 381cc0de37d5f4fa050ef2ff20e45caa1ac067de..e13085b1d50ed7017bcba27bc916316e542e6fa6 100644 (file)
@@ -179,8 +179,6 @@ virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps)
     binary = virFindFileInPath("grub-bhyve");
     if (binary == NULL)
         goto out;
-    if (!virFileIsExecutable(binary))
-        goto out;
 
     cmd = virCommandNew(binary);
     virCommandAddArg(cmd, "--help");
@@ -315,8 +313,6 @@ virBhyveProbeCaps(unsigned int *caps)
     binary = virFindFileInPath("bhyve");
     if (binary == NULL)
         goto out;
-    if (!virFileIsExecutable(binary))
-        goto out;
 
     if ((ret = bhyveProbeCapsRTC_UTC(caps, binary)))
         goto out;
index 27180e85090b96175795df7268661b4fa2a828dd..c8488f875d67ccf033421838551ab641255cc505 100644 (file)
@@ -649,16 +649,10 @@ virQEMUCapsFindBinary(const char *format,
     char *binary = NULL;
 
     if (virAsprintf(&binary, format, archstr) < 0)
-        goto out;
+        return NULL;
 
     ret = virFindFileInPath(binary);
     VIR_FREE(binary);
-    if (ret && virFileIsExecutable(ret))
-        goto out;
-
-    VIR_FREE(ret);
-
- out:
     return ret;
 }