With all the core vhost changes in place, we can refactor the upper layers now. We start with the vhost block since it's the easiest one. Vhost Block session specific fields were moved from the device struct into a new session struct. What's tricky, is that the blk-specific struct directly contains the generic session struct. This gives us handy access to the generic session data from the blk-specific session, and also allows us to directly upcast generic session objects. Most of the functions inside vhost block still accept vhost device as a parameter and then get the session object internally. Those functions will be refactored to accept session object directly in a separate patch since the amount of changes required is too big to be done here. Because of the above, some parts of this patch might seem overcomplicated. Especially the to_blk_session() funtion, which checks the device backend inside. The ultimate goal is to receive session object through start/stop callbacks - and for that the backend check does make sense. Change-Id: If222c31aec16a8cbe2d0cfb98c828e1ac75b91fc Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/438678 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> |
||
---|---|---|
.. | ||
rte_vhost | ||
Makefile | ||
vhost_blk.c | ||
vhost_internal.h | ||
vhost_nvme.c | ||
vhost_rpc.c | ||
vhost_scsi.c | ||
vhost.c |