mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 17:15:18 +00:00
Fix error reporting in virNetDevVethDelete
In virNetDevVethDelete the virRun method will properly report errors, but when checking the exit status for non-zero exit code no error is reported Signed-off-by: Daniel P. Berrange <berrange@redhat.com> (cherry picked from commit 0584d6626b07a55ede81d7ffde9565e9a305c172)
This commit is contained in:
parent
dd35c8dadd
commit
e69aaf2f7e
@ -162,24 +162,9 @@ cleanup:
|
||||
*/
|
||||
int virNetDevVethDelete(const char *veth)
|
||||
{
|
||||
int rc;
|
||||
const char *argv[] = {"ip", "link", "del", veth, NULL};
|
||||
int cmdResult = 0;
|
||||
|
||||
VIR_DEBUG("veth: %s", veth);
|
||||
|
||||
rc = virRun(argv, &cmdResult);
|
||||
|
||||
if (rc != 0 ||
|
||||
(WIFEXITED(cmdResult) && WEXITSTATUS(cmdResult) != 0)) {
|
||||
/*
|
||||
* Prevent overwriting an error log which may be set
|
||||
* where an actual failure occurs.
|
||||
*/
|
||||
VIR_DEBUG("Failed to delete '%s' (%d)",
|
||||
veth, WEXITSTATUS(cmdResult));
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
return virRun(argv, NULL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user