Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
61183a40
Commit
61183a40
authored
Mar 12, 2014
by
Leigh B Stoller
Browse files
Be sure to disable openflow on vlans during teardown, since
there is no way to delete the controller/listener stuff.
parent
5dcc4cc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/snmpit_test/snmpit_test.in
View file @
61183a40
...
...
@@ -1966,7 +1966,7 @@ sub doVlansFromTables($$@) {
#
# A much more right place for the openflow settings is CreateOneVlan,
# however, it is called by sync vlan function and others, which don't destroy
# the existing
v
lan_a
rrt
ibutes rows.
# the existing lan_a
ttr
ibutes rows.
#
# TODO: Move this part to CreateOneVlan and Make sure the existed
# vlan_attributes rows are deleted
...
...
@@ -1974,19 +1974,18 @@ sub doVlansFromTables($$@) {
my
$ofenabled
;
$vlan
->
GetAttribute
("
ofenabled
",
\
$ofenabled
);
if
(
defined
(
$ofenabled
)
&&
$ofenabled
==
1
)
{
$errors
+=
doOpenflowEnable
(
$stacks
,
$vlanid
);
my
$ofcontroller
;
$vlan
->
GetAttribute
("
ofcontroller
",
\
$ofcontroller
);
if
(
defined
(
$ofcontroller
)
&&
$ofcontroller
ne
"")
{
$errors
+=
doSetOpenflowController
(
$stacks
,
$vlanid
,
$ofcontroller
);
$errors
+=
doSetOpenflowController
(
$stacks
,
$vlanid
,
$ofcontroller
);
}
$errors
+=
doEnableOpenflowListener
(
$stacks
,
$vlanid
);
$errors
+=
doOpenflowEnable
(
$stacks
,
$vlanid
);
# doEnableOpenflowListener updates the lan_arrtibutes table,
so vlan
# should refresh itself. But here vlan will not be
used any more, so
# maybe we can comment this refresh.
# doEnableOpenflowListener updates the lan_arrtibutes table,
#
so vlan
should refresh itself. But here vlan will not be
#
used any more, so
maybe we can comment this refresh.
$vlan
->
Refresh
();
}
...
...
@@ -2036,8 +2035,8 @@ sub doVlansFromTables($$@) {
# Set openflow
#
# A much more right place for the openflow settings is CreateOneVlan,
# however, it is called by sync vlan function and others, which
don't destroy
# the existing
v
lan_a
rrt
ibutes rows.
# however, it is called by sync vlan function and others, which
\
#
don't destroy
the existing lan_a
ttr
ibutes rows.
#
# TODO: Move this part to CreateOneVlan and Make sure the existed
# vlan_attributes rows are deleted
...
...
@@ -2045,19 +2044,17 @@ sub doVlansFromTables($$@) {
my
$ofenabled
;
$vlan
->
GetAttribute
("
ofenabled
",
\
$ofenabled
);
if
(
defined
(
$ofenabled
)
&&
$ofenabled
==
1
)
{
$errors
+=
doOpenflowEnable
(
$stacks
,
$vlanid
);
my
$ofcontroller
;
$vlan
->
GetAttribute
("
ofcontroller
",
\
$ofcontroller
);
if
(
defined
(
$ofcontroller
)
&&
$ofcontroller
ne
"")
{
$errors
+=
doSetOpenflowController
(
$stacks
,
$vlanid
,
$ofcontroller
);
}
$errors
+=
doEnableOpenflowListener
(
$stacks
,
$vlanid
);
$errors
+=
doOpenflowEnable
(
$stacks
,
$vlanid
);
# doEnableOpenflowListener updates the lan_a
rrt
ibutes table, so
vlan
# should refresh itself. But here vlan will not be
used any more, so
# maybe we can comment this refresh.
# doEnableOpenflowListener updates the lan_a
ttr
ibutes table, so
#
vlan
should refresh itself. But here vlan will not be
#
used any more, so
maybe we can comment this refresh.
$vlan
->
Refresh
();
}
}
...
...
@@ -2218,6 +2215,19 @@ sub doReset($@) {
# In case of error, do not clear the DB state.
my
%notdeleted
=
();
# Get a list of openflow enabled vlans we have to undo.
my
%ofenabled
=
();
foreach
my
$vlan_id
(
@vlans
)
{
my
$vlan
=
VLan
->
Lookup
(
$vlan_id
);
my
$flag
;
$vlan
->
GetAttribute
("
ofenabled
",
\
$flag
);
if
(
defined
(
$flag
)
&&
$flag
==
1
)
{
$ofenabled
{"
$vlan_id
"}
=
1
;
}
}
$debug
=
1
;
#
...
...
@@ -2263,6 +2273,15 @@ sub doReset($@) {
# $stack->FlipDebug(1);
my
@existant_vlans
=
$stack
->
existantVlans
(
@vlans
);
#
# Disable openflow if needed.
#
foreach
my
$vlan_id
(
@existant_vlans
)
{
if
(
exists
(
$ofenabled
{"
$vlan_id
"}))
{
$errors
+=
doOpenflowDisable
(
$stacks
,
$vlan_id
);
}
}
if
(
!
$stack
->
removeVlan
(
@existant_vlans
))
{
#
# Find out what still exists so that we keep the DB state.
...
...
@@ -3927,6 +3946,7 @@ sub doOpenflowDisable($$) {
print
"
Disabling Openflow on VLAN
$vlan
...
\n
"
if
(
!
$quiet
);
foreach
my
$stack
(
@$stacks
)
{
$stack
->
FlipDebug
(
1
);
$errors
+=
$stack
->
disableOpenflow
(
$vlan
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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