Commit Graph

10477 Commits

Author SHA1 Message Date
Bin Liu
c21a8d5ff8 kata-ctl: fix build error on s390x
Some type is not imported in s390x's mod file.

Fixes: #5987

Signed-off-by: Bin Liu <bin@hyper.sh>
2023-01-06 13:27:28 +08:00
Bin Liu
31abe170fc
Merge pull request #5984 from dcantah/schedcore-nonlinux
schedcore: Make buildable on !linux
2023-01-06 10:38:39 +08:00
Samuel Ortiz
3b4420eb8e runtime: Define Darwin handled signals list
Fixes: #5990

Some signals may not be defined on non Linux host OSes, like
SIGSTKFLT for example. It's also not defined on certain architectures,
but irrelevant for this.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-05 17:50:47 -08:00
Danny Canter
24b05a99b6 schedcore: Make buildable on !linux
Fixes: #5983

sched-core only makes sense on Linux hosts. Let's add stub/error for
other platforms.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-05 11:51:04 -08:00
Danny Canter
3886aad199 nydus: net-ns handling needs to be only executed on Linux hosts
Fixes: #5985

With nydus not being its own pkg, it is challenging to implement cleanly
in a virtcontainers package that isn't necesarily Linux-only. The
existing code utilizes network namespace code in order to ensure nydus
is launched in the host netns. This is very Linux specific - so let's
make sure we only carry this out in a linux specific file.

In the Darwin case, to allow for compilation at least, let's add a stub
for doNetNS. Ideally the nydus and vc code can be refactored /
decoupled.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-05 11:48:43 -08:00
Bin Liu
1b46d4fb50
Merge pull request #5611 from wllenyj/dragonball-ut-4
Built-in Sandbox: add more unit tests for dragonball. Part 4
2023-01-05 15:21:36 +08:00
Bin Liu
a40fca1f57
Merge pull request #5976 from yaoyinnan/5825/fix/cleanup-hypervisor
runtime-rs: cleanup the run dir of hypervisor when shut down
2023-01-05 15:14:21 +08:00
Zhongtao Hu
8c4c0d2715
Merge pull request #5467 from tzY15368/feat-katactl-direct-vol
Feat: implementation of kata-ctl direct-volume operations
2023-01-05 14:06:18 +08:00
Bin Liu
4ab9364aa6
Merge pull request #5946 from dcantah/clarify-var
Runtime: Clarify mutability of global var
2023-01-05 13:08:45 +08:00
Bin Liu
649d2d4b8d
Merge pull request #5964 from openanolis/kata-runtime
kata-runtime: add rust runtime path for kata-runtime exec
2023-01-05 09:35:21 +08:00
Fabiano Fidêncio
db372d8897
Merge pull request #5974 from likebreath/0103/clh_v28.1
versions: Upgrade to Cloud Hypervisor v28.1
2023-01-04 19:02:35 +01:00
yaoyinnan
e256903af2 runtime-rs: cleanup the run dir of hypervisor when shut down
Cleanup the run dir of hypervisor when shut down.

Fixes: #5825

Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
2023-01-04 22:36:39 +08:00
Bin Liu
e2c7e5f172
Merge pull request #5950 from openanolis/upcall_fea
runtime-rs: add dbs-upcall feature
2023-01-04 16:20:40 +08:00
Tingzhou Yuan
937a41346e kata-ctl: add unit tests for volume ops
Added table driven unit tests and
funcitionality test for functions in volume_ops.

`join_path` relies on safe_path::scoped_join
to validate the unsafe part of the input.
Testcase also takes into account the possibility of specially
constructed string that would get b64-encoded into path-like string.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2023-01-04 01:34:40 -05:00
Tingzhou Yuan
8451db7c0c kata-ctl: direct-volume: add Add and Remove handlers
This commit adds direct-volume command handlers for kata-ctl,
 including add, remove, stats and resize. Stats and resize
makes HTTP over UDS calls to runtime-rs while add and remove
 runs locally on the host.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>

kata-ctl: direct-volume: add Add and Remove handlers

This commit adds direct-volume command handlers for kata-ctl,
 including add, remove, stats and resize. Stats and resize
makes HTTP over UDS calls to runtime-rs while add and remove
 runs locally on the host.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2023-01-04 01:34:38 -05:00
Tingzhou Yuan
2d4b2cf72c runtime-rs: add POST method to shim-client
partly refactored shim-client to reuse code, added POST method
support, and made path string constants public for client imports.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2023-01-04 01:33:53 -05:00
Tingzhou Yuan
cae78a6851 kata-ctl: add constants for direct-volume commands
added direct-volume mountinfo struct and constant path strings to kata-types

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2023-01-04 01:33:51 -05:00
Bin Liu
38a6bc570d
Merge pull request #5947 from dcantah/yq-darwin
runtime/Makefile: Get some bits happy on darwin
2023-01-04 14:24:43 +08:00
Bin Liu
3bda4a8194
Merge pull request #5943 from liubin/fix/5942-remove-old-description
docs: remove old and misleading instructions for minikube
2023-01-04 12:02:53 +08:00
Bin Liu
5b11201848
Merge pull request #5945 from liubin/fix/5944-indents
packaging: fix indents in build-kernel.sh
2023-01-04 11:00:49 +08:00
Bo Chen
652021ad95 versions: Upgrade to Cloud Hypervisor v28.1
This patch upgrade Cloud Hypervisor to its latest bug release v28.1:
https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v28.1

