rust-vmm / vhost-user-backend

Deprecated repository, code now lives in: https://github.com/rust-vmm/vhost/
Apache License 2.0
18 stars 16 forks source link

handler: Fix vring initialization logic #77

Closed sboeuf closed 2 years ago

sboeuf commented 2 years ago

Summary of the PR

Since it's the guest decision to rely on polling or interrupts to be notified about used descriptors in the used ring, we can't expect an EventFd to be set through SET_VRING_CALL if the guest chose the polling method.

On the other hand, we always expect an EventFd to be provided through SET_VRING_KICK since the current way of handling new descriptors is exclusively by receiving an event through an eventfd (no polling mode has been implemented).

That's why a vring should be initialized based on its state and if the EventFd related to VRING_KICK has been set.

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

sboeuf commented 2 years ago

@jiangliu @slp @stefano-garzarella can you please have a look?