Skip to content

Commit 76d9095

Browse files
committed
fix: delete never constructed error enum variants
All of these were dead code (but the compiler isn't able to tell us because the vmm crate is a library crate where everything is `pub`, and it doesn't know that no downstream users outside of the `firecracker` crate exist, and that everything that's not used in `firecracker` is dead code). Signed-off-by: Patrick Roy <[email protected]>
1 parent f9269aa commit 76d9095

File tree

4 files changed

+0
-23
lines changed

4 files changed

+0
-23
lines changed

src/vmm/src/persist.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,10 @@ pub struct GuestRegionUffdMapping {
114114
/// Errors related to saving and restoring Microvm state.
115115
#[derive(Debug, thiserror::Error, displaydoc::Display)]
116116
pub enum MicrovmStateError {
117-
/// Compatibility checks failed: {0}
118-
IncompatibleState(String),
119-
/// Provided MicroVM state is invalid.
120-
InvalidInput,
121117
/// Operation not allowed: {0}
122118
NotAllowed(String),
123119
/// Cannot restore devices: {0}
124120
RestoreDevices(DevicePersistError),
125-
/// Cannot restore Vcpu state: {0}
126-
RestoreVcpuState(vstate::vcpu::VcpuError),
127-
/// Cannot restore Vm state: {0}
128-
RestoreVmState(vstate::vm::VmError),
129121
/// Cannot save Vcpu state: {0}
130122
SaveVcpuState(vstate::vcpu::VcpuError),
131123
/// Cannot save Vm state: {0}
@@ -142,9 +134,6 @@ pub enum MicrovmStateError {
142134
pub enum CreateSnapshotError {
143135
/// Cannot get dirty bitmap: {0}
144136
DirtyBitmap(VmmError),
145-
#[rustfmt::skip]
146-
/// Cannot translate microVM version to snapshot data version
147-
UnsupportedVersion,
148137
/// Cannot write memory file: {0}
149138
Memory(MemoryError),
150139
/// Cannot perform {0} on the memory backing file: {1}
@@ -155,8 +144,6 @@ pub enum CreateSnapshotError {
155144
SerializeMicrovmState(crate::snapshot::SnapshotError),
156145
/// Cannot perform {0} on the snapshot backing file: {1}
157146
SnapshotBackingFile(&'static str, io::Error),
158-
/// Size mismatch when writing diff snapshot on top of base layer: base layer size is {0} but diff layer is size {1}.
159-
SnapshotBackingFileLengthMismatch(u64, u64),
160147
}
161148

162149
/// Snapshot version

src/vmm/src/vstate/memory.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ pub type GuestMmapRegion = vm_memory::MmapRegion<Option<AtomicBitmap>>;
3636
/// Errors associated with dumping guest memory to file.
3737
#[derive(Debug, thiserror::Error, displaydoc::Display)]
3838
pub enum MemoryError {
39-
/// Cannot create memory: {0}
40-
CreateMemory(VmMemoryError),
41-
/// Cannot create memory region: {0}
42-
CreateRegion(MmapRegionError),
4339
/// Cannot fetch system's page size: {0}
4440
PageSize(errno::Error),
4541
/// Cannot dump memory: {0}

src/vmm/src/vstate/vm/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ pub enum VmError {
3232
SetUserMemoryRegion(kvm_ioctls::Error),
3333
/// Cannot open the VM file descriptor: {0}
3434
VmFd(kvm_ioctls::Error),
35-
/// Cannot configure the microvm: {0}
36-
VmSetup(kvm_ioctls::Error),
3735
/// {0}
3836
Arch(#[from] ArchVmError),
3937
/// Error during eventfd operations: {0}

src/vmm/src/vstate/vm/x86_64.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ pub enum ArchVmError {
3535
VmGetClock(kvm_ioctls::Error),
3636
/// Failed to get KVM vm irqchip: {0}
3737
VmGetIrqChip(kvm_ioctls::Error),
38-
/// Failed to set KVM vm pit state: {0}
39-
VmSetPit2(kvm_ioctls::Error),
40-
/// Failed to set KVM vm clock: {0}
41-
VmSetClock(kvm_ioctls::Error),
4238
/// Failed to set KVM vm irqchip: {0}
4339
VmSetIrqChip(kvm_ioctls::Error),
4440
/// Failed to get MSR index list to save into snapshots: {0}

0 commit comments

Comments
 (0)