virtio-devices: Version state structures

Version the state for device state for the virtio devices.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2021-05-06 13:34:31 +00:00
parent dce846fdfd
commit c400702272
13 changed files with 74 additions and 28 deletions

View File

@@ -34,6 +34,8 @@ use std::os::unix::io::AsRawFd;
use std::path::Path;
use std::result;
use std::sync::{Arc, Mutex};
use versionize::{VersionMap, Versionize, VersionizeResult};
use versionize_derive::Versionize;
use virtio_bindings::bindings::virtio_blk::*;
use vm_memory::{ByteValued, Bytes, GuestAddress, GuestMemory, GuestMemoryError, GuestMemoryMmap};
use vm_virtio::DescriptorChain;
@@ -369,7 +371,7 @@ impl Request {
}
}
#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize)]
#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize, Versionize)]
#[repr(C, packed)]
pub struct VirtioBlockConfig {
pub capacity: u64,
@@ -394,7 +396,7 @@ pub struct VirtioBlockConfig {
}
unsafe impl ByteValued for VirtioBlockConfig {}
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, Versionize)]
#[repr(C, packed)]
pub struct VirtioBlockGeometry {
pub cylinders: u16,