Commit 350a8401 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

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: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 9513f250
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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: