Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
6498e1ef
Commit
6498e1ef
authored
Jan 22, 2014
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for and disallow attempts to RW map a lease in the 'grace' state.
parent
59b1c489
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
tbsetup/libvtop_test.pm.in
tbsetup/libvtop_test.pm.in
+24
-1
No files found.
tbsetup/libvtop_test.pm.in
View file @
6498e1ef
...
...
@@ -1613,6 +1613,19 @@ sub LoadVirtNodes($)
$
self
->{
'COUNTERS'
}->{
'bstorecount'
}++;
}
#
#
Make
a
quick
pass
of
the
virt_blockstores
looking
for
RO
attributes
.
#
We
do
this
before
we
make
the
main
pass
below
so
that
we
have
this
#
info
available
when
we
lookup
a
lease
.
#
my
%
roleases
=
();
foreach
my
$
virt_bs_attr
($
self
->
virt_blockstore_attributes
()->
Rows
())
{
if
($
virt_bs_attr
->
attrkey
()
eq
"readonly"
)
{
$
roleases
{$
virt_bs_attr
->
vname
()}
=
$
virt_bs_attr
->
attrvalue
();
}
}
foreach
my
$
virt_bs_attr
($
self
->
virt_blockstore_attributes
()->
Rows
())
{
my
$
vname
=
$
virt_bs_attr
->
vname
();
my
$
attrkey
=
$
virt_bs_attr
->
attrkey
();
...
...
@@ -1624,7 +1637,12 @@ sub LoadVirtNodes($)
#
attribute
)
then
make
sure
the
user
/
pid
have
access
to
the
lease
#
and
that
the
associated
blockstore
is
not
already
mapped
.
#
If
it
is
currently
in
use
,
the
remaining
capacity
will
be
zero
.
#
Note
:
we
do
not
make
this
check
during
a
pre
-
assign
pass
.
#
#
We
also
check
and
make
sure
that
leases
in
the
grace
state
are
#
only
mounted
RO
.
We
make
this
check
in
the
parser
as
well
,
but
#
the
state
of
the
lease
can
change
between
parses
.
#
#
Note
:
we
do
not
make
these
checks
during
a
pre
-
assign
pass
.
#
if
($
attrkey
eq
"lease"
&&
!$self->preassign()) {
my
$
lease
=
Lease
->
Lookup
($
attrval
);
...
...
@@ -1641,6 +1659,11 @@ sub LoadVirtNodes($)
tberror
(
"Persistent blockstore $vname is already in use.
\n
"
);
return
-
1
;
}
if
($
lease
->
state
()
eq
LEASE_STATE_GRACE
()
&&
(
!exists($roleases{$vname}) || $roleases{$vname} == 0)) {
tberror
(
"Persistent blockstore $vname in grace period, must specify '\$$vname set-readonly 1' in NS file.
\n
"
);
return
-
1
;
}
}
#
Skip
any
blockstores
that
don
't have a corresponding entry in the
...
...
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