Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/hyperlight_host/src/hypervisor/crashdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ const CORE_DUMP_PAGE_SIZE: usize = 0x1000;
/// Structure to hold the crash dump context
/// This structure contains the information needed to create a core dump
#[derive(Debug)]
pub(crate) struct CrashDumpContext<'a> {
regions: &'a [MemoryRegion],
pub(crate) struct CrashDumpContext {
regions: Vec<MemoryRegion>,
regs: [u64; 27],
xsave: Vec<u8>,
entry: u64,
binary: Option<String>,
filename: Option<String>,
}

impl<'a> CrashDumpContext<'a> {
impl CrashDumpContext {
pub(crate) fn new(
regions: &'a [MemoryRegion],
regions: Vec<MemoryRegion>,
regs: [u64; 27],
xsave: Vec<u8>,
entry: u64,
Expand Down Expand Up @@ -208,7 +208,7 @@ struct GuestMemReader {
impl GuestMemReader {
fn new(ctx: &CrashDumpContext) -> Self {
Self {
regions: ctx.regions.to_vec(),
regions: ctx.regions.clone(),
}
}
}
Expand Down Expand Up @@ -440,7 +440,7 @@ mod test {
fn test_crashdump_write_fails_when_no_regions() {
// Create a dummy context
let ctx = CrashDumpContext::new(
&[],
vec![],
[0; 27],
vec![],
0,
Expand Down Expand Up @@ -471,7 +471,7 @@ mod test {
}];
// Create a dummy context
let ctx = CrashDumpContext::new(
&regions,
regions,
[0; 27],
vec![],
0x1000,
Expand Down
Loading
Loading