virtio-devices: vhost_user: Adapt state() to return Result

This is a refactoring step in preparation for fetching backend device
state via SET_DEVICE_STATE_FD which can fail.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-03-26 14:14:37 -07:00
parent 3e233af654
commit 8536a2536e
5 changed files with 17 additions and 11 deletions

View File

@@ -220,7 +220,7 @@ impl Net {
})
}
fn state(&self) -> State {
fn state(&self) -> std::result::Result<State, MigratableError> {
self.vu_common.state(&self.common, self.config)
}
}
@@ -425,7 +425,7 @@ impl Snapshottable for Net {
}
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
self.vu_common.snapshot(&self.state())
self.vu_common.snapshot(&self.state()?)
}
}
impl Transportable for Net {}