Skip to main content

QmpClient

Struct QmpClient 

Source
pub struct QmpClient { /* private fields */ }
Expand description

A negotiated connection to a local QEMU QMP endpoint.

Implementations§

Source§

impl QmpClient

Source

pub fn connect(path: &Path) -> Result<Self>

Connect, validate the greeting, and enter command mode.

Source

pub fn query_status(&mut self) -> Result<String>

Return QEMU’s current run state.

Source

pub fn query_name(&mut self) -> Result<String>

Return the configured QEMU guest name.

Source

pub fn system_powerdown(&mut self) -> Result<()>

Ask the guest to perform an ACPI shutdown.

Source

pub fn resume_if_paused(&mut self) -> Result<()>

Resume a guest stopped through QMP before asking it to handle ACPI power-off.

Source

pub fn pause(&mut self) -> Result<()>

Pause all guest virtual CPUs.

Source

pub fn resume(&mut self) -> Result<()>

Resume paused guest virtual CPUs.

Source

pub fn reset(&mut self) -> Result<()>

Reset the guest machine without restarting QEMU.

Source

pub fn query_balloon(&mut self) -> Result<u64>

Return the guest-reported current memory size in bytes.

Source

pub fn set_balloon(&mut self, bytes: u64) -> Result<()>

Request a new guest memory target in bytes.

Source

pub fn screendump(&mut self, path: &Path) -> Result<()>

Write the current guest display to a binary PPM file.

Source

pub fn quit(&mut self) -> Result<()>

Ask QEMU to exit immediately.

Auto Trait Implementations§

§

impl Forget for QmpClient

§

impl Freeze for QmpClient
where *const [MaybeUninit<u8>] is !null: Freeze, PhantomData<[MaybeUninit<u8>]>: Freeze, I32NotAllOnes: Freeze,

§

impl Move for QmpClient

§

impl RefUnwindSafe for QmpClient
where I32NotAllOnes: RefUnwindSafe,

§

impl Send for QmpClient
where BoxRaw<[MaybeUninit<u8>]>: Send, I32NotAllOnes: Send,

§

impl Sync for QmpClient
where BoxRaw<[MaybeUninit<u8>]>: Sync, I32NotAllOnes: Sync,

§

impl Unpin for QmpClient
where Box<[MaybeUninit<u8>]>: Unpin, I32NotAllOnes: Unpin,

§

impl UnsafeUnpin for QmpClient

§

impl UnwindSafe for QmpClient
where BoxRaw<[MaybeUninit<u8>]>: UnwindSafe, I32NotAllOnes: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.