vduse: add VDUSE_GET_FEATURES ioctl

Add an ioctl to allow VDUSE instances to query the available features
supported by the kernel module.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260707122502.239022-3-eperezma@redhat.com>
This commit is contained in:
Eugenio Pérez 2026-07-07 14:25:00 +02:00 committed by Michael S. Tsirkin
parent 0ff906166f
commit a596238c2a
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,9 @@
#define IRQ_UNBOUND -1
/* Supported VDUSE features */
static const uint64_t vduse_features;
/*
* VDUSE instance have not asked the vduse API version, so assume 0.
*
@ -2342,6 +2345,10 @@ static long vduse_ioctl(struct file *file, unsigned int cmd,
ret = vduse_destroy_dev(name);
break;
}
case VDUSE_GET_FEATURES:
ret = put_user(vduse_features, (u64 __user *)argp);
break;
default:
ret = -EINVAL;
break;

View File

@ -63,6 +63,9 @@ struct vduse_dev_config {
*/
#define VDUSE_DESTROY_DEV _IOW(VDUSE_BASE, 0x03, char[VDUSE_NAME_MAX])
/* Get the VDUSE supported features */
#define VDUSE_GET_FEATURES _IOR(VDUSE_BASE, 0x04, __u64)
/* The ioctls for VDUSE device (/dev/vduse/$NAME) */
/**