mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: vhost_user: Add VhostUserCommon::state() helper
With a common state structure for all vhost-user devices the state() methods can also be refactored for reuse. This will make it easier to add new common fields in the future for snapshot/restore. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -221,14 +221,7 @@ impl Net {
|
||||
}
|
||||
|
||||
fn state(&self) -> State {
|
||||
State {
|
||||
avail_features: self.common.avail_features,
|
||||
acked_features: self.common.acked_features,
|
||||
config: self.config,
|
||||
acked_protocol_features: self.vu_common.acked_protocol_features,
|
||||
vu_num_queues: self.vu_common.vu_num_queues,
|
||||
..Default::default()
|
||||
}
|
||||
self.vu_common.state(&self.common, self.config)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user