summary refs log tree commit diff stats
path: root/contrib/vhost-user-blk/vhost-user-blk.c
diff options
context:
space:
mode:
authorChangpeng Liu <changpeng.liu@intel.com>2018-05-19 06:20:46 +0800
committerMichael S. Tsirkin <mst@redhat.com>2018-05-23 17:02:03 +0300
commit7d405b2ffbcbee4c622deb6c0ab4f5649de7fc2b (patch)
tree7b8fe0065f71361984411ff13f0c36102fbbc1e4 /contrib/vhost-user-blk/vhost-user-blk.c
parentebf2a499a5c43d5eaee2b70ab5ae655af49d935c (diff)
downloadfocaccia-qemu-7d405b2ffbcbee4c622deb6c0ab4f5649de7fc2b.tar.gz
focaccia-qemu-7d405b2ffbcbee4c622deb6c0ab4f5649de7fc2b.zip
contrib/vhost-user-blk: enable protocol feature for vhost-user-blk
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>
Diffstat (limited to 'contrib/vhost-user-blk/vhost-user-blk.c')
-rw-r--r--contrib/vhost-user-blk/vhost-user-blk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index 67dac8155a..a6a132a492 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -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)
 {
@@ -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,
 };