mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Error out on migration & snapshot if on-demand restoring
If there is an active on-demand restoration then reject any requests to migrate or snapshot this VM as the memory will not be available for the snapshot. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -201,6 +201,9 @@ pub enum Error {
|
||||
#[error("VM is currently migrating and can't be modified")]
|
||||
VmMigrating,
|
||||
|
||||
#[error("VM on-demand memory restore is still in progress")]
|
||||
VmRestoring,
|
||||
|
||||
#[error("Cannot clone EventFd")]
|
||||
EventFdClone(#[source] io::Error),
|
||||
|
||||
@@ -3041,6 +3044,10 @@ impl Vm {
|
||||
self.memory_manager.lock().unwrap().guest_memory()
|
||||
}
|
||||
|
||||
pub fn restoring(&self) -> bool {
|
||||
self.memory_manager.lock().unwrap().restoring()
|
||||
}
|
||||
|
||||
pub fn device_tree(&self) -> Arc<Mutex<DeviceTree>> {
|
||||
self.device_manager.lock().unwrap().device_tree()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user