mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-07 21:17:55 +03:00
Libvirt native C API and daemons
d5af1e90bb
Any time the firewalld zone for an interface is set, by definition that removes it from any previous zone that it was in, so there is really no point in unsetting the zone if it's just going to be immediately set again. This is useful because when firewalld reloads its rules, 3 things happen: 1) firewalld flushes *all* firewall rules (including those added by libvirt) 2) firewalld unsets the zones for all interfaces (including those set by libvirt) 3) firewalld re-adds its own rules, and sets the zone for all the interfaces it manages 4) firewalld sends a dbus message that libvirt is watching for, and when libvirt receives that message, it reloads all of the libvirt-generated rules, and also re-sets the firewalld zone for the bridge interfaces managed by libvirt. libvirt accomplishes step 4 by a) calling networkRemoveFirewallRules(), and then b) calling networkAddFirewallRules(). But (because it is useful in other contexts) networkRemoveFirewallRules() will attempt to *unset* the zone for each bridge interface, and when firewalld receives this request, it sees that the bridge interface *has no zone* (because it was unset by firewalld in step (2) above), and thus logs an error message. There is no way for libvirt to suppress an error message that is logged by firewalld when a request to firewalld fails. But what libvirt *can* do is realize that in these cases, the firewalld zone is about to be set again anyway, and so we don't need to unset the zone. This patch handles that by adding a bool unsetZone to the arguments of networkRemoveFirewallRules(); most calls to networkRemoveFirewallRules() have unsetZone=true, but in two cases where the zone is about to be reset, networkRemoveFirewallRules() is called with unsetZone=false, which prevents the call to virFirewallDInterfaceUnsetZone() and thus avoids the unnecessary (and confusing to users!) error message that would have been logged by firewalld. Signed-off-by: Laine Stump <laine@redat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> |
||
---|---|---|
.ctags.d | ||
.github/workflows | ||
.gitlab/issue_templates | ||
build-aux | ||
ci | ||
docs | ||
examples | ||
include | ||
po | ||
scripts | ||
src | ||
subprojects | ||
tests | ||
tools | ||
.ctags | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitlab_pages_redirects | ||
.gitlab-ci.yml | ||
.gitmodules | ||
.gitpublish | ||
.mailmap | ||
AUTHORS.rst.in | ||
config.h | ||
configmake.h.in | ||
CONTRIBUTING.rst | ||
COPYING | ||
COPYING.LESSER | ||
gitdm.config | ||
libvirt-admin.pc.in | ||
libvirt-lxc.pc.in | ||
libvirt-qemu.pc.in | ||
libvirt.pc.in | ||
libvirt.spec.in | ||
meson_options.txt | ||
meson.build | ||
NEWS.rst | ||
README.rst | ||
run.in |
.. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg :target: https://gitlab.com/libvirt/libvirt/pipelines :alt: GitLab CI Build Status .. image:: https://bestpractices.coreinfrastructure.org/projects/355/badge :target: https://bestpractices.coreinfrastructure.org/projects/355 :alt: CII Best Practices .. image:: https://translate.fedoraproject.org/widgets/libvirt/-/libvirt/svg-badge.svg :target: https://translate.fedoraproject.org/engage/libvirt/ :alt: Translation status ============================== Libvirt API for virtualization ============================== Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor. For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users. Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP. Further information about the libvirt project can be found on the website: https://libvirt.org License ======= The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files ``COPYING.LESSER`` and ``COPYING`` for full license terms & conditions. Installation ============ Instructions on building and installing libvirt can be found on the website: https://libvirt.org/compiling.html Contributing ============ The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website: https://libvirt.org/contribute.html Contact ======= The libvirt project has two primary mailing lists: * users@lists.libvirt.org (**for user discussions**) * devel@lists.libvirt.org (**for development only**) Further details on contacting the project are available on the website: https://libvirt.org/contact.html