Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
64f2240c
Commit
64f2240c
authored
Oct 05, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug #6: correctly implement bridged mode for openvz
parent
bc3c914a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
OpenVZ.pm
PVE/OpenVZ.pm
+23
-7
CreateWizard.js
www/manager/openvz/CreateWizard.js
+5
-2
No files found.
PVE/OpenVZ.pm
View file @
64f2240c
...
@@ -371,7 +371,8 @@ sub parse_netif {
...
@@ -371,7 +371,8 @@ sub parse_netif {
}
}
}
}
if
(
$d
->
{
ifname
})
{
if
(
$d
->
{
ifname
})
{
$d
->
{
raw
}
=
$data
;
$d
->
{
mac
}
=
PVE::Tools::
random_ether_addr
()
if
!
$d
->
{
mac
};
$d
->
{
raw
}
=
print_netif
(
$d
);
$res
->
{
$d
->
{
ifname
}}
=
$d
;
$res
->
{
$d
->
{
ifname
}}
=
$d
;
}
else
{
}
else
{
return
undef
;
return
undef
;
...
@@ -381,6 +382,18 @@ sub parse_netif {
...
@@ -381,6 +382,18 @@ sub parse_netif {
return
$res
;
return
$res
;
}
}
sub
print_netif
{
my
$net
=
shift
;
my
$res
=
"
ifname=
$net
->{ifname}
";
$res
.=
"
,mac=
$net
->{mac}
"
if
$net
->
{
mac
};
$res
.=
"
,host_ifname=
$net
->{host_ifname}
"
if
$net
->
{
host_ifname
};
$res
.=
"
,host_mac=
$net
->{host_mac}
"
if
$net
->
{
host_mac
};
$res
.=
"
,bridge=
$net
->{bridge}
"
if
$net
->
{
bridge
};
return
$res
;
}
PVE::JSONSchema::
register_format
('
pve-openvz-netif
',
\&
verify_netif
);
PVE::JSONSchema::
register_format
('
pve-openvz-netif
',
\&
verify_netif
);
sub
verify_netif
{
sub
verify_netif
{
my
(
$value
,
$noerr
)
=
@_
;
my
(
$value
,
$noerr
)
=
@_
;
...
@@ -901,14 +914,17 @@ sub update_ovz_config {
...
@@ -901,14 +914,17 @@ sub update_ovz_config {
my
$newvalue
=
'';
my
$newvalue
=
'';
foreach
my
$ifname
(
sort
keys
%
$newif
)
{
foreach
my
$ifname
(
sort
keys
%
$newif
)
{
$newvalue
.=
'
;
'
if
$newvalue
;
$newvalue
.=
'
;
'
if
$newvalue
;
$newvalue
.=
$ifname
;
$newvalue
.=
$newif
->
{
$ifname
}
->
{
mac
}
?
"
,
$newif
->{
$ifname
}->{mac}
"
:
'
,
';
$newvalue
.=
print_netif
(
$newif
->
{
$ifname
});
$newvalue
.=
$newif
->
{
$ifname
}
->
{
host_ifname
}
?
"
,
$newif
->{
$ifname
}->{host_ifname}
"
:
'
,
';
$newvalue
.=
$newif
->
{
$ifname
}
->
{
host_mac
}
?
"
,
$newif
->{
$ifname
}->{host_mac}
"
:
'
,
';
my
$ifadd
=
$ifname
;
$newvalue
.=
$newif
->
{
$ifname
}
->
{
bridge
}
?
"
,
$newif
->{
$ifname
}->{bridge}
"
:
'';
$ifadd
.=
$newif
->
{
$ifname
}
->
{
mac
}
?
"
,
$newif
->{
$ifname
}->{mac}
"
:
'
,
';
$ifadd
.=
$newif
->
{
$ifname
}
->
{
host_ifname
}
?
"
,
$newif
->{
$ifname
}->{host_ifname}
"
:
'
,
';
$ifadd
.=
$newif
->
{
$ifname
}
->
{
host_mac
}
?
"
,
$newif
->{
$ifname
}->{host_mac}
"
:
'
,
';
$ifadd
.=
$newif
->
{
$ifname
}
->
{
bridge
}
?
"
,
$newif
->{
$ifname
}->{bridge}
"
:
'';
if
(
!
$ifaces
->
{
$ifname
}
||
(
$ifaces
->
{
$ifname
}
->
{
raw
}
ne
$newif
->
{
$ifname
}
->
{
raw
}))
{
if
(
!
$ifaces
->
{
$ifname
}
||
(
$ifaces
->
{
$ifname
}
->
{
raw
}
ne
$newif
->
{
$ifname
}
->
{
raw
}))
{
push
@$changes
,
'
--netif_add
',
$
newvalue
;
push
@$changes
,
'
--netif_add
',
$
ifadd
;
}
}
}
}
$veconf
->
{
netif
}
->
{
value
}
=
$newvalue
;
$veconf
->
{
netif
}
->
{
value
}
=
$newvalue
;
...
...
www/manager/openvz/CreateWizard.js
View file @
64f2240c
...
@@ -219,8 +219,11 @@ Ext.define('PVE.openvz.CreateWizard', {
...
@@ -219,8 +219,11 @@ Ext.define('PVE.openvz.CreateWizard', {
bridgesel
bridgesel
],
],
onGetValues
:
function
(
values
)
{
onGetValues
:
function
(
values
)
{
delete
values
.
networkmode
;
if
(
values
.
networkmode
===
'
bridge
'
)
{
return
values
;
return
{
netif
:
'
ifname=eth0,bridge=
'
+
values
.
bridge
};
}
else
{
return
{
ip_address
:
values
.
ip_address
};
}
}
}
},
},
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment