mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Add a Snapshot command
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
452475c280
commit
cf8f8ce93a
@@ -288,6 +288,10 @@ impl Vmm {
|
||||
}
|
||||
}
|
||||
|
||||
fn vm_snapshot(&mut self, _destination_url: &str) -> result::Result<(), VmError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn vm_shutdown(&mut self) -> result::Result<(), VmError> {
|
||||
if let Some(ref mut vm) = self.vm.take() {
|
||||
vm.shutdown()
|
||||
@@ -589,6 +593,14 @@ impl Vmm {
|
||||
|
||||
sender.send(response).map_err(Error::ApiResponseSend)?;
|
||||
}
|
||||
ApiRequest::VmSnapshot(snapshot_data, sender) => {
|
||||
let response = self
|
||||
.vm_snapshot(&snapshot_data.destination_url)
|
||||
.map_err(ApiError::VmSnapshot)
|
||||
.map(|_| ApiResponsePayload::Empty);
|
||||
|
||||
sender.send(response).map_err(Error::ApiResponseSend)?;
|
||||
}
|
||||
ApiRequest::VmmShutdown(sender) => {
|
||||
let response = self
|
||||
.vmm_shutdown()
|
||||
|
||||
Reference in New Issue
Block a user