[pve-devel] [PATCH 1/3] improve tap_unplug
Alexandre DERUMIER
aderumier at odiso.com
Wed May 7 14:07:40 CEST 2014
>>Why do we need this additional parameter $tapfirewall? I can't see where you use it?
>>Now you overwrite the $bridge parameter. If we do not need that parameter, it is maybe better
>>to remove it from the method signature completely? Parameter $tag is also unused?
Yes, sorry, I have forgot to remove them when rebase.
>>So maybe this should be something like:
>>sub tap_unplug {
>>my ($iface) = @_;
>>....
Yes exactly !
(I had reworked the tap_unplug,
because we can't rely on $bridge,$tag to known where the tap is plugged, as it can be fwbr or vmbr)
----- Mail original -----
De: "Dietmar Maurer" <dietmar at proxmox.com>
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com
Envoyé: Mercredi 7 Mai 2014 13:57:47
Objet: RE: [pve-devel] [PATCH 1/3] improve tap_unplug
I do not understand this patch - questions inline:
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
> data/PVE/Network.pm | 57
> +++++++++++++++++++++++++++++++++++++++++++--------
> 1 file changed, 49 insertions(+), 8 deletions(-)
>
> diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm index
> 4677bf9..fa56c8b 100644
> --- a/data/PVE/Network.pm
> +++ b/data/PVE/Network.pm
> @@ -88,17 +88,19 @@ sub tap_plug {
> }
>
> sub tap_unplug {
> - my ($iface, $bridge, $tag) = @_;> -
> - if (-d "/sys/class/net/$bridge/bridge") {
> - $bridge .= "v$tag" if $tag;
> + my ($iface, $bridge, $tag, $tapfirewall) = @_;
Why do we need this additional parameter $tapfirewall? I can't see where you use it?
> + my $path= "/sys/class/net/$iface/brport/bridge";
> + if (-l $path) {
> + $bridge = basename(readlink($path));
Now you overwrite the $bridge parameter. If we do not need that parameter, it is maybe better
to remove it from the method signature completely? Parameter $tag is also unused?
So maybe this should be something like:
sub tap_unplug {
my ($iface) = @_;
....
More information about the pve-devel
mailing list