vhost: refactor code structure
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 18 Aug 2016 08:48:39 +0000 (16:48 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 13 Sep 2016 03:25:08 +0000 (05:25 +0200)
commita277c715987647ecd4ec80d18c5cc95c28d9dfd3
treee1b111529ce5275b98c3e73fac21579745af0d1b
parent8394025f5412c63069af1e2aea9549180d056a57
vhost: refactor code structure

The code structure is a bit messy now. For example, vhost-user message
handling is spread to three different files:

    vhost-net-user.c  virtio-net.c  virtio-net-user.c

Where, vhost-net-user.c is the entrance to handle all those messages
and then invoke the right method for a specific message. Some of them
are stored at virtio-net.c, while others are stored at virtio-net-user.c.

The truth is all of them should be in one file, vhost_user.c.

So this patch refactors the source code structure: mainly on renaming
files and moving code from one file to another file that is more suitable
for storing it. Thus, no functional changes are made.

After the refactor, the code structure becomes to:

- socket.c      handles all vhost-user socket file related stuff, such
                as, socket file creation for server mode, reconnection
                for client mode.

- vhost.c       mainly on stuff like vhost device creation/destroy/reset.
                Most of the vhost API implementation are there, too.

- vhost_user.c  all stuff about vhost-user messages handling goes there.

- virtio_net.c  all stuff about virtio-net should go there. It has virtio
                net Rx/Tx implementation only so far: it's just a rename
                from vhost_rxtx.c

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
14 files changed:
lib/librte_vhost/Makefile
lib/librte_vhost/socket.c [new file with mode: 0644]
lib/librte_vhost/vhost-net-user.c [deleted file]
lib/librte_vhost/vhost-net-user.h [deleted file]
lib/librte_vhost/vhost-net.h [deleted file]
lib/librte_vhost/vhost.c [new file with mode: 0644]
lib/librte_vhost/vhost.h [new file with mode: 0644]
lib/librte_vhost/vhost_rxtx.c [deleted file]
lib/librte_vhost/vhost_user.c [new file with mode: 0644]
lib/librte_vhost/vhost_user.h [new file with mode: 0644]
lib/librte_vhost/virtio-net-user.c [deleted file]
lib/librte_vhost/virtio-net-user.h [deleted file]
lib/librte_vhost/virtio-net.c [deleted file]
lib/librte_vhost/virtio_net.c [new file with mode: 0644]