Skip to main content

VirtualGuest

Struct VirtualGuest 

Source
pub struct VirtualGuest {
    pub install_ms: u64,
}
Expand description

The guest as a state machine, for the runs that are not about the guest.

It does not boot anything, and it says so in its name. Its whole value is that the 100 000-run storm is about the API and the money, and paying ten seconds of real qemu per iteration would make the storm a three-week job. The outcomes it produces are the ones the real engine produces, in the same proportions, drawn from the run’s seed.

Fields§

§install_ms: u64

Trait Implementations§

Source§

impl Default for VirtualGuest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl GuestEngine for VirtualGuest

Source§

fn name(&self) -> &'static str

Source§

fn boot(&self, spec: &GuestSpec) -> GuestOutcome

Source§

fn power_on(&self, _machine: &Machine) -> Result<(), String>

Power the machine on: create any disk that does not exist yet, sized from its storage record, grow any that is smaller, and boot. An Err is a refusal by name, and the estate reports the server stopped — a server whose machine never started must not read started.
Source§

fn power_off(&self, _server: &str, _hard: bool)

hard: kill it now. Soft: press the ACPI power button and return.
Source§

fn running(&self, _server: &str) -> Option<bool>

Some(true) a machine is running for this server, Some(false) one was started and is gone (it powered itself off, or died), None this engine has never run one — the estate’s own state machine then stands.
Source§

fn eject(&self, _server: &str)

Take the medium out of a running (or stopped) machine’s tray.
Source§

fn console(&self, _server: &str) -> Option<(String, u16)>

Where the server’s console REALLY listens — a loopback host and port for a real guest’s VNC. None (the default) leaves the estate’s RFC 2606 <zone>.vnc.mock.invalid.
Source§

fn load(&self, _server: &str, _storage: &str)

Put the medium of storage into the server’s tray (cdrom/load). A running machine gets it live; a stopped one reads it at the next power-on either way, because Machine::medium is built from the device row.
Source§

fn resize_disk(&self, _storage: &str, _size_gib: u64) -> Result<(), String>

A storage’s size record grew. The engine grows the disk only while no running machine has it open, and otherwise at the next power-on.
Source§

fn store_medium(&self, _storage: &str, _bytes: &[u8]) -> Result<(), String>

The bytes an upload session received, kept as that storage’s medium.
Source§

fn forget_server(&self, _server: &str)

The server is being deleted: kill its machine and drop its records.
Source§

fn forget_storage(&self, _storage: &str)

The storage is gone from the account: delete its disk and medium.
Source§

fn forget_all(&self)

The whole estate is being replaced (/mock/seed): every machine and every disk goes with it, because nothing can refer to them any more.
Source§

fn evidence(&self, _server: &str) -> Option<Value>

What the machine left behind, for /mock/guest/{uuid}: argv, frame hashes, stdout bytes, disk sizes. None from an engine with no machines.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.