]> git.proxmox.com Git - pve-network.git/commitdiff
rename vnet "name" option to "alias"
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 4 Apr 2019 14:12:44 +0000 (16:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 5 Apr 2019 04:13:04 +0000 (06:13 +0200)
and use it with ifupdown2 alias.

PVE/Network/Network/VlanPlugin.pm
PVE/Network/Network/VnetPlugin.pm
PVE/Network/Network/VxlanMulticastPlugin.pm

index a2c029272fd3a7214303e2217cfed157cfd8076c..8b399c86be36e20d37d91c77cb76d3d14718599e 100644 (file)
@@ -61,6 +61,7 @@ sub generate_network_config {
 
     my $tag = $vnet->{tag};
     my $mtu = $vnet->{mtu};
+    my $alias = $vnet->{alias};
     my $vlanaware = $plugin_config->{'vlan-aware'};
     my $vlanprotocol = $plugin_config->{'vlan-protocol'};
     my $uplink = $plugin_config->{'uplink-id'};
@@ -92,6 +93,7 @@ sub generate_network_config {
     $config .= "        bridge_fd 0\n";
     $config .= "        bridge-vlan-aware yes \n" if $vlanaware;
     $config .= "        mtu $mtu\n" if $mtu;
+    $config .= "        alias $alias\n" if $alias;
 
     return $config;
 }
index 6ee1a3ec90919d11ef0e0dd8893b0220e73ef5a9..0b99e7e5cf6a71546b898353f6a5e207a2d5d987 100644 (file)
@@ -22,9 +22,9 @@ sub properties {
             type => 'integer',
             description => "vlan or vxlan id",
        },
-        name => {
+        alias => {
             type => 'string',
-            description => "name of the vnet",
+            description => "alias name of the vnet",
            optional => 1,
         },
         mtu => {
@@ -54,7 +54,7 @@ sub options {
     return {
         transportzone => { optional => 0},
         tag => { optional => 0},
-        name => { optional => 1 },
+        alias => { optional => 1 },
         ipv4 => { optional => 1 },
         ipv6 => { optional => 1 },
         mtu => { optional => 1 },
index ae4ec1a2ad111e5764d5f7e73050af6d6ae93954..30721ee9c6fe91db0e3c8931bb54a736214793c2 100644 (file)
@@ -48,6 +48,7 @@ sub generate_network_config {
 
     my $tag = $vnet->{tag};
     my $mtu = $vnet->{mtu};
+    my $alias = $vnet->{alias};
     my $multicastaddress = $plugin_config->{'multicast-address'};
     my $uplink = $plugin_config->{'uplink-id'};
     my $vxlanallowed = $plugin_config->{'vxlan-allowed'};
@@ -76,6 +77,7 @@ sub generate_network_config {
     $config .= "        bridge_stp off\n";
     $config .= "        bridge_fd 0\n";
     $config .= "        mtu $mtu\n" if $mtu;
+    $config .= "        alias $alias\n" if $alias;
 
     return $config;
 }