b89c4991da
Support using nftables to setup the firewall for each virtual network, rather than iptables. The initial implementation of the nftables backend creates (almost) exactly the same ruleset as the iptables backend, determined by running the following commands on a host that has an active virtual network: iptables-save >iptables.txt iptables-restore-translate -f iptables.txt (and the similar ip6tables-save/ip6tables-restore-translate for an IPv6 network). Correctness of the new backend was checked by comparing the output of: nft list ruleset when the backend is set to iptables and when it is set to nftables. This page was used as a guide: https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables The only differences between the rules created by the nftables backed vs. the iptables backend (aside from a few inconsequential changes in display order of some chains/options) are: 1) When we add nftables rules, rather than adding them in the system-created "filter" and "nat" tables, we add them in a private table (ie only we should be using it) created by us called "libvirt" (the system-created "filter" and "nat" tables can't be used because adding any rules to those tables directly with nft will cause failure of any legacy application attempting to use iptables when it tries to list the iptables rules (e.g. "iptables -S"). (NB: in nftables only a single table is required for both nat and filter rules - the chains for each are differentiated by specifying different "hook" locations for the toplevel chain of each) 2) Since the rules that were added to allow tftp/dns/dhcp traffic from the guests to the host are unnecessary in the context of nftables, those rules aren't added. (Longer explanation: In the case of iptables, all rules were in a single table, and it was always assumed that there would be some "catch-all" REJECT rule added by "someone else" in the case that a packet didn't match any specific rules, so libvirt added these specific rules to ensure that, no matter what other rules were added by any other subsystem, the guests would still have functional tftp/dns/dhcp. For nftables though, the rules added by each subsystem are in a separate table, and in order for traffic to be accepted, it must be accepted by *all* tables, so just adding the specific rules to libvirt's table doesn't help anything (as the default for the libvirt table is ACCEPT anyway) and it just isn't practical/possible for libvirt to find *all* other tables and add rules in all of them to make sure the traffic is accepted. libvirt does this for firewalld (it creates a "libvirt" zone that allows tftp/dns/dhcp, and adds all virtual network bridges to that zone), however, so in that case no extra work is required of the sysadmin.) 3) nftables doesn't support the "checksum mangle" rule (or any equivalent functionality) that we have historically added to our iptables rules, so the nftables rules we add have nothing related to checksum mangling. (NB: The result of (3) is that if you a) have a very old guest (RHEL5 era or earlier) and b) that guest is using a virtio-net network device, and c) the virtio-net device is using vhost packet processing (the default) then DHCP on the guest will fail. You can work around this by adding <driver name='qemu'/> to the <interface> XML for the guest). There are certainly much better nftables rulesets that could be used instead of those implemented here, and everything is in place to make future changes to the rules that are used simple and free of surprises (e.g. the rules that are added have coresponding "removal" commands added to the network status so that we will always remove exactly the rules that were previously added rather than trying to remove the rules that "the current build of libvirt would have added" (which will be incorrect the first time we run a libvirt with a newly modified ruleset). For this initial implementation though, I wanted the nftables rules to be as identical to the iptables rules as possible, just to make it easier to verify that everything is working. The backend can be manually chosen using the firewall_backend setting in /etc/libvirt/network.conf. libvirtd/virtnetworkd will read this setting when it starts; if there is no explicit setting, it will check for availability of FIREWALL_BACKEND_DEFAULT_1 and then FIREWALL_BACKEND_DEFAULT_2 (which are set at build time in meson_options.txt or by adding -Dfirewall_backend_default_n=blah to the meson commandline), and use the first backend that is available (ie, that has the necessary programs installed). The standard meson_options.txt is set to check for nftables first, and then iptables. Although it should be very safe to change the default backend from iptables to nftables, that change is left for a later patch, to show how the change in default can be undone if someone really needs to do that. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Daniel P. Berrangé <berrange@redhat.com> |
||
---|---|---|
.. | ||
as.po | ||
bg.po | ||
bn_IN.po | ||
bs.po | ||
ca.po | ||
cs.po | ||
da.po | ||
de.po | ||
el.po | ||
en_GB.po | ||
es.po | ||
fi.po | ||
fr.po | ||
gu.po | ||
hi.po | ||
hr.po | ||
hu.po | ||
id.po | ||
it.po | ||
ja.po | ||
ka.po | ||
kn.po | ||
ko.po | ||
libvirt.pot | ||
LINGUAS | ||
meson.build | ||
mk.po | ||
ml.po | ||
mr.po | ||
ms.po | ||
nb.po | ||
nl.po | ||
or.po | ||
pa.po | ||
pl.po | ||
POTFILES | ||
pt_BR.po | ||
pt.po | ||
README.rst | ||
ro.po | ||
ru.po | ||
si.po | ||
sr.po | ||
sr@latin.po | ||
sv.po | ||
ta.po | ||
te.po | ||
tr.po | ||
uk.po | ||
vi.po | ||
zh_CN.po | ||
zh_TW.po |
Libvirt Message Translation
Libvirt translatable messages are maintained using the GNU Gettext tools and file formats, in combination with the Fedora Weblate web service.
https://translate.fedoraproject.org/projects/libvirt/libvirt/
Source repository
The libvirt GIT repository stores the master "libvirt.pot" file, which is to be refreshed at time of feature freeze.
The "po" files stored in GIT have source locations removed in order to cut down on storage size, by eliminating information already present in the "pot" file. All files are stored with strings sorted in alphabetical order rather than source location order, to minimize movement of strings when source locations change.
The "po" files are to be EXCLUSIVELY UPDATED by merge requests sent from the Fedora Weblate service. Other contributors MUST NEVER send changes which touch the "po" file content, as that will create merge conflicts for Weblate. IOW any bug fixes to translations should be made via the Weblate application UI.
After the "pot" file in libvirt GIT, Weblate will automatically run "msgmerge" to update the "po" files itself and send back a merge request with the changes.
Translation updates made in the Weblate Web UI will be committed to its fork of the GIT repo once a day. These commits will be submitted back to the master GIT repo via merge requests. If a merge request from Weblate is already open, commits will be added to this existing merge request. Weblate will take care of rebasing whenever changes happen in Git master. In order to avoid having to do translations merges 30 times a month, merge requests from Weblate will usually be left open until feature freeze arrives. During the freeze period, they will be accepted more promptly to ensure they make it into the new release.