On Fri, Sep 4, 2020 at 5:35 AM Dima Stepanov <dimas...@yandex-team.ru> wrote: > > Add vhost_user_ops structure for the vhost-user-blk device class. Add > the test_reconnect and test_migrate tests for this device. > > Signed-off-by: Dima Stepanov <dimas...@yandex-team.ru>
Reviewed-by: Raphael Norwitz <raphael.norw...@nutanix.com> Just one small suggestion. > --- > tests/qtest/vhost-user-test.c | 139 > +++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 137 insertions(+), 2 deletions(-) > @@ -857,12 +911,21 @@ static void test_reconnect(void *obj, void *arg, > QGuestAllocator *alloc) > { > TestServer *s = arg; > GSource *src; > + int nq; > > + if (s->vu_ops->driver_init) { > + s->vu_ops->driver_init(obj, alloc); > + } > if (!wait_for_fds(s)) { > return; > } > Maybe we could break this logic out into a helper? I imagine there may be other cases where we might want to get a number of rings for a given device type. > - wait_for_rings_started(s, 2); > + nq = 1; > + if (s->vu_ops->type == VHOST_USER_NET) { > + /* tx and rx queues */ > + nq = 2; > + } > + wait_for_rings_started(s, nq); >