vmm: Allow restoring virtio-fs with no cache region

It's totally acceptable to snapshot and restore a virtio-fs device that
has no cache region, since this is a valid mode of functioning for
virtio-fs itself.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2021-07-26 15:18:11 +02:00 committed by Bo Chen
parent 0852287fee
commit 12db6e5068

View File

@ -383,8 +383,8 @@ pub enum DeviceManagerError {
/// Expected resources for virtio-pci could not be found.
MissingVirtioPciResources,
/// Expected resources for virtio-fs could not be found.
MissingVirtioFsResources,
/// Expected resources for virtio-pmem could not be found.
MissingVirtioPmemResources,
/// Missing PCI b/d/f from the DeviceNode.
MissingDeviceNodePciBdf,
@ -2173,10 +2173,6 @@ impl DeviceManager {
}
}
if cache_range.is_none() {
return Err(DeviceManagerError::MissingVirtioFsResources);
}
cache_range
} else {
None
@ -2334,7 +2330,7 @@ impl DeviceManager {
}
if region_range.is_none() {
return Err(DeviceManagerError::MissingVirtioFsResources);
return Err(DeviceManagerError::MissingVirtioPmemResources);
}
region_range