vmm: Fix clippy issues under "guest_debug" feature

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-06-08 10:57:16 +01:00
parent 133a5a858a
commit 94fb9f817d
3 changed files with 19 additions and 19 deletions
+9 -9
View File
@@ -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,
}
}
}