Commit Graph

103 Commits

Author SHA1 Message Date
Viresh Kumar
bc90ff2b08 [i2c] Fix build issues with bump vm-memory 0.7.0
Build was failing with update to 0.7.0 for vm-memory, fix them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-11-15 16:48:59 +05:30
dependabot[bot]
fab448bc99 build(deps): bump vm-memory from 0.6.0 to 0.7.0
Bumps [vm-memory](https://github.com/rust-vmm/vm-memory) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.6.0...v0.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-15 16:36:09 +05:30
Viresh Kumar
078f2f0bde
Merge pull request #58 from rust-vmm/dependabot/submodules/rust-vmm-ci-aee82cf
build(deps): bump rust-vmm-ci from `b037be3` to `aee82cf`
2021-11-15 16:31:53 +05:30
Viresh Kumar
5ea0aa732f
Merge branch 'main' into dependabot/submodules/rust-vmm-ci-aee82cf 2021-11-15 15:58:24 +05:30
Viresh Kumar
3b1faa7275
Merge pull request #47 from vireshk/i2c/hashmap
[i2c] Use hashmap for device_map
2021-11-15 15:50:42 +05:30
Viresh Kumar
ad48329bc2
Merge branch 'main' into i2c/hashmap 2021-11-11 06:57:15 +05:30
Alex Bennée
ab810f51c0
Merge pull request #60 from vireshk/i2c/unused-mem
i2c: Remove unused `mem` field
2021-11-10 10:22:59 +00:00
Viresh Kumar
aa6a2450d5
Merge branch 'main' into i2c/unused-mem 2021-11-09 13:34:38 +05:30
Alex Bennée
31ec556560 README.md: document aim for separating concerns
While there may be some work to do on the testing framework to make
proper use of vm-virtio we should at least document the desire for
modularity.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2021-11-09 10:02:30 +02:00
Alex Bennée
cf18bc7409 CODEOWNERS: add myself an Mathieu to aid review
This will help with review of incoming stuff although we may need to
lean on the wider community when it comes to more in depth Rust stuff.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2021-11-09 10:02:30 +02:00
dependabot[bot]
5402b6d5e5
build(deps): bump rust-vmm-ci from b037be3 to aee82cf
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `b037be3` to `aee82cf`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](b037be3396...aee82cf0a4)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 04:08:17 +00:00
Viresh Kumar
91778ed009 i2c: Remove unused mem field
Removed the unused `mem` field.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-11-08 09:30:22 +05:30
Viresh Kumar
bd84352b36
Merge branch 'main' into i2c/hashmap 2021-11-02 16:30:30 +05:30
Jiang Liu
f7c632020b
Merge pull request #53 from vireshk/i2c/fix-funcs-helper
I2c/fix funcs helper
2021-11-02 18:46:17 +08:00
Viresh Kumar
f1672f2016
Merge branch 'main' into i2c/hashmap 2021-11-02 10:22:06 +05:30
Viresh Kumar
53283d78d7
Merge branch 'main' into i2c/fix-funcs-helper 2021-11-02 10:21:26 +05:30
dependabot[bot]
9cb776f199 build(deps): bump rust-vmm-ci from 7931077 to b037be3
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `7931077` to `b037be3`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](7931077cdc...b037be3396)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 10:45:12 +02:00
Viresh Kumar
ef52e69bff [i2c] Remove the "func" argument from funcs()
The funcs() implementation is buggy as it doesn't take "func" by
reference and it only defaults to SMBUS and hence the I2C protocol is
never chosen as a function.

Since the value of "func" is never required to be set by the caller, it
shouldn't be passed as argument in the first place. Make the function
return Result<u64> instead.

The test test_funcs() was failing before this change and passes after
it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-28 11:32:17 +05:30
Viresh Kumar
e28f3af61b [i2c] Add a test to check the working of funcs()
The funcs() implementation is buggy as it doesn't take "func" by
reference and it only defaults to SMBUS and hence the I2C protocol is
never chosen as a function.

This test fails currently.

Suggested-by: Andreea Florescu <fandree@amazon.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-27 14:18:14 +05:30
Viresh Kumar
fedfb0b82e [i2c] Use hashmap for device_map
Use hashmap instead of an array of size 1 << 7, as only a few entries of
the array are used here.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-27 14:14:27 +05:30
Jiang Liu
91d84b481e
Merge pull request #48 from vireshk/i2c/errors
I2c/errors
2021-10-27 16:03:39 +08:00
Viresh Kumar
79a84972f5 [i2c] Update coverage score and Cargo.lock
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-27 12:38:09 +05:30
Viresh Kumar
16a028f35d [i2c] Avoid using expect()
Be consistent with the use of expect() and unwrap() and use only one of
them, if required. Also add a comment on why usage of unwrap() is safe
in main().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-27 12:36:57 +05:30
Viresh Kumar
d021564ba3 [i2c] Improve tests by matching error number
Improve tests by matching the expected error number.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-26 16:28:38 +05:30
Viresh Kumar
ca5e7e02dd [i2c] Unify Error types
The crate uses lots of ways to report errors, unify them and use a
separate Error enum type for each file. This will also help us improve
the test code later on.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-26 16:28:38 +05:30
Viresh Kumar
e62e27aead [i2c] Use log crate helpers instead of println!()
Use info! and warn! instead of println!.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-26 15:07:17 +05:30
Viresh Kumar
60d29f98f4
Merge pull request #52 from andreeaflorescu/testing_i2c
update I2cAdapter to allow setting a mock device
2021-10-26 13:07:01 +05:30
Andreea Florescu
57b96aa3a3 update I2cAdapter to allow setting a mock device
Before the constructor of this function was opening the device
corresponding to the passed path. This did not allow for properly
mocking the device functionality. Now the device is passed as a
parameter instead, which allows us to tweak what the device returns for
ioctl calls, and we can thus test multiple scenarios.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-10-26 10:27:58 +03:00
Vincent Whitchurch
27a19cfe67 [i2c] Copy from correct result buffer
Copy the read data from the correct result buffer, otherwise
this results in incorrect data and/or memory overwrites in the
guest memory.

