]> git.proxmox.com Git - pve-common.git/blobdiff - data/PVE/INotify.pm
extrac ovs_option tag= into ovs_tag property
[pve-common.git] / data / PVE / INotify.pm
index 69248959725777edba455cca1fc8b7afb978135e..360551268efe18aaa3a229ef3cdbc348832aea64 100644 (file)
@@ -874,6 +874,8 @@ sub read_etc_network_interfaces {
                if ($d->{'bond_mode'} eq 'balance-tcp') {
                    $d->{'bond_mode'} = 'lacp-balance-tcp';
                }
+               my $tag = &$extract_ovs_option($d, 'tag');
+               $d->{ovs_tag} = $tag if defined($tag);
            } else {
                $d->{type} = 'unknown';
            }
@@ -905,6 +907,8 @@ sub read_etc_network_interfaces {
                $d->{type} = 'eth';
            } elsif ($d->{ovs_type} eq 'OVSPort') {
                $d->{type} = $d->{ovs_type};
+               my $tag = &$extract_ovs_option($d, 'tag');
+               $d->{ovs_tag} = $tag if defined($tag);
            } else {
                $d->{type} = 'unknown';
            }
@@ -915,6 +919,8 @@ sub read_etc_network_interfaces {
                $d->{type} = 'unknown';
            } elsif ($d->{ovs_type} eq 'OVSIntPort') {
                $d->{type} = $d->{ovs_type};
+               my $tag = &$extract_ovs_option($d, 'tag');
+               $d->{ovs_tag} = $tag if defined($tag);
            }
        }
 
@@ -997,6 +1003,11 @@ sub __interface_to_string {
 
        $d->{autostart} = 0; # started by the bridge
 
+       if (defined($d->{ovs_tag})) {
+           &$set_ovs_option($d, tag => $d->{ovs_tag});
+       }
+       $done->{ovs_tag} = 1;
+
        if ($d->{type} eq 'OVSBond') {
 
            $d->{bond_mode} = 'active-backup' if !$d->{bond_mode};