aboutsummaryrefslogtreecommitdiffstats
path: root/vhost_user_blk.c
diff options
context:
space:
mode:
authorTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2022-12-16 11:34:51 +0100
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-03 15:18:54 +0300
commit9a58d030b9d4d7db297ed0b5d716580526058f78 (patch)
treea90e3aed2a49808a8ca7647a935da4a497cb1f73 /vhost_user_blk.c
parent8b82f2a4574e70ad1667c53a6fa6e896d9cb8d77 (diff)
Virtio-loopback-adapter Delta release:
- Add queue num and size in the arguments - Stop creating user-space threads for its virtio-loopback notification Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
Diffstat (limited to 'vhost_user_blk.c')
-rw-r--r--vhost_user_blk.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/vhost_user_blk.c b/vhost_user_blk.c
index f92d1c7..a8e4c13 100644
--- a/vhost_user_blk.c
+++ b/vhost_user_blk.c
@@ -47,6 +47,8 @@
#define REALIZE_CONNECTION_RETRIES 3
+static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,
+ uint64_t features);
static int vhost_user_blk_start(VirtIODevice *vdev)
{
@@ -223,7 +225,7 @@ static int vhost_user_blk_connect(VirtIODevice *vdev)
vhost_dev_init(s->vhost_dev);
/* Pass the new obtained features */
- global_vdev->host_features = global_vdev->vhublk->vhost_dev->features;
+ global_vdev->host_features = s->vhost_dev->features;
/* Disable VIRTIO_RING_F_INDIRECT_DESC, to be supported in future release */
global_vdev->host_features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC);
@@ -468,7 +470,7 @@ void print_config(uint8_t *config)
DBG("uint8_t unused1[3]: %u\n", config_strct->unused1[2]);
}
-void vhost_user_blk_realize(void)
+void vhost_user_blk_realize(int queue_num, int queue_size)
{
int retries;
int i, ret;
@@ -487,12 +489,13 @@ void vhost_user_blk_realize(void)
vhost_user_blk_init(global_vdev);
- global_vdev->vhublk->config_wce = 1;
+ global_vdev->vhublk->config_wce = 0;
+
/* FIXME: We temporarily hardcoded the vrtqueues number */
- global_vdev->vhublk->num_queues = 1;
+ global_vdev->vhublk->num_queues = queue_num;
/* FIXME: We temporarily hardcoded the vrtqueues size */
- global_vdev->vhublk->queue_size = 128;
+ global_vdev->vhublk->queue_size = queue_size;
/* NOTE: global_vdev->vqs == vhublk->virtqs */
global_vdev->vqs = (VirtQueue **)malloc(sizeof(VirtQueue *)