mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add a VmRestore command
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
39d4f817f0
commit
92c73c3b78
@@ -292,6 +292,10 @@ impl Vmm {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn vm_restore(&mut self, _source_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()
|
||||
@@ -601,6 +605,14 @@ impl Vmm {
|
||||
|
||||
sender.send(response).map_err(Error::ApiResponseSend)?;
|
||||
}
|
||||
ApiRequest::VmRestore(snapshot_data, sender) => {
|
||||
let response = self
|
||||
.vm_restore(&snapshot_data.source_url)
|
||||
.map_err(ApiError::VmRestore)
|
||||
.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