Expand description
This file was generated by the following commands and modified manually.
$ bindgen virtio_video.h \
--allowlist-type "virtio_video.*" \
--allowlist-var "VIRTIO_VIDEO_.*" \
--with-derive-default \
--no-layout-tests \
--no-prepend-enum-name > protocol.rs
$ sed -i "s/__u/u/g" protocol.rs
$ sed -i "s/__le/Le/g" protocol.rs
The main points of the manual modifications are as follows:
- Removed
hdr
from each command struct so that we can read the header and a command body separately. (cf. related discussion) - Derive implementations of AsBytes and FromBytes for each struct as needed.
- Added GET_PARAMS_EXT and SET_PARAMS_EXT to allow querying and changing the resource type dynamically.
- Moved some definitions such as virtio_video_config to device_constants to make them visible to vhost-user modules, and also pub-use them.
Structs§
- Extension of the {GET,SET}_PARAMS data to also include the resource type. Not including it was an oversight and the {GET,SET}_PARAMS_EXT commands use this structure to fix it, while the older {GET,SET}_PARAMS commands are kept for backward compatibility.