Re: [PATCH v2 01/14] libxl: allow only 'ethernet' and 'bridge' interfaces, allow script there

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

 



Marek Marczykowski-Górecki wrote:
> Actually only those interface types are handled correctly so reject
> others instead of ignoring settings (i.e. treating as bridge/ethernet
> anyway).
> Also allow <script/> in 'ethernet' (which should be the only
> script-allowing type). Keep <script/> allowed in bridge to be compatible
> with legacy 'xen' driver.
>
> Changes in v2:
>  - reject interfaces other than 'ethernet' or 'bridge'
>  - change title to better match patch content (was "libxl: allow script
>    for any network interface, not only bridge")
>  - update description
>   

No need to add notes about the evolution of a patch in the commit
message.  Standard practice here is to add them after the '---' using
the '--annotate' option to git send-email.

ACK to the patch though :).  I removed the notes about changes in v2 and
pushed.

Thanks!
Jim

> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> ---
>  src/libxl/libxl_conf.c | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 90d563b..b9cb61e 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -563,18 +563,20 @@ libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
>      if (VIR_STRDUP(x_nic->ifname, l_nic->ifname) < 0)
>          return -1;
>  
> -    if (l_nic->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
> -        if (VIR_STRDUP(x_nic->bridge, l_nic->data.bridge.brname) < 0)
> -            return -1;
> -        if (VIR_STRDUP(x_nic->script, l_nic->script) < 0)
> -            return -1;
> -    } else {
> -        if (l_nic->script) {
> -            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> -                           _("scripts are not supported on interfaces of type %s"),
> -                           virDomainNetTypeToString(l_nic->type));
> +    switch (l_nic->type) {
> +        case VIR_DOMAIN_NET_TYPE_BRIDGE:
> +            if (VIR_STRDUP(x_nic->bridge, l_nic->data.bridge.brname) < 0)
> +                return -1;
> +            /* fallthrough */
> +        case VIR_DOMAIN_NET_TYPE_ETHERNET:
> +            if (VIR_STRDUP(x_nic->script, l_nic->script) < 0)
> +                return -1;
> +            break;
> +        default:
> +            virReportError(VIR_ERR_INTERNAL_ERROR,
> +                    _("libxenlight does not support network device type %s"),
> +                    virDomainNetTypeToString(l_nic->type));
>              return -1;
> -        }
>      }
>  
>      return 0;
>   

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[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]