From: Michael S. Tsirkin Date: Wed, 19 Nov 2025 12:36:33 +0000 (-0500) Subject: vhost/test: add test specific macro for features X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=350a840110286a9ce5b33923bffd4a48e69fe65b;p=thirdparty%2Flinux.git 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 --- diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 42c955a5b2111..94cd09f36f59c 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -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: