On Tue, Sep 10, 2019 at 05:34:57PM +0200, Johannes Berg wrote: > On Tue, 2019-09-10 at 11:33 -0400, Michael S. Tsirkin wrote: > > On Tue, Sep 10, 2019 at 05:14:36PM +0200, Johannes Berg wrote: > > > Is any of you familiar with the process of getting a virtio device ID > > > assigned, and if so, do you think it'd be feasible? Without that, it'd > > > probably be difficult to upstream the patch to support this protocol to > > > user-mode Linux. > > > > Sure, subscribe then send a patch to virtio-comment@lists.oasis-open.org > > Ok, great. > > > We do expect people to eventually get around to documenting the device > > and upstreaming it though. If there's no plan to do it at all, you might > > still be able to reuse the virtio code, in that case let's talk. > > Right, no, I do want to and am working on the code now, but it's a bit > of a chicken & egg - without an ID I can't really send any code upstream > :-) > > I can accompany the request for a new ID with working patches. > > What kind of documentation beyond the header file should be added, and > where? You can reserve the device ID without any header files or documentation. Just a patch like this one will suffice: https://github.com/oasis-tcs/virtio-spec/commit/9454b568c29baab7f3e4b1a384627d0061f71eba I have checked that device ID 29 appears to be free so you could use it. For the actual VIRTIO device specification, please follow the same format as the other devices. Here is the virtio-net section in the VIRTIO spec: https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-1940001 It documents the virtqueues, configuration space layout, theory of operation, and also includes normative statements that compliant drivers and devices are expected to follow. The goal of the spec is to provide all the information needed by driver and device emulation authors to create an implementation from scratch (without studying existing code in Linux, QEMU, etc). The VIRTIO spec contains pseudo-C struct and constant definitions, but not a real header file. The header file for a Linux driver would live in include/uapi/linux/virtio_foo.h (see existing devices for examples). This would be part of your Linux patches and separate from the virtio spec. Stefan