Commit Graph

32 Commits

Author SHA1 Message Date
Stefano Garzarella
8d3ebf35e1 sound: support multiple threads 2023-03-31 15:49:46 +02:00
Stefano Garzarella
72c31053ff Revert "sound: use thread trait"
This reverts commit 3ac6c160c1.
2023-03-31 12:05:58 +02:00
Stefano Garzarella
3ac6c160c1 sound: use thread trait 2023-03-30 20:56:42 +02:00
Stefano Garzarella
a1b49a76a7 sound: use interior mutability 2023-03-30 20:23:51 +02:00
Stefano Garzarella
0a78103b41 sound: initial commit 2023-03-30 18:47:15 +02:00
dependabot[bot]
b181568ae5 build(deps): bump tempfile from 3.3.0 to 3.4.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 14:09:24 +05:30
Viresh Kumar
ea699c86de tests: Initialize queues properly
The virtio-queue crate doesn't allow invalid queue state since commit
d951283a8e88 ("don't allow processing descriptors for invalid q").

Initialize the queues properly to fix testing failures.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-02-28 14:44:14 +05:30
Alex Bennée
2857681557 Updates crates to use virtio_config bindings
Rather incongruously the common VIRTIO feature flags where part of the
net binding. Now that the new binding are out we can update them to
something generic.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-02-28 14:19:12 +05:30
dependabot[bot]
b32559eb72 build(deps): bump clap from 4.1.4 to 4.1.6
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.1.4...v4.1.6)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 12:09:24 +05:30
Viresh Kumar
799073f17c gpio: Migrate to the upstream version of libgpiod
The upstream version doesn't compile the .c files locally and depends on
the package to be locally compiled and installed in advance.

