replace struct_util with ByteValued from vm-memory#26
replace struct_util with ByteValued from vm-memory#26rbradford merged 1 commit intorust-vmm:masterfrom
Conversation
serban300
left a comment
There was a problem hiding this comment.
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 <aghecen@amazon.com>
| #[cfg(feature = "elf")] | ||
| #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] |
There was a problem hiding this comment.
nit: we can have these cfgs as #[cfg(all(feature = "elf", any(target_arch = "x86", target_arch = "x86_64"))].
|
@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.