From 5bc033e293ab85e7da62d8a6523d17ac36919126 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 19 Nov 2014 16:18:55 -0700 Subject: [PATCH] util: don't log failure when older iptables lacks -w Commit dc33e6e4 caused older platforms like Fedora 20 to emit scary log messages at startup: 2014-11-19 23:12:58.800+0000: 28906: error : virCommandWait:2532 : internal error: Child process (/usr/sbin/iptables -w -L -n) unexpected exit status 2: iptables v1.4.19.1: unknown option "-w" Try `iptables -h' or 'iptables --help' for more information. Since we are probing and expect to handle the case where -w is not supported, we should not let virCommand log it as an error. * src/util/virfirewall.c (virFirewallCheckUpdateLock): Handle non-zero status ourselves. Signed-off-by: Eric Blake --- src/util/virfirewall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index e82fdc3b03..8496062c3b 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -112,8 +112,9 @@ static void virFirewallCheckUpdateLock(bool *lockflag, const char *const*args) { + int status; /* Ignore failed commands without logging them */ virCommandPtr cmd = virCommandNewArgs(args); - if (virCommandRun(cmd, NULL) < 0) { + if (virCommandRun(cmd, &status) < 0 || status) { VIR_INFO("locking not supported by %s", args[0]); } else { VIR_INFO("using locking for %s", args[0]); -- GitLab