It also doesn't provide pre-generated bindings, and requires bindgen
support.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-02-15 08:09:13 -07:00
Viresh Kumar
b6e3fd4970 i2c: Change type of mem to GuestMemoryLoadGuard<>
This is what we need eventually, while parsing the requests, lets store
the correct type instead of creating the same everytime.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-02-13 23:41:17 +05:30
dependabot[bot]
ea09ebce2e build(deps): bump serial_test from 0.9.0 to 1.0.0
Bumps [serial_test](https://github.com/palfrey/serial_test) from 0.9.0 to 1.0.0.
- [Release notes](https://github.com/palfrey/serial_test/releases)
- [Commits](https://github.com/palfrey/serial_test/compare/v0.9.0...v1.0.0)

---
updated-dependencies:
- dependency-name: serial_test
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 10:39:24 +05:30
Viresh Kumar
8a6c25f3e7 gpio: Update to a newer version of libgpiod
Update to a newer version of libgpiod crates.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-01-20 15:30:53 +05:30
Stefano Garzarella
d1539d5274 vsock: require virtio-vsock 0.2.1
The 0.2.1 version of virtio-vsock crate contains a fix [1] needed to
properly work with the virtio-vsock driver provided by Linux v6.3 and
later (originally the new driver was supposed to be in v6.2, but it
was postponed).

The fix was just a quick workaround, but in the future more work will
be needed in the virtio-vsock crate to not have a Linux-only specific
implementation of VsockPacket, as described in this issue [2].

[1] https://github.com/rust-vmm/vm-virtio/pull/207
[2] https://github.com/rust-vmm/vm-virtio/issues/216

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-01-19 09:37:25 -07:00
Viresh Kumar
26a0f3ad4d Fix clippy errors
New clippy errors were reported with an updated rust-vmm-ci submodule,
fix them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-01-16 15:20:10 +05:30
Stefano Garzarella
42526a302c vsock/README: update the QEMU example
As pointed out in https://gitlab.com/qemu-project/qemu/-/issues/1337
`-numa` is not supported by all machine types, so let's update the
example using the `memory-backend` machine property.

Since we are modifying the QEMU example, let's provide only the
QEMU's vhost-user-vsock required options in the "Usage" section.
In addition we also probide a working example.

Let's also remove a spurious rust section at the bottom of the file
that does not add any useful information.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-12-05 21:18:25 +05:30
Viresh Kumar
f541481f30 i2c: Accept bus names instead of numbers
The I2C device names, /dev/i2c-N, can change from one boot to another of
the host machine and so aren't stable enough to be used for bus
selection.

Instead start accepting I2C master's name as parameter and parse based
on that.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-05 17:15:38 +05:30
Viresh Kumar
26e0ff25ae i2c: Move Linux userspace specific code to PhysDevice
The path "/dev/i2c-N" is valid only for Linux userspace and must be
handled within PhysDevice's implementation.

Move it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-05 17:15:38 +05:30
Viresh Kumar
7c1d5ac57d gpiod: Migrate to upstreamed version of libgpiod
The libgpiod rust bindings got upstreamed recently. Migrate to the
upstreamed version.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-05 15:21:44 +05:30
Viresh Kumar
68ea1f51e8 gpio: Remove get_ prefix for getters
The Rust language guidelines suggests not prefixing getters with get_.
Remove the same from GPIO getters.

https://rust-lang.github.io/api-guidelines/naming.html

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-05 15:21:44 +05:30
dependabot[bot]
443da37860 build(deps): bump env_logger from 0.9.3 to 0.10.0
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.9.3 to 0.10.0.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.9.3...v0.10.0)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 14:50:11 +05:30
Viresh Kumar
27f0f0b75b Update virtio crates to new versions
This is required to fix the errors with individual pull requests with
these crates.

Also update other dependencies with general `cargo update`.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-01 13:07:50 +05:30
dependabot[bot]
cf0f146414 build(deps): bump vmm-sys-util from 0.10.0 to 0.11.0
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: vmm-sys-util
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 13:07:50 +05:30
Viresh Kumar
c2e566c493 Switch to caret versions
Specify the dependencies with caret versions.

Fixes: rust-vmm/community#131
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-11-15 14:23:38 +00:00
Viresh Kumar
56b9ef46bb Add SAFETY comments
Add SAFETY comments to fix clippy warnings.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-11-09 13:05:04 +05:30
Stefano Garzarella
8e1fb7e985 rng: update License in source files and readme
Cargo.toml defines `license = "Apache-2.0 OR BSD-3-Clause"`,
so let's update the SPDX in source files and add a section
in the readme about the license.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-10-27 11:19:40 -06:00
Stefano Garzarella
8ead248560 i2c: update License in source files and readme
Cargo.toml defines `license = "Apache-2.0 OR BSD-3-Clause"`,
so let's update the SPDX in source files and add a section
in the readme about the license.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-10-27 11:19:40 -06:00
Stefano Garzarella
bd61beeed9 gpio: update License in source files and readme
Cargo.toml defines `license = "Apache-2.0 OR BSD-3-Clause"`,
so let's update the SPDX in source files and add a section
in the readme about the license.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-10-27 11:19:40 -06:00
Stefano Garzarella
6c52f494a3 vsock: add license in the readme
We forgot to update the License section in the readme
template. So, let's specify that vsock crate is licensed
under Apache 2.0 OR BSD-3-Clause.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-10-27 11:19:40 -06:00
Stefano Garzarella
4f7ffd7d0b vsock: serialize tests as workaround
As pointed out in the issue #232, vsock tests fail randomly.
From an initial analysis, it appears that using `--test-threads=1`
never happens, but using a value greater than 1, the tests fails
after a while and almost always with the creation of UDS,
or EpollFD, or on epoll_ctl.

There should be something wrong with FDs when there are multiple
threads running tests (not sure if related to O_CLOEXEC).

This is just a workaround, we will revert this commit when we
identify the root cause.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2022-10-18 13:29:08 +05:30
Viresh Kumar
5005c96c3a vsock: Minor cleanups
Minor cleanups.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-10-13 16:28:11 +05:30
Viresh Kumar
5e83d0c93f Move all crates in crates directory
Based on what other rust-vmm workspaces do, move all crates to crates
directory.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-10-13 16:28:11 +05:30