From bd724fc3044a0a0371c323f8653d8ec90db33355 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 11 May 2021 14:02:43 +0000 Subject: [PATCH] virtio-devices: Stop deriving unnecessary traits These structs only need to derive Versionize now. Signed-off-by: Rob Bradford --- virtio-devices/src/block.rs | 2 +- virtio-devices/src/console.rs | 4 ++-- virtio-devices/src/iommu.rs | 4 ++-- virtio-devices/src/net.rs | 2 +- virtio-devices/src/net_util.rs | 2 +- virtio-devices/src/pmem.rs | 4 ++-- virtio-devices/src/rng.rs | 2 +- virtio-devices/src/watchdog.rs | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index e0d542da1..ed30464ab 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -366,7 +366,7 @@ pub struct Block { rate_limiter_config: Option, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct BlockState { pub disk_path: String, pub disk_nsectors: u64, diff --git a/virtio-devices/src/console.rs b/virtio-devices/src/console.rs index b6dab89dd..5a86db40b 100644 --- a/virtio-devices/src/console.rs +++ b/virtio-devices/src/console.rs @@ -43,7 +43,7 @@ const CONFIG_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 4; //Console size feature bit const VIRTIO_CONSOLE_F_SIZE: u64 = 0; -#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize, Versionize)] +#[derive(Copy, Clone, Debug, Default, Versionize)] #[repr(C, packed)] pub struct VirtioConsoleConfig { cols: u16, @@ -280,7 +280,7 @@ pub struct Console { seccomp_action: SeccompAction, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct ConsoleState { avail_features: u64, acked_features: u64, diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index ff1499f13..de553a1f7 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -693,7 +693,7 @@ impl EpollHelperHandler for IommuEpollHandler { } } -#[derive(Clone, Copy, Serialize, Deserialize, Versionize)] +#[derive(Clone, Copy, Versionize)] struct Mapping { gpa: u64, size: u64, @@ -741,7 +741,7 @@ pub struct Iommu { seccomp_action: SeccompAction, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] struct IommuState { avail_features: u64, acked_features: u64, diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index 72e78ee40..1e285a722 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -296,7 +296,7 @@ pub struct Net { rate_limiter_config: Option, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct NetState { pub avail_features: u64, pub acked_features: u64, diff --git a/virtio-devices/src/net_util.rs b/virtio-devices/src/net_util.rs index 11b98d9b0..89a91422c 100644 --- a/virtio-devices/src/net_util.rs +++ b/virtio-devices/src/net_util.rs @@ -25,7 +25,7 @@ const QUEUE_SIZE: usize = 256; const CTRL_QUEUE_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 1; #[repr(C, packed)] -#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize, Versionize)] +#[derive(Copy, Clone, Debug, Default, Versionize)] pub struct VirtioNetConfig { pub mac: [u8; 6], pub status: u16, diff --git a/virtio-devices/src/pmem.rs b/virtio-devices/src/pmem.rs index 89eea4ea9..1e5c5926d 100644 --- a/virtio-devices/src/pmem.rs +++ b/virtio-devices/src/pmem.rs @@ -44,7 +44,7 @@ const VIRTIO_PMEM_RESP_TYPE_EIO: u32 = 1; // New descriptors are pending on the virtio queue. const QUEUE_AVAIL_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 1; -#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, Versionize)] +#[derive(Copy, Clone, Debug, Default, Versionize)] #[repr(C)] struct VirtioPmemConfig { start: u64, @@ -269,7 +269,7 @@ pub struct Pmem { _region: MmapRegion, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct PmemState { avail_features: u64, acked_features: u64, diff --git a/virtio-devices/src/rng.rs b/virtio-devices/src/rng.rs index bf15bc682..6c773ec4c 100644 --- a/virtio-devices/src/rng.rs +++ b/virtio-devices/src/rng.rs @@ -130,7 +130,7 @@ pub struct Rng { seccomp_action: SeccompAction, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct RngState { pub avail_features: u64, pub acked_features: u64, diff --git a/virtio-devices/src/watchdog.rs b/virtio-devices/src/watchdog.rs index ed12fae42..34eb980a0 100644 --- a/virtio-devices/src/watchdog.rs +++ b/virtio-devices/src/watchdog.rs @@ -167,7 +167,7 @@ pub struct Watchdog { timer: File, } -#[derive(Serialize, Deserialize, Versionize)] +#[derive(Versionize)] pub struct WatchdogState { pub avail_features: u64, pub acked_features: u64,