mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Daniel P. Berrangé
6d3cb071b4
vmx: fix logic handling mac address type
With the current formatter, the XML snippets: <interface type='bridge'> <mac address='00:0c:29:dd:ee:fe' type='static'/> <source bridge='br1'/> </interface> <interface type='bridge'> <mac address='aa:bb:cc:dd:ee:fd' type='generated'/> <source bridge='br2'/> </interface> result in ethernet1.present = "true" ethernet1.networkName = "br1" ethernet1.connectionType = "bridged" ethernet1.addressType = "static" ethernet1.address = "00:0c:29:dd:ee:fe" ethernet1.checkMACAddress = "false" ethernet2.present = "true" ethernet2.networkName = "br2" ethernet2.connectionType = "bridged" ethernet2.addressType = "static" ethernet2.address = "aa:bb:cc:dd:ee:fd" ethernet2.checkMACAddress = "false" which is flawed, as both type='static' and type='generated' in the XML turn into 'static' in the VMX config. The existence of the 'static' attribute is further overriding whether the checkMACAddress config option is set as a side effect. Both these pieces of flawed logic were introduced in commit 454e5961abf40c14f8b6d7ee216229e68fd170bf Author: Bastien Orivel <bastien.orivel@diateam.net> Date: Mon Jul 13 16:28:53 2020 +0200 Add a type attribute on the mac address element which intentionally added the 'checkMACAddress' side effect based on the 'type' attribute. With this change, we're reverting the handling of checkMACAddress to match what existed historically. The 'type' attribute now directly maps to the addressType attribute, so the above config becomes: ethernet1.present = "true" ethernet1.networkName = "br1" ethernet1.connectionType = "bridged" ethernet1.addressType = "static" ethernet1.address = "00:0c:29:dd:ee:fe" ethernet2.present = "true" ethernet2.networkName = "br2" ethernet2.connectionType = "bridged" ethernet2.addressType = "generated" ethernet2.generatedAddress = "aa:bb:cc:dd:ee:fd" ethernet2.generatedAddressOffset = "0" Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
.. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg :target: https://gitlab.com/libvirt/libvirt/pipelines :alt: GitLab CI Build Status .. image:: https://travis-ci.org/libvirt/libvirt.svg :target: https://travis-ci.org/libvirt/libvirt :alt: Travis 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: * libvirt-users@redhat.com (**for user discussions**) * libvir-list@redhat.com (**for development only**) Further details on contacting the project are available on the website: https://libvirt.org/contact.html
Description
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.
Languages
C
94.8%
Python
2%
Meson
0.9%
Shell
0.8%
Dockerfile
0.6%
Other
0.8%