-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
targetcli: add portal info #149
base: main
Are you sure you want to change the base?
Conversation
drgn_tools/targetcli.py
Outdated
for portal in list_for_each_entry( | ||
"struct dentry", np_dentry.d_subdirs.address_of_(), "d_child" | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use dentry_for_each_child()
from drgn_tools/dentry.py
which handles the new changes in struct dentry
in Linux 6.8.
drgn_tools/targetcli.py
Outdated
for portal in list_for_each_entry( | ||
"struct dentry", np_dentry.d_subdirs.address_of_(), "d_child" | ||
): | ||
yield portal.d_name.name.string_().decode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the name
in this case? Is it something controlled by the user? Is it guaranteed to be ASCII? Could a user include some UTF-8 encoded non-ASCII characters?
For most stuff in the kernel we can use the above because it will generally work fine. But if it's an actual user-specified string, we need to be careful. I would suggest using escape_ascii_string()
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name here is configured by the user through targetcli tool and conforms to the format of "ip_address: portal_number", which, in this case, should be ASCII. But let's use escape_ascii_string() just to be safe:)
e06946a
to
40a8c59
Compare
@richl9 can you post an example output of iscsi and vhost with portal info? |
I have attached an example output. For vhost, it seems that it doesn't have a portal configuration like iscsi. |
Did targetcli show portals for vhost? If not, we should remove it from the code. |
Orabug: 37444641 Signed-off-by: Richard Li <[email protected]>
40a8c59
to
8c668a1
Compare
There is no portal configuration for vhost in targetcli. Just removed it. |
Add portal numbers for each tpg.
Below is an example output: