virtio-devices: vsock: Adapt used handling to match other devices

Follow the same pattern as other virtio devices using a bool to check if
it needs notification and propagating its own Error enum.

Sadly this does still use `anyhow!()` but this does match with the
behaviour of the other devices in their implementations.

As a side effect we can now remove two errors from the top-level Error
enum in virtio-devices as these were only used by this module and those
errors had mangled descriptions.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-05-04 15:49:55 +01:00
parent 7d8986aad0
commit 63d6beb170
2 changed files with 54 additions and 24 deletions

View File

@@ -117,10 +117,6 @@ pub enum Error {
SetShmRegionsNotSupported,
#[error("Failed to process net queue")]
NetQueuePair(#[source] ::net_util::NetQueuePairError),
#[error("Failed to ")]
QueueAddUsed(#[source] virtio_queue::Error),
#[error("Failed to ")]
QueueIterator(#[source] virtio_queue::Error),
}
#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]