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>
aa33f19d6bf4 temporarily increase the timeout to 15 mins
45443cc21eee add hypervisor tag for agents
e8c8fc32b0dc update docker plugin
4cb208e71e35 .buildkite: add hypervisor to special_keys
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
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>
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>
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>
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>
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>
Add myself to CODEOWNERS to help with reviews and maintaining
this workspace especially vhost-user-vsock.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Following the other crates, reorder the use declaration in 3 groups:
1. standard library
2. external crates
3. local crates
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
In several places the "vsock_" prefix doesn't add much and makes
names longer, let's remove it where it's not needed.
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
VsockArgs is used only by main.rs, so we can move its definition
there. Let's also move the test.
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
This is a binary crate and most of the types shouldn't be visible
out of this crate. Change also documentation with ///.
If we would like to export some types as part of a library in the
future, we will adjust the visibility accordingly.
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Add several tests to get good coverage. Unfortunately,
it's a lot of new code and not easy to test everything.
We may add more mocks and tests in the future.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
VIRTIO spec defines `guest_cid` in LE byte order.
Let's introduce VirtioVsockConfig based on the virtio-spec 1.2.
For now it contains only `guest_cid`, but in the future it could
contain other fields.
Let's also handle correctly `offset` and `size`, returning an empty
Vec if they are not valid.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
If we don't remove any bytes from the buffer, it's useless to
send a credit update since the credit hasn't changed.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Instead of panic if the local peer doesn't send "connect PORT\n"
correctly, let's print an error, ignoring the command.
Print an error message also when allocating local port fails.
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Remove old comments, useless code, and code commented.
Avoid println!() to print messages and replaced with dbg!(), info!(),
or error!().
Also init `env_logger` like other daemons in the main().
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Harsha specified `license = "Apache-2.0 OR BSD-3-Clause"` in
vsock/Cargo.toml, so let's add a properly SPDX tag in the
vsock files.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Replace our VsockPacket with the new one implemented in the
virtio-vsock crate.
Based on Alex Bennée and Laura Loghin commit:
https://github.com/stsquad/vhost-device/commit/6752266608dd
To achieve this the following changes where made:
- deleted the internal packet.rs
- convert the send_pkt/recv_pkt helpers to be BitmapSlice aware
- update push from LocalTxBuf
- tweak a few API calls due to minor diffs
Fixed tests and moved some helpers from the removed
vsock/src/packet.rs file.
Co-developed-by: Laura Loghin <lauralg@amazon.com>
Co-developed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>