examples/vhost: fix corrupted vdev tailq list
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 7 Jun 2016 03:32:56 +0000 (11:32 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 04:10:54 +0000 (06:10 +0200)
commit97daf19e99d54c47867b32927c1d7b93b3f63e27
treeec056010eb235555f9e56ccfdd6ac9b1d342d973
parent01ad44fd374fb8ecb9ecc80b9bfd1f45dbaa4a1f
examples/vhost: fix corrupted vdev tailq list

There are two tailq lists, one for logging all vhost devices, another
one for logging vhost devices distributed on a specific core. However,
there is just one tailq entry, named "next", to chain the two list,
which is wrong and could result to a corrupted tailq list, that the
tailq list might always be non-empty: the entry is still there even
after you have invoked TAILQ_REMOVE several times.

Fix it by introducing two tailq entries, one for each list.

Fixes: 45657a5c6861 ("examples/vhost: use tailq to link vhost devices")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
examples/vhost/main.c
examples/vhost/main.h