Re: [PATCHv3] replace 'if' type conditions with 'switch' for VIR_NETWORK_FORWARD_

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

 



On Wednesday, July 25, 2018 at 8:37 PM, Erik wrote:
> On Tue, Jul 24, 2018 at 11:49:48AM +0800, Shi Lei wrote:
> > Signed-off-by: Shi Lei <shilei.massclouds@xxxxxxx>
> > ---
> >
> > v2 here: https://www.redhat.com/archives/libvir-list/2018-July/msg01423.html
> > since v2:
> >  - typecast def->forward.type to virNetworkForwardType explicitly
> >   in all the switches rather than change its type to enum in
> >   the struct definition
> >
> > v1 here: https://www.redhat.com/archives/libvir-list/2018-July/msg01314.html
> > since v1:
> >  - Change the type declaration of _virNetworkForwardDef.type
> >   from int to virNetworkForwardType
> >  - use the default case to report out of range error with
> >   virReportEnumRangeError
> >
> ...
> 
> > +    if (virNetworkObjIsActive(obj)) {
> > +        switch ((virNetworkForwardType) def->forward.type) {
> > +        case VIR_NETWORK_FORWARD_NONE:
> > +        case VIR_NETWORK_FORWARD_NAT:
> > +        case VIR_NETWORK_FORWARD_ROUTE:
> > +            /* Only three of the L3 network types that are configured by
> > +             * libvirt need to have iptables rules reloaded. The 4th L3
> > +             * network type, forward='open', doesn't need this because it
> > +             * has no iptables rules.
> > +             */
> > +            networkRemoveFirewallRules(def);
> > +            /* No need to check return value since already logged internally */
> 
> I dropped ^this commentary, adjusted the commit message and pushed the patch.

Sorry, I forgot to remove this commentary.

> 
> Congratulations on your first libvirt patch.
> Erik
>
 
Thanks!
Shi Lei

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

  Powered by Linux