Signed-off-by: Vincent Whitchurch <vincent@whitchurch.se>
2021-10-26 08:54:58 +03:00
Viresh Kumar
6e585e9192
Merge pull request #46 from rust-vmm/dependabot/cargo/proc-macro2-1.0.30
build(deps): bump proc-macro2 from 1.0.29 to 1.0.30
2021-10-18 12:32:30 +05:30
Viresh Kumar
aaecfda574
Merge branch 'main' into dependabot/cargo/proc-macro2-1.0.30 2021-10-18 12:16:13 +05:30
Viresh Kumar
3f22be50bd
Merge pull request #44 from rust-vmm/dependabot/cargo/clap_derive-3.0.0-beta.5
build(deps): bump clap_derive from 3.0.0-beta.4 to 3.0.0-beta.5
2021-10-18 12:16:04 +05:30
Viresh Kumar
f1a3d6eeb8
Merge branch 'main' into dependabot/cargo/proc-macro2-1.0.30 2021-10-18 12:13:15 +05:30
Viresh Kumar
16c88c60ce
Merge branch 'main' into dependabot/cargo/clap_derive-3.0.0-beta.5 2021-10-18 12:09:45 +05:30
Laura Loghin
38350e9f0d
Merge pull request #43 from rust-vmm/dependabot/submodules/rust-vmm-ci-7931077
build(deps): bump rust-vmm-ci from `68d4dbf` to `7931077`
2021-10-18 09:35:18 +03:00
dependabot[bot]
130c2d2abe
build(deps): bump proc-macro2 from 1.0.29 to 1.0.30
Bumps [proc-macro2](https://github.com/alexcrichton/proc-macro2) from 1.0.29 to 1.0.30.
- [Release notes](https://github.com/alexcrichton/proc-macro2/releases)
- [Commits](https://github.com/alexcrichton/proc-macro2/compare/1.0.29...1.0.30)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 04:08:11 +00:00
dependabot[bot]
269dc3a1f3
build(deps): bump clap_derive from 3.0.0-beta.4 to 3.0.0-beta.5
Bumps [clap_derive](https://github.com/clap-rs/clap) from 3.0.0-beta.4 to 3.0.0-beta.5.
- [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/commits)

---
updated-dependencies:
- dependency-name: clap_derive
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 04:07:53 +00:00
dependabot[bot]
aa41d51b52
build(deps): bump rust-vmm-ci from 68d4dbf to 7931077
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `68d4dbf` to `7931077`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](68d4dbf85c...7931077cdc)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 04:07:12 +00:00
Viresh Kumar
987e513b63
Merge pull request #37 from rust-vmm/dependabot/submodules/rust-vmm-ci-68d4dbf
build(deps): bump rust-vmm-ci from `7f22582` to `68d4dbf`
2021-10-13 22:28:05 +05:30
Viresh Kumar
be0f094f03
Merge branch 'main' into dependabot/submodules/rust-vmm-ci-68d4dbf 2021-10-13 20:18:46 +05:30
Viresh Kumar
395e37bd51
Merge pull request #35 from rust-vmm/dependabot/cargo/vhost-0.2
build(deps): update vhost requirement from 0.1 to 0.2
2021-10-13 20:18:24 +05:30
Andreea Florescu
9fc24f7ea2
Merge branch 'main' into dependabot/cargo/vhost-0.2 2021-10-13 17:15:02 +03:00
Andreea Florescu
027c02bc11
Merge branch 'main' into dependabot/submodules/rust-vmm-ci-68d4dbf 2021-10-13 17:14:34 +03:00
dependabot[bot]
5b31a96a9c build(deps): bump quote from 1.0.9 to 1.0.10
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.9 to 1.0.10.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.9...1.0.10)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-13 17:14:22 +03:00
Viresh Kumar
ed3315afc5 [i2c] Fix build errors
Update version of vhost-user-backend and vmm-sys-util to fix the build
errors.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-10-11 12:07:01 +05:30
Viresh Kumar
b7b5d3e6e0
Merge branch 'main' into dependabot/cargo/vhost-0.2 2021-10-11 11:38:19 +05:30
Viresh Kumar
d5a83471d0
Merge branch 'main' into dependabot/submodules/rust-vmm-ci-68d4dbf 2021-10-11 11:37:31 +05:30
Viresh Kumar
7ef1841c92
Merge pull request #38 from rust-vmm/dependabot/cargo/libc-0.2.103
build(deps): bump libc from 0.2.102 to 0.2.103
2021-10-11 11:37:17 +05:30
dependabot[bot]
880b448b78
build(deps): bump rust-vmm-ci from 7f22582 to 68d4dbf
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `7f22582` to `68d4dbf`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](7f22582590...68d4dbf85c)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 06:00:13 +00:00
Viresh Kumar
6bab5b5eba
Merge branch 'main' into dependabot/cargo/libc-0.2.103 2021-10-11 11:29:53 +05:30