mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Fix clippy issues under "guest_debug" feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
+9
-9
@@ -174,9 +174,9 @@ pub struct CpuState {
|
||||
unsafe impl ByteValued for CpuState {}
|
||||
|
||||
pub enum NoteDescType {
|
||||
ElfDesc = 0,
|
||||
VmmDesc = 1,
|
||||
ElfAndVmmDesc = 2,
|
||||
Elf = 0,
|
||||
Vmm = 1,
|
||||
ElfAndVmm = 2,
|
||||
}
|
||||
|
||||
// "CORE" or "QEMU"
|
||||
@@ -239,7 +239,7 @@ pub trait Elf64Writable {
|
||||
let bytes: &[u8] = elf64_ehdr.as_slice();
|
||||
coredump_file
|
||||
.write(bytes)
|
||||
.map_err(|e| GuestDebuggableError::CoredumpFile(e.into()))?;
|
||||
.map_err(GuestDebuggableError::CoredumpFile)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -264,7 +264,7 @@ pub trait Elf64Writable {
|
||||
let bytes: &[u8] = elf64_phdr.as_slice();
|
||||
coredump_file
|
||||
.write(bytes)
|
||||
.map_err(|e| GuestDebuggableError::CoredumpFile(e.into()))?;
|
||||
.map_err(GuestDebuggableError::CoredumpFile)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -292,7 +292,7 @@ pub trait Elf64Writable {
|
||||
let bytes: &[u8] = elf64_load.as_slice();
|
||||
coredump_file
|
||||
.write(bytes)
|
||||
.map_err(|e| GuestDebuggableError::CoredumpFile(e.into()))?;
|
||||
.map_err(GuestDebuggableError::CoredumpFile)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -324,9 +324,9 @@ pub trait Elf64Writable {
|
||||
self.elf_note_size(note_head_size, COREDUMP_NAME_SIZE, cpu_state_desc_size);
|
||||
|
||||
match desc_type {
|
||||
NoteDescType::ElfDesc => elf_note_size * nr_cpus,
|
||||
NoteDescType::VmmDesc => vmm_note_size * nr_cpus,
|
||||
NoteDescType::ElfAndVmmDesc => (elf_note_size + vmm_note_size) * nr_cpus,
|
||||
NoteDescType::Elf => elf_note_size * nr_cpus,
|
||||
NoteDescType::Vmm => vmm_note_size * nr_cpus,
|
||||
NoteDescType::ElfAndVmm => (elf_note_size + vmm_note_size) * nr_cpus,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user