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? 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(-)