Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nmvetcli-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
Sysadmin
Archived
nmvetcli-mirror
Commits
69dad8a2
Commit
69dad8a2
authored
May 25, 2016
by
Christoph Hellwig
Browse files
Options
Downloads
Patches
Plain Diff
nvmet: small fixes and cleanups
Signed-off-by:
Christoph Hellwig
<
hch@lst.de
>
parent
3a12cbbc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nvmet/nvme.py
+8
-10
8 additions, 10 deletions
nvmet/nvme.py
with
8 additions
and
10 deletions
nvmet/nvme.py
+
8
−
10
View file @
69dad8a2
...
...
@@ -422,11 +422,6 @@ class Subsystem(CFSNode):
name
=
str
(
uuid
.
uuid4
())
return
"
%s:%s
"
%
(
prefix
,
name
)
def
_list_namespaces
(
self
):
self
.
_check_self
()
for
d
in
os
.
listdir
(
"
%s/namespaces/
"
%
self
.
_path
):
yield
Namespace
(
self
,
int
(
d
),
'
lookup
'
)
def
delete
(
self
):
'''
Recursively deletes a Subsystem object.
...
...
@@ -440,6 +435,11 @@ class Subsystem(CFSNode):
self
.
remove_allowed_host
(
h
)
super
(
Subsystem
,
self
).
delete
()
def
_list_namespaces
(
self
):
self
.
_check_self
()
for
d
in
os
.
listdir
(
"
%s/namespaces/
"
%
self
.
_path
):
yield
Namespace
(
self
,
int
(
d
),
'
lookup
'
)
namespaces
=
property
(
_list_namespaces
,
doc
=
"
Get the list of Namespaces for the Subsystem.
"
)
...
...
@@ -592,8 +592,7 @@ class Namespace(CFSNode):
class
Port
(
CFSNode
):
'''
This is an interface to a NVMe Namespace in configFS.
A Namespace is identified by its parent Subsystem and Namespace ID.
This is an interface to a NVMe Port in configFS.
'''
MAX_PORTID
=
8192
...
...
@@ -625,8 +624,7 @@ class Port(CFSNode):
def
_get_portid
(
self
):
return
self
.
_portid
portid
=
property
(
_get_portid
,
doc
=
"
Get the Port ID as an int.
"
)
portid
=
property
(
_get_portid
,
doc
=
"
Get the Port ID as an int.
"
)
def
_list_subsystems
(
self
):
return
[
os
.
path
.
basename
(
name
)
...
...
@@ -660,7 +658,7 @@ class Port(CFSNode):
'''
self
.
_check_self
()
for
s
in
self
.
subsystems
:
self
.
remove_subsystem
(
s
)
;
self
.
remove_subsystem
(
s
)
super
(
Port
,
self
).
delete
()
@classmethod
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment