Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richl9
Copy link
Contributor

@richl9 richl9 commented Jan 28, 2025

Add portal numbers for each tpg.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 28, 2025
Comment on lines 60 to 62
for portal in list_for_each_entry(
"struct dentry", np_dentry.d_subdirs.address_of_(), "d_child"
):
Copy link
Member

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.

for portal in list_for_each_entry(
"struct dentry", np_dentry.d_subdirs.address_of_(), "d_child"
):
yield portal.d_name.name.string_().decode()
Copy link
Member

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.

Copy link
Contributor Author

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]>
@richl9 richl9 force-pushed the richard/targetcli branch from e06946a to 40a8c59 Compare February 3, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants