On Fri, Apr 24, 2020 at 12:17:54PM +0200, Marc-André Lureau wrote: > Hi > > On Fri, Apr 24, 2020 at 4:32 AM Raphael Norwitz > <raphael.norw...@nutanix.com> wrote: > > > > I’m not opposed to adding this kind of debugging functionality to the > > vhost-user-blk sample. It could be helpful to easily test these cases > > in the future. > > > > That said, I'm not sure how others will feel about adding these kind > > of debugging capabilities to libvhost-user. Marc-Andre, thoughts? > > Maybe we should only enable this code if LIBVHOST_USER_DEBUG is set? > > And to make logging silent by default, we shouldn't print them unless > VHOST_USER_DEBUG env is set? Yes, it is a good idea to move this code under LIBVHOST_USER_DEBUG. Agree. Will update it in version 2, but need more feedback on other patches first.
> > > > > If we go this route I would prefer to add the debugging options to the > > vhost-user-blk sample in a separate patch. > > > > On Thu, Apr 23, 2020 at 09:39:32PM +0300, Dima Stepanov wrote: > > > > > > Add "--simulate-disconnect-stage" option for the testing purposes. > > > This option can be used to test the vhost-user reconnect functionality: > > > ./vhost-user-blk ... --simulate-disconnect-stage=<CASENUM> > > > In this case the daemon will "crash" in the middle of the VHOST comands > > > communication. Case nums are as follows: > > > 1 - make assert in the handler of the SET_VRING_CALL command > > > 2 - make assert in the handler of the SET_VRING_NUM command > > > Main purpose is to test QEMU reconnect functionality. Such fail > > > injection should not lead to QEMU crash and should be handled > > > successfully. > > > Also update the "GOptionEntry entries" definition with the final NULL > > > item according to API. > > > > > > Signed-off-by: Dima Stepanov <dimas...@yandex-team.ru> > > > --- > > > contrib/libvhost-user/libvhost-user.c | 30 > > > ++++++++++++++++++++++++++++++ > > > contrib/libvhost-user/libvhost-user.h | 13 +++++++++++++ > > > contrib/vhost-user-blk/vhost-user-blk.c | 14 +++++++++++++- > > > 3 files changed, 56 insertions(+), 1 deletion(-) > > >