-
Notifications
You must be signed in to change notification settings - Fork 55
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
replace struct_util with ByteValued from vm-memory #26
Conversation
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.
Now there seems to be some duplicated logic, because volatile_slice::read_from()
doesn't completely replace the logic in struct_util
. It might make it safer, but it's just a building block for those helper methods.
So I wouldn't remove struct_util
. We can refactor it, but I would keep those helper functions somehow. Maybe we can use only 1 helper function instead of 2.
I'd like to work incrementally towards this: https://github.com/rust-vmm/vmm-sys-util/issues/77#issuecomment-597576916 |
Looks good. I didn't know about this. Anyway, I think there is a problem. In order to get there we need to implement
But Personally I would keep |
No, let mut ehdr: elf::Elf64_Ehdr = Default::default();
ehdr.as_bytes().read_from(0, kernel_image, ehdr.len()).map_err(|_| Error::ReadElfHeader)?; |
You're right. Sorry, I misunderstood something. |
vm-memory v0.2.0 is now published on crates.io. We should be able to replace struct_util now. |
Version bump needed should be |
@rbradford @andreeaflorescu the |
@aghecenco you just need to bump coverage |
Fixes rust-vmm#20 Signed-off-by: Alexandra Iordache <[email protected]>
#[cfg(feature = "elf")] | ||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] |
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.
nit: we can have these cfgs as #[cfg(all(feature = "elf", any(target_arch = "x86", target_arch = "x86_64"))]
.
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.
Most of these are fixed in #24
@rbradford coverage updated, PTAL |
#20, rust-vmm/vmm-sys-util#77
Even though there's more code at the moment, it will be simplified once rust-vmm/vm-memory#83 is merged and released. See https://github.com/rust-vmm/vmm-sys-util/issues/77#issuecomment-597576916 for a preview.