vmm: Introduce a SerialBuffer for buffering serial output

Introduce a dynamic buffer for storing output from the serial port. The
SerialBuffer implements std::io::Write and can be used in place of the
direct output for the serial device.

The internals of the buffer is a vector that grows dynamically based on
demand up to a fixed size at which point old data will be overwritten.
Currently the buffer is only flushed upon writes.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2021-08-31 16:03:44 +01:00
parent 9a634f07cb
commit d92707afc5
3 changed files with 127 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ pub mod vm;
#[cfg(feature = "acpi")]
mod acpi;
mod serial_buffer;
type GuestMemoryMmap = vm_memory::GuestMemoryMmap<AtomicBitmap>;
type GuestRegionMmap = vm_memory::GuestRegionMmap<AtomicBitmap>;