[1/3] examples/vhost_blk: fix building with GCC 10
Checks
Commit Message
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: jin.yu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
examples/vhost_blk/vhost_blk.c | 2 ++
examples/vhost_blk/vhost_blk.h | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
Comments
On 2/5/20 2:47 PM, Timothy Redaelli wrote:
> GCC 10 defaults to -fno-common, this means a linker error will now be
> reported if the same global variable is defined in more than one
> compilation unit.
>
> Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
> Cc: jin.yu@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
> examples/vhost_blk/vhost_blk.c | 2 ++
> examples/vhost_blk/vhost_blk.h | 4 ++--
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
@@ -31,6 +31,8 @@
(1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | \
(1ULL << VHOST_USER_F_PROTOCOL_FEATURES))
+struct vhost_blk_ctrlr *g_vhost_ctrlr;
+
/* Path to folder where character device will be created. Can be set by user. */
static char dev_pathname[PATH_MAX] = "";
static sem_t exit_sem;
@@ -112,8 +112,8 @@ struct inflight_blk_task {
struct rte_vhost_inflight_info_packed *inflight_packed;
};
-struct vhost_blk_ctrlr *g_vhost_ctrlr;
-struct vhost_device_ops vhost_blk_device_ops;
+extern struct vhost_blk_ctrlr *g_vhost_ctrlr;
+extern struct vhost_device_ops vhost_blk_device_ops;
int vhost_bdev_process_blk_commands(struct vhost_block_dev *bdev,
struct vhost_blk_task *task);