[PATCH] Add a check attribute on the mac address element
Michal Privoznik
mprivozn at redhat.com
Mon Jul 13 11:41:44 UTC 2020
On 7/13/20 11:44 AM, Bastien Orivel wrote:
> This is only used in the ESX driver where, when set to "no", it will
> ignore all the checks libvirt does about the origin of the MAC address
> (whether or not it's in a VMWare OUI) and forward the original one to
> the ESX server telling it not to check it either.
>
> This allows keeping a deterministic MAC address which can be useful for
> licensed software which might dislike changes.
>
> Signed-off-by: Bastien Orivel <bastien.orivel at diateam.net>
> ---
> NEWS.rst | 6 ++++
> docs/drvesx.html.in | 5 ++++
> docs/schemas/domaincommon.rng | 3 ++
> src/conf/domain_conf.c | 18 +++++++++++-
> src/conf/domain_conf.h | 1 +
> src/vmx/vmx.c | 9 +++++-
> .../network-interface-mac-check.xml | 29 +++++++++++++++++++
> tests/genericxml2xmltest.c | 2 ++
> 8 files changed, 71 insertions(+), 2 deletions(-)
> create mode 100644 tests/genericxml2xmlindata/network-interface-mac-check.xml
>
> diff --git a/NEWS.rst b/NEWS.rst
> index 1928220854..ac4de4360d 100644
> --- a/NEWS.rst
> +++ b/NEWS.rst
> @@ -18,6 +18,12 @@ v6.6.0 (unreleased)
> Libvirt allows configuring ACPI Heterogeneous Memory Attribute Table to
> hint software running inside the guest on optimization.
>
> + * esx: Add a ``check`` attribute for mac addresses.
> +
> + This attribute allows (when set to ``no``) ignoring VMWare checks of the
> + MAC addresses that would generate a new one if they were in its OUI
> + (00:0c:29).
> +
> * **Improvements**
>
While you get bonus points for remembering to document this change, it
should go into a separate patch, because keeping it in a single one
usually leads to conflicts on backports.
But anyway, looking at virVMXFormatEthernet() - why don't we set all
MACs 'static'? Alternatively, we can use @mac_generated member to
determine whether the MAC address was provided by user or automagically
generated (and use static/generated addressType accrodingly)?
I mean, this attribute you are adding (the code is correct though)
should be last resort. Can you please elaborate more?
Michal
More information about the libvir-list
mailing list