]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: better error message after failure to initialize firewall backend
authorLaine Stump <laine@laine.org>
Thu, 21 May 2015 17:36:18 +0000 (13:36 -0400)
committerLaine Stump <laine@laine.org>
Fri, 22 May 2015 14:15:05 +0000 (10:15 -0400)
commita9c53462fbaee15b9aa151cbd35fe906bdda1810
tree0ca2768f183f635210b4b495c34e666fa3e66f73
parentba5566e80f95618c3bb8ac327d4a1c370539166d
util: better error message after failure to initialize firewall backend

If the firewalld backend wasn't available and libvirt decides to try
setting up a "direct" backend, it checks for the presence of iptables,
ip6tables, and ebtables. If they are not found, a message like this is logged:

  error : virFirewallValidateBackend:193 : direct firewall backend
          requested, but /usr/sbin/ip6tables is not available:
          No such file or directory

But then at a later time if an attempt is made to use the virFirewall
API, failure will be indicated with:

  error : virFirewallApply:936 : out of memory

This patch changes virFirewallApply to first check if a firewall
backend hadn't been successfully setup, and logs a slightly more
informative message in that case:

  error : virFirewallApply:940 : internal error:
          Failed to initialize a valid firewall backend

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1223876
src/util/virfirewall.c