Skip to content

Commit 350a840

Browse files
committed
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>
1 parent 9513f25 commit 350a840

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/vhost/test.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
*/
2929
#define VHOST_TEST_PKT_WEIGHT 256
3030

31+
#define VHOST_TEST_FEATURES VHOST_FEATURES
32+
3133
enum {
3234
VHOST_TEST_VQ = 0,
3335
VHOST_TEST_VQ_MAX = 1,
@@ -328,14 +330,14 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
328330
return -EFAULT;
329331
return vhost_test_set_backend(n, backend.index, backend.fd);
330332
case VHOST_GET_FEATURES:
331-
features = VHOST_FEATURES;
333+
features = VHOST_TEST_FEATURES;
332334
if (copy_to_user(featurep, &features, sizeof features))
333335
return -EFAULT;
334336
return 0;
335337
case VHOST_SET_FEATURES:
336338
if (copy_from_user(&features, featurep, sizeof features))
337339
return -EFAULT;
338-
if (features & ~VHOST_FEATURES)
340+
if (features & ~VHOST_TEST_FEATURES)
339341
return -EOPNOTSUPP;
340342
return vhost_test_set_features(n, features);
341343
case VHOST_RESET_OWNER:

0 commit comments

Comments
 (0)