From 198cce71104370de0be3085d3772b502e2aa4984 Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Tue, 30 Jul 2019 16:34:06 +0530 Subject: [PATCH] net/virtio: fix build Add extern to variable declaration to avoid some compiler treating it as variable definition. build error log: lib/librte_pmd_virtio.a(vhost_kernel.o):(.rodata+0x110): multiple definition of `vhost_msg_strings' lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0): first defined here lib/librte_pmd_virtio.a(virtio_user_dev.o):(.rodata+0xe8): multiple definition of `vhost_msg_strings' lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0): first defined here Fixes: 33d24d65fe2b ("net/virtio-user: abstract backend operations") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_user/vhost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h index 55f47036bb..1e784e58ef 100644 --- a/drivers/net/virtio/virtio_user/vhost.h +++ b/drivers/net/virtio/virtio_user/vhost.h @@ -67,7 +67,7 @@ enum vhost_user_request { VHOST_USER_MAX }; -const char * const vhost_msg_strings[VHOST_USER_MAX]; +extern const char * const vhost_msg_strings[VHOST_USER_MAX]; struct vhost_memory_region { uint64_t guest_phys_addr; -- 2.20.1