-
Notifications
You must be signed in to change notification settings - Fork 58
Changing as_str into as_cstr #118
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
Changing as_str into as_cstr #118
Conversation
I'll fix the comments and also the test that are currently failing. Also, I'll add a test to validate the null terminator. |
aaf0bf1
to
a183e6e
Compare
Thanks for the review. I'm working on addressing the comments now. I'll ping you when done. |
4edddce
to
44c244c
Compare
ad0ada5
to
19621d6
Compare
19621d6
to
bdfcd3c
Compare
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.
You should also squash your commits.
bdfcd3c
to
9dc787c
Compare
9dc787c
to
b485560
Compare
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.
👍
b485560
to
9d7fe16
Compare
Changing as_str() into as_cstring() in order to retrieve a CString (which is a null terminated string) from the Cmdline struct. We found a bug introduced by the following PR: rust-vmm#72 This bug was caused by the fact that method load_cmdline() was changed to receive a Cmdline instead of a CStr. That leads to the call of the as_str() method from the Cmdline to get the representation of the kernel command line. The method as_str() from Cmdline returns a plain string from Rust that is not null terminated by default. In this commit, we kept the load_cmdline() method to receive a Cmdline but converted the as_str() method into as_cstring() that returns a null terminated string now. Signed-off-by: Traistaru Andrei Cristian <atc@amazon.com>
9d7fe16
to
ede3cbf
Compare
Changing as_str() into as_cstr() in order to retrieve a null terminated string from the Cmdline struct.
Signed-off-by: Traistaru Andrei Cristian atc@amazon.com
Summary of the PR
Please summarize here why the changes in this PR are needed.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commitmessage has max 60 characters for the summary and max 75 characters for each
description line.
test.
unsafe
code is properly documented.