On 10-02-22, 08:29, Alex Bennée wrote:
Viresh Kumar viresh.kumar@linaro.org writes:
@@ -113,8 +117,10 @@ static void vu_i2c_set_status(VirtIODevice *vdev, uint8_t status) static uint64_t vu_i2c_get_features(VirtIODevice *vdev, uint64_t requested_features, Error **errp) {
- /* No feature bits used yet */
- return requested_features;
- VHostUserI2C *i2c = VHOST_USER_I2C(vdev);
- virtio_add_feature(&requested_features, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST);
- return vhost_get_features(&i2c->vhost_dev, feature_bits, requested_features);
}
It's a bit weird we set it and then pass it to the vhost-user backend. It does raise the question of why the stub actually cares about feature bits at all when really it's a negotiation with the backend.
IOW what would happen if we just called:
return vhost_get_features(&i2c->vhost_dev, feature_bits, -1);
That works as well.
Also I noticed just now that I haven't added VHOST_INVALID_FEATURE_BIT at the end of the feature_bits[]. Will fix that.