vhost/test: add test specific macro for features

test just uses vhost features with no change,
but people tend to copy/paste code, so let's
add our own define.

Message-ID: <23ca04512a800ee8b3594482492e536020931340.1764225384.git.mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2025-11-19 07:36:33 -05:00
parent 9513f25056
commit 350a840110
1 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,8 @@
*/
#define VHOST_TEST_PKT_WEIGHT 256
#define VHOST_TEST_FEATURES VHOST_FEATURES
enum {
VHOST_TEST_VQ = 0,
VHOST_TEST_VQ_MAX = 1,
@ -328,14 +330,14 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
return vhost_test_set_backend(n, backend.index, backend.fd);
case VHOST_GET_FEATURES:
features = VHOST_FEATURES;
features = VHOST_TEST_FEATURES;
if (copy_to_user(featurep, &features, sizeof features))
return -EFAULT;
return 0;
case VHOST_SET_FEATURES:
if (copy_from_user(&features, featurep, sizeof features))
return -EFAULT;
if (features & ~VHOST_FEATURES)
if (features & ~VHOST_TEST_FEATURES)
return -EOPNOTSUPP;
return vhost_test_set_features(n, features);
case VHOST_RESET_OWNER: