Re: [PATCH] Add a check attribute on the mac address element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 13, 2020 at 11:44:13AM +0200, 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@xxxxxxxxxxx>
> ---


> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
> index d4d66f6768..82035884a2 100644
> --- a/src/vmx/vmx.c
> +++ b/src/vmx/vmx.c
> @@ -3829,7 +3829,14 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
>      prefix = (def->mac.addr[0] << 16) | (def->mac.addr[1] << 8) | def->mac.addr[2];
>      suffix = (def->mac.addr[3] << 16) | (def->mac.addr[4] << 8) | def->mac.addr[5];
>  
> -    if (prefix == 0x000c29) {
> +    if (def->mac_check == VIR_TRISTATE_BOOL_NO) {
> +        virBufferAsprintf(buffer, "ethernet%d.addressType = \"static\"\n",
> +                          controller);
> +        virBufferAsprintf(buffer, "ethernet%d.address = \"%s\"\n",
> +                          controller, mac_string);
> +        virBufferAsprintf(buffer, "ethernet%d.checkMACAddress = \"false\"\n",
> +                          controller);
> +    } else if (prefix == 0x000c29) {
>          virBufferAsprintf(buffer, "ethernet%d.addressType = \"generated\"\n",
>                            controller);
>          virBufferAsprintf(buffer, "ethernet%d.generatedAddress = \"%s\"\n",

I don't think it is correct to merely add another branch to the if
at the start.  The new "check" attribute should apply to all of
the existing branches.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux