mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-30 17:49:08 +00:00
Fix `clippy::precedence` warnings reported by clippy 0.1.85 (4d91de4e48
2025-02-17).
```console
error: operator precedence can trip the unwary
--> vhost-device-template/src/vhu_foo.rs:152:9
|
152 | / 1 << VIRTIO_F_VERSION_1
153 | | | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 | | | 1 << VIRTIO_RING_F_INDIRECT_DESC
155 | | | 1 << VIRTIO_RING_F_EVENT_IDX
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
= note: `-D clippy::precedence` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::precedence)]`
help: consider parenthesizing your expression
|
152 ~ 1 << VIRTIO_F_VERSION_1
153 + | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 + | 1 << VIRTIO_RING_F_INDIRECT_DESC | (1 << VIRTIO_RING_F_EVENT_IDX)
|
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
|
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| LICENSE-APACHE | ||
| LICENSE-BSD-3-Clause | ||
| README.md | ||
| rustfmt.toml | ||
vhost-device-sound
Synopsis
vhost-device-sound --socket <SOCKET> --backend <BACKEND>
Description
A virtio-sound device using the vhost-user protocol.
Options
--socket <SOCKET>
vhost-user Unix domain socket path
--backend <BACKEND>
audio backend to be used [possible values: null, pipewire, alsa]
-h, --help
Print help
-V, --version
Print version
Examples
Launch the backend on the host machine:
host# vhost-device-sound --socket /tmp/snd.sock --backend null
With QEMU, you can add a virtio device that uses the backend's socket with the following flags:
-chardev socket,id=vsnd,path=/tmp/snd.sock \
-device vhost-user-snd-pci,chardev=vsnd,id=snd
License
This project is licensed under either of
- Apache License, Version 2.0
- BSD-3-Clause License