[pve-devel] [PATCH pve-network 1/2] rename vnet "name" option to "alias"
Alexandre Derumier
aderumier at odiso.com
Thu Apr 4 16:12:44 CEST 2019
and use it with ifupdown2 alias.
---
PVE/Network/Network/VlanPlugin.pm | 2 ++
PVE/Network/Network/VnetPlugin.pm | 6 +++---
PVE/Network/Network/VxlanMulticastPlugin.pm | 2 ++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/PVE/Network/Network/VlanPlugin.pm b/PVE/Network/Network/VlanPlugin.pm
index a2c0292..8b399c8 100644
--- a/PVE/Network/Network/VlanPlugin.pm
+++ b/PVE/Network/Network/VlanPlugin.pm
@@ -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;
}
diff --git a/PVE/Network/Network/VnetPlugin.pm b/PVE/Network/Network/VnetPlugin.pm
index 6ee1a3e..0b99e7e 100644
--- a/PVE/Network/Network/VnetPlugin.pm
+++ b/PVE/Network/Network/VnetPlugin.pm
@@ -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 },
diff --git a/PVE/Network/Network/VxlanMulticastPlugin.pm b/PVE/Network/Network/VxlanMulticastPlugin.pm
index ae4ec1a..30721ee 100644
--- a/PVE/Network/Network/VxlanMulticastPlugin.pm
+++ b/PVE/Network/Network/VxlanMulticastPlugin.pm
@@ -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;
}
--
2.11.0
More information about the pve-devel
mailing list