aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-04-13 22:12:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-04-13 22:12:27 +0100
commit3ddb05dbf21e9dc9b37e3d1cd7ae3d694565e998 (patch)
treec958142ed61048ce1eca46465abd7068882e53bd
parentdb55d2c9239d445cb7f1fa8ede8e42bd339058f4 (diff)
parentace66791cd15657320b11b1a421afc055f28efca (diff)
Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20210413' into staging
virtiofs: Fix feature negotiation (for 6.0) A 6.0 fix for feature negotiation on vhost-user. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> # gpg: Signature made Tue 13 Apr 2021 16:21:41 BST # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert-gitlab/tags/pull-virtiofs-20210413: vhost-user-fs: fix features handling Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/virtio/vhost-user-fs.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c
index ac4fc34b36..6f7f91533d 100644
--- a/hw/virtio/vhost-user-fs.c
+++ b/hw/virtio/vhost-user-fs.c
@@ -24,6 +24,17 @@
#include "monitor/monitor.h"
#include "sysemu/sysemu.h"
+static const int user_feature_bits[] = {
+ VIRTIO_F_VERSION_1,
+ VIRTIO_RING_F_INDIRECT_DESC,
+ VIRTIO_RING_F_EVENT_IDX,
+ VIRTIO_F_NOTIFY_ON_EMPTY,
+ VIRTIO_F_RING_PACKED,
+ VIRTIO_F_IOMMU_PLATFORM,
+
+ VHOST_INVALID_FEATURE_BIT
+};
+
static void vuf_get_config(VirtIODevice *vdev, uint8_t *config)
{
VHostUserFS *fs = VHOST_USER_FS(vdev);
@@ -129,11 +140,12 @@ static void vuf_set_status(VirtIODevice *vdev, uint8_t status)
}
static uint64_t vuf_get_features(VirtIODevice *vdev,
- uint64_t requested_features,
- Error **errp)
+ uint64_t features,
+ Error **errp)
{
- /* No feature bits used yet */
- return requested_features;
+ VHostUserFS *fs = VHOST_USER_FS(vdev);
+
+ return vhost_get_features(&fs->vhost_dev, user_feature_bits, features);
}
static void vuf_handle_output(VirtIODevice *vdev, VirtQueue *vq)