]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vhost/test: add test specific macro for features
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 19 Nov 2025 12:36:33 +0000 (07:36 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 27 Nov 2025 07:03:07 +0000 (02:03 -0500)
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>
drivers/vhost/test.c

index 42c955a5b2111bba5cc3a2125273c529a14d07eb..94cd09f36f59c323401a8c0cf6876ac643836f3b 100644 (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: