-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[virtio-queue] add events/metrics support #105
Comments
I will add trait QueueEvents in virtio-queue, like below: /// Define a QueueEvents trait and let the backend decide how they want to handle different events
pub trait QueueEvents {
// some methods
....
} And the device in the devices crate will implement this trait. |
@uran0sH I assigned you to the issue. Thanks! |
I try to add pub struct QueueState<EV: QueueEvents> {
...
/// Queue Events
pub queue_evts: EV,
}
pub struct Queue<M: GuestAddressSpace, EV: 'static + QueueEvents, S: QueueStateT<EV> = QueueState<EV>> {
/// Guest memory object associated with the queue.
pub mem: M,
/// Virtio queue state.
pub state: S,
_marker: PhantomData<EV>,
}
impl From<&QueueStateSer> for QueueState {
fn from(state: &QueueStateSer) -> Self {
QueueState {
queue_evts: ?
}
}
} What value should we assign to queue_evts? |
In case of a queue misconfiguration, we log an error by using the
log
crate. We can get rid of this dependency by defining aQueueEvents
trait and let the backend decide how they want to handle different events, an example here for the serial console. Another option would be to return errors instead of logging an error. Related to: #94.The text was updated successfully, but these errors were encountered: