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:
Rob Bradford
2026-03-26 08:48:41 -07:00
parent a77f89847e
commit bd56214d54
5 changed files with 15 additions and 32 deletions
+1 -8
View File
@@ -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)
}
}