Skip to content

Commit

Permalink
Merge branch 'main' into serial
Browse files Browse the repository at this point in the history
  • Loading branch information
alxiord authored Jul 25, 2024
2 parents 85c74e1 + 01a164c commit 22b667a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Add the list of code owners here (using their GitHub username)
* @andreeaflorescu @lauralt @gsserge @roypat @JonathanWoollett-Light
* @andreeaflorescu @lauralt @gsserge @roypat @ShadowCurse
2 changes: 1 addition & 1 deletion rust-vmm-ci
Submodule rust-vmm-ci updated 1 files
+1 −1 CODEOWNERS
14 changes: 14 additions & 0 deletions vm-superio/src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
//! This is done by emulating an UART serial port.

use std::collections::VecDeque;
use std::error::Error as StdError;
use std::fmt;
use std::io::{self, Write};
use std::result::Result;
use std::sync::Arc;
Expand Down Expand Up @@ -292,6 +294,18 @@ pub enum Error<E> {
FullFifo,
}

impl<E: fmt::Display> fmt::Display for Error<E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Trigger(e) => write!(f, "Failed to trigger interrupt: {}", e),
Error::IOError(e) => write!(f, "Couldn't write/flush to the given destination: {}", e),
Error::FullFifo => write!(f, "No space left in FIFO"),
}
}
}

impl<E: StdError> StdError for Error<E> {}

impl<T: Trigger, W: Write> Serial<T, NoEvents, W> {
/// Creates a new `Serial` instance which writes the guest's output to
/// `out` and uses `trigger` object to notify the driver about new
Expand Down

0 comments on commit 22b667a

Please sign in to comment.