Commit 4e9fa50c authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

vhost: move features to core

virtio 1 and any layout are core features, move them
there. This fixes vhost test.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent ddab2c0e
...@@ -61,8 +61,7 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;" ...@@ -61,8 +61,7 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;"
enum { enum {
VHOST_NET_FEATURES = VHOST_FEATURES | VHOST_NET_FEATURES = VHOST_FEATURES |
(1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
(1ULL << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_NET_F_MRG_RXBUF)
(1ULL << VIRTIO_F_VERSION_1),
}; };
enum { enum {
......
...@@ -166,9 +166,7 @@ enum { ...@@ -166,9 +166,7 @@ enum {
/* Note: can't set VIRTIO_F_VERSION_1 yet, since that implies ANY_LAYOUT. */ /* Note: can't set VIRTIO_F_VERSION_1 yet, since that implies ANY_LAYOUT. */
enum { enum {
VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL << VIRTIO_SCSI_F_HOTPLUG) | VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL << VIRTIO_SCSI_F_HOTPLUG) |
(1ULL << VIRTIO_SCSI_F_T10_PI) | (1ULL << VIRTIO_SCSI_F_T10_PI)
(1ULL << VIRTIO_F_ANY_LAYOUT) |
(1ULL << VIRTIO_F_VERSION_1)
}; };
#define VHOST_SCSI_MAX_TARGET 256 #define VHOST_SCSI_MAX_TARGET 256
......
...@@ -277,10 +277,13 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl, ...@@ -277,10 +277,13 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT; return -EFAULT;
return 0; return 0;
case VHOST_SET_FEATURES: case VHOST_SET_FEATURES:
printk(KERN_ERR "1\n");
if (copy_from_user(&features, featurep, sizeof features)) if (copy_from_user(&features, featurep, sizeof features))
return -EFAULT; return -EFAULT;
printk(KERN_ERR "2\n");
if (features & ~VHOST_FEATURES) if (features & ~VHOST_FEATURES)
return -EOPNOTSUPP; return -EOPNOTSUPP;
printk(KERN_ERR "3\n");
return vhost_test_set_features(n, features); return vhost_test_set_features(n, features);
case VHOST_RESET_OWNER: case VHOST_RESET_OWNER:
return vhost_test_reset_owner(n); return vhost_test_reset_owner(n);
......
...@@ -173,7 +173,9 @@ enum { ...@@ -173,7 +173,9 @@ enum {
VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
(1ULL << VIRTIO_RING_F_INDIRECT_DESC) | (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
(1ULL << VIRTIO_RING_F_EVENT_IDX) | (1ULL << VIRTIO_RING_F_EVENT_IDX) |
(1ULL << VHOST_F_LOG_ALL), (1ULL << VHOST_F_LOG_ALL) |
(1ULL << VIRTIO_F_ANY_LAYOUT) |
(1ULL << VIRTIO_F_VERSION_1)
}; };
static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment