mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Simplify device state to support Versionize
In order to support using Versionize for state structures it is necessary to use simpler, primitive, data types in the state definitions used for snapshot restore. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -282,7 +282,7 @@ pub struct ConsoleState {
|
||||
avail_features: u64,
|
||||
acked_features: u64,
|
||||
config: VirtioConsoleConfig,
|
||||
in_buffer: VecDeque<u8>,
|
||||
in_buffer: Vec<u8>,
|
||||
}
|
||||
|
||||
impl Console {
|
||||
@@ -337,7 +337,7 @@ impl Console {
|
||||
avail_features: self.common.avail_features,
|
||||
acked_features: self.common.acked_features,
|
||||
config: *(self.config.lock().unwrap()),
|
||||
in_buffer: self.input.in_buffer.lock().unwrap().clone(),
|
||||
in_buffer: self.input.in_buffer.lock().unwrap().clone().into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ impl Console {
|
||||
self.common.avail_features = state.avail_features;
|
||||
self.common.acked_features = state.acked_features;
|
||||
*(self.config.lock().unwrap()) = state.config;
|
||||
*(self.input.in_buffer.lock().unwrap()) = state.in_buffer.clone();
|
||||
*(self.input.in_buffer.lock().unwrap()) = state.in_buffer.clone().into();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user