[PATCH 5/6] virMdevctlList: Don't check for !output

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

 



After 'mdevctl' was ran, its stdout is captured in @output which
is then compared against NULL and if it is NULL a negative value
is returned (to indicate error to the caller). But this is
effectively a dead code, because virCommand (specifically
virCommandProcessIO()) makes sure both stdout and stderr buffers
are properly '\0' terminated. Therefore, this can never evaluate
to true. Also, if there really is no output from 'mdevctl' (which
was handled in one of earlier commits, but let just assume it
wasn't), then we should not error out and treat such scenario as
'no mdevs defined/active'.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index ac50c96837..a59cd0875d 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1650,9 +1650,6 @@ virMdevctlList(bool defined,
         return -1;
     }
 
-    if (!output)
-        return -1;
-
     return nodeDeviceParseMdevctlJSON(output, devs);
 }
 
-- 
2.41.0




[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