Fixes: #5973

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-01-03 14:09:44 -08:00
Fabiano Fidêncio
156e4e673b
Merge pull request #5908 from Alex-Carter01/kmod_warning
kernel: adding kmod to do docker env
2023-01-03 20:35:22 +01:00
Fabiano Fidêncio
67f0fd505d
Merge pull request #5967 from fidencio/topic/bump-rust-toolchain-to-1.66.0
versions: Update the rust toolchain to 1.66.0
2023-01-03 18:50:16 +01:00
Fabiano Fidêncio
5f5f6ce7a7
Merge pull request #5951 from liubin/fix/5948-check_latest_version
kata-ctl: skip test if access GitHub.com fail
2023-01-03 18:49:57 +01:00
Peng Tao
d085389127 vc: fix up UT for CreateSandbox API change
Need to adapt the UT as well.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2023-01-03 22:30:42 +08:00
Peng Tao
578a9c25f0 vc: rescan network endpoints after running prestart hooks
Moby relies on the prestart hooks to configure network endpoints. We
should rescan the netns after running them so that the newly added
endpoints can be found and plugged to the guest.

Fixes: #5941
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2023-01-03 22:30:41 +08:00
Fabiano Fidêncio
a3e1257708
Merge pull request #5891 from jtumber-ibm/foreign-cc
agent: unset `CC` for cross-build
2023-01-03 14:38:24 +01:00
Peng Tao
cb84b0fb02 katautils: run prestart hooks after starting VM
So that we can pass the hypervisor pid to the hook instead of the
runtime process's.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2023-01-03 10:52:32 +00:00
Fabiano Fidêncio
079462d2eb runk: Fix needless_borrow warning
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 17:14:13 +01:00
Fabiano Fidêncio
2c24fcf34c runtime-rs: Fix clippy::bool-to-int-with-if warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to boolean to int conversion using if.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 17:14:13 +01:00
Fabiano Fidêncio
025e78341e runtime-rs: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 17:14:13 +01:00
Fabiano Fidêncio
4fb163d570 runtime-rs: Allow clippy:box_default warnings
As the rust toolchain version bump to its 1.66.0 release raised a
warning about using Box::default() instead of specifying a type.

For now that's something we don't need to change, so let's ignore such
warning in this very specific case.

See:
https://rust-lang.github.io/rust-clippy/master/index.html#box_default

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 17:14:01 +01:00
Fabiano Fidêncio
20121fcda7 runtime-rs: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
 raised due to unnecessary_cast.

 Let's fix them all here.

 For more info about the warnings, please, take a look at:
 https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 16:16:39 +01:00
Fabiano Fidêncio
b95364a140 dragonball: Allow question_mark warning in allocate_device_resources()
As the rust toolchain version bump to its 1.66.0 release raised a
warning about the code being able to be refactored to use `?`.

For now that's something we don't need to change, so let's ignore such
warning in this very specific case.

See:
https://rust-lang.github.io/rust-clippy/master/index.html#question_mark

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 15:55:49 +01:00
Fabiano Fidêncio
0b2f060bf3 dragonball: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to unnecessary_cast.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 15:55:42 +01:00
Fabiano Fidêncio
a545a65934 agent: Allow clippy::question_mark warning in Namespace{}
As the rust toolchain version bump to its 1.66.0 release raised a
warning about the code being able to be refactored to use `?`.

For now that's something we don't need to change, so let's ignore such
warning in this very specific case.

See:
https://rust-lang.github.io/rust-clippy/master/index.html#question_mark

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 15:22:20 +01:00
Fabiano Fidêncio
9ced34dd22 agent: Fix explicit_auto_deref warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to explicit_auto_deref.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:59:50 +01:00
Fabiano Fidêncio
f77220490e agent: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:58:13 +01:00
Fabiano Fidêncio
7bcdc9049a rustjail: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to unnecessary_cast.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:42:58 +01:00
Fabiano Fidêncio
41d7dbaaea rustjail: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:42:25 +01:00
Fabiano Fidêncio
2a73e057db kata-types: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to unnecessary_cast.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
cf9ef1833c kata-types: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
126187e814 safe-path: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
bb78d35db8 kata-sys-util: Fix "match-like-matches-macro" warning
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to "match-like-matches-macro".

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
668e652401 kata-sys-util: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to unnecessary_cast.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
c1a8d89a72 kata-sys-util: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
c9c38e6d01 logging: Allow clippy::type-complexity warning
As the rust toolchain version bump to its 1.66.0 release raised a
warning about the type complexity used for the closure, and that's
something we don't want to change, let's ignore such warning in this
very specific case.

See:
https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:28:07 +01:00
Fabiano Fidêncio
ffd6fbb6b6 logging: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:18:14 +01:00
Fabiano Fidêncio
60df30015b protocols: Fix unnecessary_cast warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to unnecessary_cast.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 14:18:14 +01:00
Danny Canter
56e7b5d0fd runtime/Makefile: Get some bits happy on darwin
Substitution in the yq install script doesn't like zsh, and additionally
the version of yq we're using doesn't have a darwin/arm64 build so grab
the amd64 version and let rosetta work its magic.

Additionally swap to abspath from readlink -m for the printing of what binaries
to install, as the -m flag doesn't exist on the BSD variant, and this
should be the same behavior.

Fixes: #5970

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-02 04:19:58 -08:00