Skip to content

Commit

Permalink
contrib/vhost-user-blk: enable protocol feature for vhost-user-blk
Browse files Browse the repository at this point in the history
This patch reports the protocol feature that is only advertised by
QEMU if the device implements the config ops.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
changpe1 authored and mstsirkin committed May 23, 2018
1 parent ebf2a49 commit 7d405b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/vhost-user-blk/vhost-user-blk.c
Expand Up @@ -311,6 +311,12 @@ vub_get_features(VuDev *dev)
1ull << VHOST_USER_F_PROTOCOL_FEATURES;
}

static uint64_t
vub_get_protocol_features(VuDev *dev)
{
return 1ull << VHOST_USER_PROTOCOL_F_CONFIG;
}

static int
vub_get_config(VuDev *vu_dev, uint8_t *config, uint32_t len)
{
Expand Down Expand Up @@ -373,6 +379,7 @@ vub_set_config(VuDev *vu_dev, const uint8_t *data,
static const VuDevIface vub_iface = {
.get_features = vub_get_features,
.queue_set_started = vub_queue_set_started,
.get_protocol_features = vub_get_protocol_features,
.get_config = vub_get_config,
.set_config = vub_set_config,
};
Expand Down

0 comments on commit 7d405b2

Please sign in to comment.