Skip to content

Commit

Permalink
vhost: move and rename the conn retry times
Browse files Browse the repository at this point in the history
Multiple devices need this macro, move it to a common header.

Signed-off-by: Li Feng <fengli@smartx.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20231009044735.941655-3-fengli@smartx.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Li Feng authored and mstsirkin committed Oct 19, 2023
1 parent 63a5c46 commit 0c4f068
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions hw/block/vhost-user-blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "sysemu/sysemu.h"
#include "sysemu/runstate.h"

#define REALIZE_CONNECTION_RETRIES 3

static const int user_feature_bits[] = {
VIRTIO_BLK_F_SIZE_MAX,
VIRTIO_BLK_F_SEG_MAX,
Expand Down Expand Up @@ -482,7 +480,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)
s->inflight = g_new0(struct vhost_inflight, 1);
s->vhost_vqs = g_new0(struct vhost_virtqueue, s->num_queues);

retries = REALIZE_CONNECTION_RETRIES;
retries = VU_REALIZE_CONN_RETRIES;
assert(!*errp);
do {
if (*errp) {
Expand Down
3 changes: 1 addition & 2 deletions hw/virtio/vhost-user-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "standard-headers/linux/virtio_ids.h"
#include "trace.h"

#define REALIZE_CONNECTION_RETRIES 3
#define VHOST_NVQS 2

/* Features required from VirtIO */
Expand Down Expand Up @@ -365,7 +364,7 @@ static void vu_gpio_device_realize(DeviceState *dev, Error **errp)
qemu_chr_fe_set_handlers(&gpio->chardev, NULL, NULL, vu_gpio_event, NULL,
dev, NULL, true);

retries = REALIZE_CONNECTION_RETRIES;
retries = VU_REALIZE_CONN_RETRIES;
g_assert(!*errp);
do {
if (*errp) {
Expand Down
2 changes: 2 additions & 0 deletions include/hw/virtio/vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define VHOST_F_DEVICE_IOTLB 63
#define VHOST_USER_F_PROTOCOL_FEATURES 30

#define VU_REALIZE_CONN_RETRIES 3

/* Generic structures common for any vhost based device. */

struct vhost_inflight {
Expand Down

0 comments on commit 0c4f068

Please sign in to comment.