Skip to content
GitLab
Menu
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
7999e43d
Commit
7999e43d
authored
Oct 09, 2014
by
Kirk Webb
Browse files
Move vlan interface creation to vnodePreConfigExpNetwork() for blockstores.
Also fix a couple of nits.
parent
d403580d
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/freenas9/libvnode_blockstore.pm
View file @
7999e43d
...
...
@@ -296,13 +296,6 @@ sub vnodeCreate($$$$)
"
Could not get the blkalloc lock after a long time!
");
}
# Create the experimental net (tagged vlan) interface
if
(
createVlanInterface
(
$vnode_id
,
$vnconfig
)
!=
0
)
{
$cleanup
=
1
;
warn
("
*** ERROR: blockstore_vnodeCreate:
"
.
"
Failed to create experimental network interface!
");
}
# Create blockstore slice
if
(
runBlockstoreCmds
(
$vnode_id
,
$vnconfig
,
$private
)
!=
0
)
{
$cleanup
=
1
;
...
...
@@ -346,8 +339,14 @@ sub vnodePreConfigExpNetwork($$$$)
{
my
(
$vnode_id
,
$vmid
,
$vnconfig
,
$private
)
=
@_
;
# Create the experimental net (tagged vlan) interface, if not present.
return
-
1
unless
setupIPAlias
(
$vnconfig
)
==
0
;
if
(
createVlanInterface
(
$vnode_id
,
$vnconfig
)
!=
0
);
# Push this vnode's IP address onto the vlan interface.
return
-
1
if
(
setupIPAlias
(
$vnconfig
)
!=
0
);
return
0
;
}
...
...
@@ -894,15 +893,18 @@ sub getVlan($) {
return
$retval
;
}
#
# Does _any_ IPv4 address exist on a given network interface?
#
sub
addressExists
($)
{
my
(
$iface
,)
=
@_
;
my
$retval
=
0
;
my
$ifc_out
=
`
$IFCONFIG
$iface
`;
my
$ifc_out
=
`
$IFCONFIG
$iface
2>&1
`;
if
(
$?
!=
0
)
{
warn
("
*** ERROR: blockstore_addressExists:
"
.
"
Problem running ifconfig: $
?
");
$retval
=
undef
;
"
Problem running ifconfig:
$
ifc_out
");
$retval
=
0
;
}
elsif
(
$ifc_out
=~
/inet \d+\.\d+\.\d+\.\d+/
)
{
$retval
=
1
;
}
...
...
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