diff options
author | Changpeng Liu <changpeng.liu@intel.com> | 2018-05-29 09:24:35 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-06-01 19:20:38 +0300 |
commit | 25b1d45a1975fd8624c37b5bf42e8502ccf53460 (patch) | |
tree | 142b8efd36a8abb4ff8a44e651bc928380fc935c /hw/block | |
parent | cab27afa10c241cb99df41f770b29cebd6a91e73 (diff) |
vhost-blk: turn on pre-defined RO feature bit
Read only feature shouldn't be negotiable, because if the
backend device reported Read only feature supported, QEMU
host driver shouldn't change backend's RO attribute. While
here, also enable the vhost-user-blk test utility to test
RO feature.
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 'hw/block')
-rw-r--r-- | hw/block/vhost-user-blk.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 7c3fa8bb1c..d755223643 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -203,13 +203,11 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev, virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY); virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE); virtio_add_feature(&features, VIRTIO_BLK_F_FLUSH); + virtio_add_feature(&features, VIRTIO_BLK_F_RO); if (s->config_wce) { virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE); } - if (s->config_ro) { - virtio_add_feature(&features, VIRTIO_BLK_F_RO); - } if (s->num_queues > 1) { virtio_add_feature(&features, VIRTIO_BLK_F_MQ); } @@ -339,7 +337,6 @@ static Property vhost_user_blk_properties[] = { DEFINE_PROP_UINT16("num-queues", VHostUserBlk, num_queues, 1), DEFINE_PROP_UINT32("queue-size", VHostUserBlk, queue_size, 128), DEFINE_PROP_BIT("config-wce", VHostUserBlk, config_wce, 0, true), - DEFINE_PROP_BIT("config-ro", VHostUserBlk, config_ro, 0, false), DEFINE_PROP_END_OF_LIST(), }; |