[pve-devel] [PATCH common] support for udev-systemd-style physical interface names (like enp3s0)

Igor Vlasenko ivlasenko at gmail.com
Tue May 10 15:50:48 CEST 2016


On Tue, May 10, 2016 at 11:33 AM, Dietmar Maurer <dietmar at proxmox.com> wrote:
> comments inline:
>> --- a/src/PVE/Network.pm
>> +++ b/src/PVE/Network.pm
>> @@ -131,10 +131,10 @@ my $parse_tap_device_name = sub {
>>
>>      my ($vmid, $devid);
>>
>> -    if ($iface =~ m/^tap(\d+)i(\d+)$/) {
>> +    if ($iface =~ m/^tap(\d+)i(\d+(?:s\d+)?)$/) {
>
> why is this required?
>
>>      $vmid = $1;
>>      $devid = $2;
>> -    } elsif ($iface =~ m/^veth(\d+)i(\d+)$/) {
>> +    } elsif ($iface =~ m/^veth(\d+)i(\d+(?:s\d+)?)$/) {
>
> why?

You are right, what I wrote is wrong, I misunderstood this code.
so as I understand the only part required for src/PVE/Network.pm is

--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -439,7 +439,7 @@ sub activate_bridge_vlan {

     my @ifaces = ();
     my $dir = "/sys/class/net/$bridge/brif";
-    PVE::Tools::dir_glob_foreach($dir, '((eth|bond)\d+(\.\d+)?)', sub {
+    PVE::Tools::dir_glob_foreach($dir,
'((eth\d+|enp\d+s\d+|bond\d+)(\.\d+)?)', sub {
         push @ifaces, $_[0];
     });



-- 
IV



More information about the pve-devel mailing list