]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virMdevctlList: Don't check for !output
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Aug 2023 08:08:24 +0000 (10:08 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Aug 2023 11:47:16 +0000 (13:47 +0200)
commitf3a7b3e85bcd8df2b5da4ef6b66fc2f7a11415c9
treedada7eeb1bc536297408be96d490323e1ae5a79a
parent035d5ed80c8b61a203a6f1b5dab6f9bad2fca50c
virMdevctlList: Don't check for !output

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@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
src/node_device/node_device_driver.c