Dmitry Vyukov
2022-Nov-12 16:19 UTC
[PATCH/RFC] virtio_test: A module for testing virtio via userspace
Hi, The original email is from 2009, so I assume you don't have it in your inboxes already. Here is the original email: https://lore.kernel.org/all/200906190927.34831.borntraeger at de.ibm.com/> This patch introduces a prototype for a virtio_test module. This module can > be bound to any virtio device via sysfs bind/unbind feature, e.g: > $ echo virtio1 > /sys/bus/virtio/drivers/virtio_rng/unbind > $ modprobe virtio_test > > On probe this module registers to all virtqueues and creates a character > device for every virtio device. (/dev/viotest<number>). > The character device offers ioctls to allow a userspace application to submit > virtio operations like addbuf, kick and getbuf. It also offers ioctls to get > information about the device and to query the amount of occurred callbacks (or > wait synchronously on callbacks).As far as I understand the test driver was never merged and I can't find any similar testing drivers. I am looking for a test module that allows to create a transient virtio device that can be used to activate a virtio driver are communicate with it as if from the host. Does such thing exist already? Or how are virtio transports/drivers tested/fuzzed nowadays? Thanks
Christian Borntraeger
2022-Nov-14 12:24 UTC
[PATCH/RFC] virtio_test: A module for testing virtio via userspace
Am 12.11.22 um 17:19 schrieb Dmitry Vyukov:> Hi, > > The original email is from 2009, so I assume you don't have it in > your inboxes already. Here is the original email: > > https://lore.kernel.org/all/200906190927.34831.borntraeger at de.ibm.com/ > >> This patch introduces a prototype for a virtio_test module. This module can >> be bound to any virtio device via sysfs bind/unbind feature, e.g: >> $ echo virtio1 > /sys/bus/virtio/drivers/virtio_rng/unbind >> $ modprobe virtio_test >> >> On probe this module registers to all virtqueues and creates a character >> device for every virtio device. (/dev/viotest<number>). >> The character device offers ioctls to allow a userspace application to submit >> virtio operations like addbuf, kick and getbuf. It also offers ioctls to get >> information about the device and to query the amount of occurred callbacks (or >> wait synchronously on callbacks). > > As far as I understand the test driver was never merged and I can't find > any similar testing drivers. I am looking for a test module that allows > to create a transient virtio device that can be used to activate a virtio > driver are communicate with it as if from the host. > > Does such thing exist already? > Or how are virtio transports/drivers tested/fuzzed nowadays?Right, the driver was never merged. Adding Michael as todays virtio maintainer for ideas how to proceed.
Michael S. Tsirkin
2022-Nov-14 13:06 UTC
[PATCH/RFC] virtio_test: A module for testing virtio via userspace
On Sat, Nov 12, 2022 at 05:19:42PM +0100, Dmitry Vyukov wrote:> I am looking for a test module that allows > to create a transient virtio device that can be used to activate a virtio > driver are communicate with it as if from the host. > Does such thing exist already? > Or how are virtio transports/drivers tested/fuzzed nowadays? > > ThanksJust coding it up in qemu is probably easiest. This is how we test most things. -- MST