If I correctly understand how vhost user / virtio works the solution proposed by Michael is OK: - Rings to exchange data between host and guest are allocated by the guest. - As soon as the guest add rings in a queue (for RX or TX) a kick is done on the eventfd associated to the queue - On a live migration (as for a first startup), the guest virtio-net pre-allocates rings for each queue and so send a kick on the eventfd (for RX and TX)
So even if the guest is only doing receiving, there is a kick on any queues. --> Vhost-user backend knows when send the rarp in any conditions without involving QEMU. Michael, could you confirm that my analysis is correct? On Fri, Jun 12, 2015 at 9:55 AM, Jason Wang <jasow...@redhat.com> wrote: > > > On 06/11/2015 08:13 PM, Michael S. Tsirkin wrote: >> On Thu, Jun 11, 2015 at 02:10:48PM +0200, Thibaut Collet wrote: >>> I am not sure to understand your remark: >>> >>>> It needs to be sent when backend is activated by guest kick >>>> (in case of virtio 1, it's possible to use DRIVER_OK for this). >>>> This does not happen when VM still runs on source. >>> Could you confirm rarp can be sent by backend when the >>> VHOST_USER_SET_VRING_KICK message is received by the backend ? >> No - the time to send pakets is when you start processing >> the rings. >> >> And the time to do that is when you detect a kick on >> an eventfd, not when said fd is set. >> > > Probably not. What if guest is only doing receiving? In this case, you > won't detect any kick if you don't send the rarp first.