mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
misc: Remove unused errors from public interface
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
30b74e74cd
commit
b8f5911c4e
@ -12,12 +12,6 @@ use std::mem;
|
|||||||
use std::result;
|
use std::result;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum Error {
|
|
||||||
GetLapic(anyhow::Error),
|
|
||||||
SetLapic(anyhow::Error),
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type Result<T> = result::Result<T, hypervisor::HypervisorCpuError>;
|
pub type Result<T> = result::Result<T, hypervisor::HypervisorCpuError>;
|
||||||
|
|
||||||
// Defines poached from apicdef.h kernel header.
|
// Defines poached from apicdef.h kernel header.
|
||||||
|
@ -122,9 +122,6 @@ unsafe impl ByteValued for BootParamsWrapper {}
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// Invalid e820 setup params.
|
|
||||||
E820Configuration,
|
|
||||||
|
|
||||||
/// Error writing MP table to memory.
|
/// Error writing MP table to memory.
|
||||||
MpTableSetup(mptable::Error),
|
MpTableSetup(mptable::Error),
|
||||||
|
|
||||||
|
@ -27,8 +27,6 @@ pub enum Error {
|
|||||||
TapSetMac(TapError),
|
TapSetMac(TapError),
|
||||||
/// Getting MAC address failed
|
/// Getting MAC address failed
|
||||||
TapGetMac(TapError),
|
TapGetMac(TapError),
|
||||||
/// Setting tap interface offload flags failed.
|
|
||||||
TapSetOffload(TapError),
|
|
||||||
/// Setting vnet header size failed.
|
/// Setting vnet header size failed.
|
||||||
TapSetVnetHdrSize(TapError),
|
TapSetVnetHdrSize(TapError),
|
||||||
/// Enabling tap interface failed.
|
/// Enabling tap interface failed.
|
||||||
|
@ -26,31 +26,20 @@ use std::process;
|
|||||||
use std::sync::{Arc, Mutex, RwLock};
|
use std::sync::{Arc, Mutex, RwLock};
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
use vhost::vhost_user::message::*;
|
use vhost::vhost_user::message::*;
|
||||||
use vhost::vhost_user::{Error as VhostUserError, Listener};
|
use vhost::vhost_user::Listener;
|
||||||
use vhost_user_backend::{VhostUserBackend, VhostUserDaemon, Vring, VringWorker};
|
use vhost_user_backend::{VhostUserBackend, VhostUserDaemon, Vring, VringWorker};
|
||||||
use virtio_bindings::bindings::virtio_net::*;
|
use virtio_bindings::bindings::virtio_net::*;
|
||||||
use virtio_bindings::bindings::virtio_ring::VIRTIO_RING_F_EVENT_IDX;
|
use virtio_bindings::bindings::virtio_ring::VIRTIO_RING_F_EVENT_IDX;
|
||||||
use vm_memory::{GuestMemoryAtomic, GuestMemoryMmap};
|
use vm_memory::{GuestMemoryAtomic, GuestMemoryMmap};
|
||||||
use vmm_sys_util::eventfd::EventFd;
|
use vmm_sys_util::eventfd::EventFd;
|
||||||
|
|
||||||
pub type VhostUserResult<T> = std::result::Result<T, VhostUserError>;
|
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
pub type VhostUserBackendResult<T> = std::result::Result<T, std::io::Error>;
|
type VhostUserBackendResult<T> = std::result::Result<T, std::io::Error>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// Failed to activate device.
|
|
||||||
BadActivate,
|
|
||||||
/// Failed to create kill eventfd
|
/// Failed to create kill eventfd
|
||||||
CreateKillEventFd(io::Error),
|
CreateKillEventFd(io::Error),
|
||||||
/// Failed to add event.
|
|
||||||
EpollCtl(io::Error),
|
|
||||||
/// Fail to wait event.
|
|
||||||
EpollWait(io::Error),
|
|
||||||
/// Failed to create EventFd.
|
|
||||||
EpollCreateFd,
|
|
||||||
/// Failed to read Tap.
|
|
||||||
FailedReadTap,
|
|
||||||
/// Failed to parse configuration string
|
/// Failed to parse configuration string
|
||||||
FailedConfigParse(OptionParserError),
|
FailedConfigParse(OptionParserError),
|
||||||
/// Failed to signal used queue.
|
/// Failed to signal used queue.
|
||||||
@ -59,12 +48,6 @@ pub enum Error {
|
|||||||
HandleEventNotEpollIn,
|
HandleEventNotEpollIn,
|
||||||
/// Failed to handle unknown event.
|
/// Failed to handle unknown event.
|
||||||
HandleEventUnknownEvent,
|
HandleEventUnknownEvent,
|
||||||
/// Invalid vring address.
|
|
||||||
InvalidVringAddr,
|
|
||||||
/// No vring call fd to notify.
|
|
||||||
NoVringCallFdNotify,
|
|
||||||
/// No memory configured.
|
|
||||||
NoMemoryConfigured,
|
|
||||||
/// Open tap device failed.
|
/// Open tap device failed.
|
||||||
OpenTap(OpenTapError),
|
OpenTap(OpenTapError),
|
||||||
/// No socket provided
|
/// No socket provided
|
||||||
|
@ -104,27 +104,11 @@ pub type DeviceEventT = u16;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
FailedReadingQueue {
|
|
||||||
event_type: &'static str,
|
|
||||||
underlying: io::Error,
|
|
||||||
},
|
|
||||||
FailedSignalingUsedQueue(io::Error),
|
FailedSignalingUsedQueue(io::Error),
|
||||||
PayloadExpected,
|
|
||||||
UnknownEvent {
|
|
||||||
device: &'static str,
|
|
||||||
event: DeviceEventT,
|
|
||||||
},
|
|
||||||
IoError(io::Error),
|
IoError(io::Error),
|
||||||
EpollCreateFd(io::Error),
|
|
||||||
EpollCtl(io::Error),
|
|
||||||
EpollWait(io::Error),
|
|
||||||
FailedSignalingDriver(io::Error),
|
|
||||||
VhostUserUpdateMemory(vhost_user::Error),
|
VhostUserUpdateMemory(vhost_user::Error),
|
||||||
VhostUserAddMemoryRegion(vhost_user::Error),
|
VhostUserAddMemoryRegion(vhost_user::Error),
|
||||||
EventfdError(io::Error),
|
|
||||||
SetShmRegionsNotSupported,
|
SetShmRegionsNotSupported,
|
||||||
EpollHander(String),
|
|
||||||
NoMemoryConfigured,
|
|
||||||
NetQueuePair(::net_util::NetQueuePairError),
|
NetQueuePair(::net_util::NetQueuePairError),
|
||||||
ApplySeccompFilter(seccomp::Error),
|
ApplySeccompFilter(seccomp::Error),
|
||||||
}
|
}
|
||||||
|
@ -7,19 +7,12 @@
|
|||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate vm_memory;
|
extern crate vm_memory;
|
||||||
|
|
||||||
use std::io;
|
|
||||||
|
|
||||||
mod bus;
|
mod bus;
|
||||||
pub mod dma_mapping;
|
pub mod dma_mapping;
|
||||||
pub mod interrupt;
|
pub mod interrupt;
|
||||||
|
|
||||||
pub use self::bus::{Bus, BusDevice, Error as BusError};
|
pub use self::bus::{Bus, BusDevice, Error as BusError};
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum Error {
|
|
||||||
IoError(io::Error),
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Type of Message Signalled Interrupt
|
/// Type of Message Signalled Interrupt
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum MsiIrqType {
|
pub enum MsiIrqType {
|
||||||
|
@ -80,13 +80,6 @@ pub enum Error {
|
|||||||
/// Cannot patch the CPU ID
|
/// Cannot patch the CPU ID
|
||||||
PatchCpuId(anyhow::Error),
|
PatchCpuId(anyhow::Error),
|
||||||
|
|
||||||
/// The call to KVM_SET_CPUID2 failed.
|
|
||||||
SetSupportedCpusFailed(anyhow::Error),
|
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
|
||||||
/// Cannot set the local interruption due to bad configuration.
|
|
||||||
LocalIntConfiguration(anyhow::Error),
|
|
||||||
|
|
||||||
/// Error configuring VCPU
|
/// Error configuring VCPU
|
||||||
VcpuConfiguration(arch::Error),
|
VcpuConfiguration(arch::Error),
|
||||||
|
|
||||||
@ -107,63 +100,6 @@ pub enum Error {
|
|||||||
/// Asking for more vCPUs that we can have
|
/// Asking for more vCPUs that we can have
|
||||||
DesiredVCpuCountExceedsMax,
|
DesiredVCpuCountExceedsMax,
|
||||||
|
|
||||||
/// Failed to get KVM vcpu lapic.
|
|
||||||
VcpuGetLapic(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu lapic.
|
|
||||||
VcpuSetLapic(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu MP state.
|
|
||||||
VcpuGetMpState(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu MP state.
|
|
||||||
VcpuSetMpState(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu msrs.
|
|
||||||
VcpuGetMsrs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu msrs.
|
|
||||||
VcpuSetMsrs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu regs.
|
|
||||||
VcpuGetRegs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu regs.
|
|
||||||
VcpuSetRegs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu sregs.
|
|
||||||
VcpuGetSregs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu sregs.
|
|
||||||
VcpuSetSregs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu events.
|
|
||||||
VcpuGetVcpuEvents(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu events.
|
|
||||||
VcpuSetVcpuEvents(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu FPU.
|
|
||||||
VcpuGetFpu(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu FPU.
|
|
||||||
VcpuSetFpu(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu XSAVE.
|
|
||||||
VcpuGetXsave(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu XSAVE.
|
|
||||||
VcpuSetXsave(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to get KVM vcpu XCRS.
|
|
||||||
VcpuGetXcrs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Failed to set KVM vcpu XCRS.
|
|
||||||
VcpuSetXcrs(anyhow::Error),
|
|
||||||
|
|
||||||
/// Error resuming vCPU on shutdown
|
|
||||||
ResumeOnShutdown(MigratableError),
|
|
||||||
|
|
||||||
/// Cannot create seccomp filter
|
/// Cannot create seccomp filter
|
||||||
CreateSeccompFilter(seccomp::SeccompError),
|
CreateSeccompFilter(seccomp::SeccompError),
|
||||||
|
|
||||||
|
@ -113,10 +113,6 @@ pub enum Error {
|
|||||||
#[error("Error rebooting VM: {0:?}")]
|
#[error("Error rebooting VM: {0:?}")]
|
||||||
VmReboot(VmError),
|
VmReboot(VmError),
|
||||||
|
|
||||||
/// Cannot shut a VM down
|
|
||||||
#[error("Error shutting down VM: {0:?}")]
|
|
||||||
VmShutdown(VmError),
|
|
||||||
|
|
||||||
/// Cannot create VMM thread
|
/// Cannot create VMM thread
|
||||||
#[error("Error spawning VMM thread {0:?}")]
|
#[error("Error spawning VMM thread {0:?}")]
|
||||||
VmmThreadSpawn(#[source] io::Error),
|
VmmThreadSpawn(#[source] io::Error),
|
||||||
@ -125,10 +121,6 @@ pub enum Error {
|
|||||||
#[error("Error shutting down VMM: {0:?}")]
|
#[error("Error shutting down VMM: {0:?}")]
|
||||||
VmmShutdown(VmError),
|
VmmShutdown(VmError),
|
||||||
|
|
||||||
// Error following "exe" link
|
|
||||||
#[error("Error following \"exe\" link: {0}")]
|
|
||||||
ExePathReadLink(#[source] io::Error),
|
|
||||||
|
|
||||||
/// Cannot create seccomp filter
|
/// Cannot create seccomp filter
|
||||||
#[error("Error creating seccomp filter: {0}")]
|
#[error("Error creating seccomp filter: {0}")]
|
||||||
CreateSeccompFilter(seccomp::SeccompError),
|
CreateSeccompFilter(seccomp::SeccompError),
|
||||||
|
@ -162,9 +162,6 @@ pub enum Error {
|
|||||||
/// Failed to allocate a memory range.
|
/// Failed to allocate a memory range.
|
||||||
MemoryRangeAllocation,
|
MemoryRangeAllocation,
|
||||||
|
|
||||||
/// Failed to create map region
|
|
||||||
MmapRegion(),
|
|
||||||
|
|
||||||
/// Error from region creation
|
/// Error from region creation
|
||||||
GuestMemoryRegion(MmapRegionError),
|
GuestMemoryRegion(MmapRegionError),
|
||||||
|
|
||||||
@ -195,10 +192,6 @@ pub enum Error {
|
|||||||
/// Cannot create the system allocator
|
/// Cannot create the system allocator
|
||||||
CreateSystemAllocator,
|
CreateSystemAllocator,
|
||||||
|
|
||||||
/// The number of external backing files doesn't match the number of
|
|
||||||
/// memory regions.
|
|
||||||
InvalidAmountExternalBackingFiles,
|
|
||||||
|
|
||||||
/// Invalid SGX EPC section size
|
/// Invalid SGX EPC section size
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
EpcSectionSizeInvalid,
|
EpcSectionSizeInvalid,
|
||||||
|
@ -132,15 +132,9 @@ pub enum Error {
|
|||||||
/// Cannot setup terminal in canonical mode.
|
/// Cannot setup terminal in canonical mode.
|
||||||
SetTerminalCanon(vmm_sys_util::errno::Error),
|
SetTerminalCanon(vmm_sys_util::errno::Error),
|
||||||
|
|
||||||
/// Failed parsing network parameters
|
|
||||||
ParseNetworkParameters,
|
|
||||||
|
|
||||||
/// Memory is overflow
|
/// Memory is overflow
|
||||||
MemOverflow,
|
MemOverflow,
|
||||||
|
|
||||||
/// Failed to allocate the IOAPIC memory range.
|
|
||||||
IoapicRangeAllocation,
|
|
||||||
|
|
||||||
/// Cannot spawn a signal handler thread
|
/// Cannot spawn a signal handler thread
|
||||||
SignalHandlerSpawn(io::Error),
|
SignalHandlerSpawn(io::Error),
|
||||||
|
|
||||||
@ -186,9 +180,6 @@ pub enum Error {
|
|||||||
/// Memory manager error
|
/// Memory manager error
|
||||||
MemoryManager(MemoryManagerError),
|
MemoryManager(MemoryManagerError),
|
||||||
|
|
||||||
/// No PCI support
|
|
||||||
NoPciSupport,
|
|
||||||
|
|
||||||
/// Eventfd write error
|
/// Eventfd write error
|
||||||
EventfdError(std::io::Error),
|
EventfdError(std::io::Error),
|
||||||
|
|
||||||
@ -225,9 +216,6 @@ pub enum Error {
|
|||||||
/// Failed resizing a memory zone.
|
/// Failed resizing a memory zone.
|
||||||
ResizeZone,
|
ResizeZone,
|
||||||
|
|
||||||
/// Failed setting the VmmOps interface.
|
|
||||||
SetVmmOpsInterface(hypervisor::HypervisorVmError),
|
|
||||||
|
|
||||||
/// Cannot activate virtio devices
|
/// Cannot activate virtio devices
|
||||||
ActivateVirtioDevices(device_manager::DeviceManagerError),
|
ActivateVirtioDevices(device_manager::DeviceManagerError),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user