-
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:)
Orabug: 37444641 Signed-off-by: Richard Li <[email protected]>
e06946a
to
40a8c59
Compare
Add portal numbers for each tpg.