Commit Graph

9042 Commits

Author SHA1 Message Date
Pavel Mores
cf785a1a23 runtime-rs: add core toml::Value tree merging
This is the core functionality of merging config file fragments into the
base config file.  Our TOML parser crate doesn't seem to allow working
at the level of TomlConfig instances like BurntSushi, used in the Golang
runtime, does so we implement the required functionality at the level of
toml::Value trees.

Tests to verify basic requirements are included.  Values set by a base
config file and not touched by a subsequent drop-in should be preserved.
Drop-in config file fragments should be able to change values set by the
base config file and add settings not present in the base.  Conversion
of a merged tree into a mock TomlConfig-style structure is tested as
well.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-08-19 11:01:29 +02:00
Peng Tao
5457deb034
Merge pull request #4741 from openanolis/fix-stop-failed-in-azure
runtime-rs: fix stop failed in azure
2022-07-29 11:41:16 +08:00
Quanwei Zhou
fa0b11fc52 runtime-rs: fix stdin hang in azure
Fix stdin hang in azure.

Fixes: #4740
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-28 16:16:37 +08:00
Bin Liu
50b0b7cc15
Merge pull request #4681 from Tim-0731-Hzt/runtime-rs-sharepid
runtime-rs: fix set share sandbox pid namespace
2022-07-27 21:43:58 +08:00
Peng Tao
129335714b
Merge pull request #4727 from openanolis/anolis-fix-network
fix network failed for kata ci
2022-07-26 15:10:55 +08:00
Peng Tao
71384b60f3
Merge pull request #4713 from openanolis/adjust_default_vcpu
runtime-rs: handle default_vcpus greator than default_maxvcpu
2022-07-26 15:02:34 +08:00
Zhongtao Hu
b3147411e3 runtime-rs:add unit test for set share pid ns
Fixes:#4680
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-26 14:42:00 +08:00
Zhongtao Hu
1ef3f8eac6 runtime-rs: set share sandbox pid namespace
Set the share sandbox pid namepsace from spec

Fixes:#4680
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-26 14:41:59 +08:00
Quanwei Zhou
57c556a801 runtime-rs: fix stop failed in azure
Fix the stop failed in azure.

Fixes: #4740
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-26 12:16:32 +08:00
Peng Tao
3f4dd92c2d
Merge pull request #4702 from openanolis/runtime-rs-endpoint-dev
runtime-rs: add functionalities support for macvlan and vlan endpoints
2022-07-25 17:04:45 +08:00
Peng Tao
a3127a03f3
Merge pull request #4721 from openanolis/install-guide-2
Docs: add rust environment setup for kata 3.0
2022-07-25 16:50:20 +08:00
Quanwei Zhou
c825065b27 runtime-rs: fix tc filter setup failed
Fix bug using tc filter and protocol needs to use network byte order.

Fixes: #4726
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-25 11:16:33 +08:00
Quanwei Zhou
e0194dcb5e runtime-rs: update route destination with prefix
Update route destination with prefix.

Fixes: #4726
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-25 11:16:22 +08:00
Bin Liu
534a4920b1
Merge pull request #4692 from openanolis/support_disable_guest_seccomp
support disable_guest_seccomp
2022-07-25 11:08:41 +08:00
Zhongtao Hu
fa85fd584e docs: add rust environment setup for kata 3.0
add more details for rust set up in kata 3.0 install guide

Fixes: #4720
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-25 09:48:18 +08:00
Ji-Xinyou
896478c92b runtime-rs: add functionalities support for macvlan and vlan endpoints
Add macvlan and vlan support to runtime-rs code and corresponding unit
tests.

Fixes: #4701
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-07-22 10:09:11 +08:00
Zhongtao Hu
43045be8d1 runtime-rs: handle default_vcpus greator than default_maxvcpu
when the default_vcpus is greater than the default_maxvcpus, the default
vcpu number should be set equal to the default_maxvcpus.

Fixes: #4712
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-21 16:37:56 +08:00
Quanwei Zhou
54f53d57ef runtime-rs: support disable_guest_seccomp
support disable_guest_seccomp

Fixes: #4691
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-21 07:46:28 +08:00
Bin Liu
540303880e
Merge pull request #4688 from quanweiZhou/fix_sandbox_cgroup_false
runtime-rs: fix sandbox_cgroup_only=false panic
2022-07-19 20:38:57 +08:00
Peng Tao
7c146a5d95
Merge pull request #4684 from quanweiZhou/fix-ctr-exit-error
runtime-rs: fix ctr exit failed
2022-07-19 16:02:20 +08:00
Peng Tao
08a6581673
Merge pull request #4662 from openanolis/runtime-rs-user-manaul
docs: add installation guide for kata 3.0
2022-07-19 15:58:55 +08:00
Zhongtao Hu
4331ef80d0 Runtime-rs: add installation guide for rust-runtime
add installation guide for rust-runtime

Fixes:#4661
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-19 13:12:13 +08:00
Peng Tao
4c3bd6b1d1
Merge pull request #4656 from openanolis/runtime-rs-ipvlan
runtime-rs: support functionalities of ipvlan endpoint
2022-07-19 11:15:31 +08:00
Bin Liu
960f2a7f70
Merge pull request #4678 from Tim-0731-Hzt/runtime-rs-makefile-2
runtime-rs: remove the value of hypervisor path in DB config
2022-07-19 09:34:45 +08:00
Quanwei Zhou
e9988f0c68 runtime-rs: fix sandbox_cgroup_only=false panic
When run with configuration `sandbox_cgroup_only=false`, we will call
`gen_overhead_path()` as the overhead path. The `cgroup-rs` will push
the path with the subsystem prefix by `PathBuf::push()`. When the path
has prefix “/” it will act as root path, such as
```
let mut path = PathBuf::from("/tmp");
path.push("/etc");
assert_eq!(path, PathBuf::from("/etc"));
```
So we shoud not set overhead path with prefix "/".

Fixes: #4687
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-19 08:30:34 +08:00
Quanwei Zhou
cebbebbe8a runtime-rs: fix ctr exit failed
During use, there will be cases where the container is in the stop state
and get another stop. In this case, the second stop needs to be ignored.

Fixes: #4683
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-19 07:43:22 +08:00
Bin Liu
758cc47b32
Merge pull request #4671 from liubin/4670-upgrade-nix
kata-sys-util: upgrade nix version
2022-07-18 23:31:07 +08:00
Bin Liu
25be4d00fd
Merge pull request #4676 from openanolis/xuejun/runtime-rs
runtime-rs: fix some bugs to make runtime-rs on aarch64
2022-07-18 23:29:32 +08:00
Ji-Xinyou
62182db645 runtime-rs: add unit test for ipvlan endpoint
Add unit test to check the integrity of IPVlanEndpoint::new(...)

Fixes: #4655
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-07-18 15:56:06 +08:00
xuejun-xj
99654ce694 runtime-rs: update dbs-xxx dependencies
Update dbs-xxx commit ID for aarch64 in runtime-rs/Cargo.toml file to add
dependencies for aarch64.

Fixes: #4676

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
2022-07-18 13:46:46 +08:00
xuejun-xj
f4c3adf596 runtime-rs: Add compile option file
Add file aarch64-options.mk for compiling on aarch64 architectures.

Fixes: #4676

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
2022-07-18 13:46:46 +08:00
xuejun-xj
545ae3f0ee runtime-rs: fix warning
Module anyhow::anyhow is only used on x86_64 architecture in
crates/hypervisor/src/device/vfio.rs file.

Fixes: #4676

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
2022-07-18 13:46:39 +08:00
Zhongtao Hu
19eca71cd9 runtime-rs: remove the value of hypervisor path in DB config
As a built in VMM, Path, jailer path, ctlpath are not needed for
Dragonball. So we don't generate those value in Makefile.

Fixes: #4677
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-18 13:37:51 +08:00
Ji-Xinyou
d8920b00cd runtime-rs: support functionalities of ipvlan endpoint
Add support for ipvlan endpoint

Fixes: #4655
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-07-18 11:34:03 +08:00
xuejun-xj
2b01e9ba40 dragonball: fix warning
Add map_err for vcpu_manager.set_reset_event_fd() function.

Fixes: #4676

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
2022-07-18 09:52:13 +08:00
liubin
996a6b80bc kata-sys-util: upgrade nix version
New nix is supporting UMOUNT_NOFOLLOW, upgrade nix
version to use this flag instead of the self-defined flag.

Fixes: #4670

Signed-off-by: liubin <liubin0329@gmail.com>
2022-07-15 17:38:15 +08:00
Bin Liu
9f49f7adca
Merge pull request #4493 from openanolis/runtime-rs-dev
runtime-rs: hypervisor part
2022-07-14 13:49:34 +08:00
Quanwei Zhou
3c989521b1 dragonball: update for review
update for review

Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-07-14 10:43:59 +08:00
wllenyj
274598ae56 kata-runtime: add dragonball config check support.
add dragonball config check support.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-07-14 10:43:50 +08:00
Chao Wu
1befbe6738 runtime-rs: Cargo lock for fix version problem
Cargo lock for fix version problem

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-14 08:49:39 +08:00
Quanwei Zhou
3d6156f6ec runtime-rs: support dragonball and runtime-binary
Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-14 08:49:30 +08:00
Zhongtao Hu
3f6123b4dd libs: update configuration and annotations
1. support annotation for runtime.name, hypervisor_name, agent_name.
2. fix parse memory from annotation

Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-14 08:49:17 +08:00
Bin Liu
f3335c99ce
Merge pull request #4614 from Tim-0731-Hzt/runtime-rs-merge-main
Runtime-rs merge main
2022-07-12 19:25:11 +08:00
Bin Liu
b424cf3c90
Merge pull request #4544 from openanolis/anolis/virtio_device_aarch64
runtime-rs: Dragonball-sandbox - add virtio device feature support for aarch64
2022-07-12 12:39:31 +08:00
xuejun-xj
d2584991eb dragonball: fix dependency unused warning
Fix the warning "unused import: `dbs_arch::gic::Error as GICError`" and
"unused import: `dbs_arch::gic::GICDevice`" in file src/vm/mod.rs when
compiling.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-11 17:55:04 +08:00
xuejun-xj
458f6f42f6 dragonball: use const string for legacy device type
As string "com1", "com2" and "rtc" are used in two files
(device_manager/mod.rs and device_manager/legacy.rs), we use public
const variables COM1, COM2 and RTC to replace them respectively.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-11 17:46:10 +08:00
James O. D. Hunt
58b0fc4794
Merge pull request #4192 from Tim-0731-Hzt/runtime-rs
kata 3.0 Architecture
2022-07-11 09:34:17 +01:00
Zhongtao Hu
0826a2157d Merge remote-tracking branch 'origin/main' into runtime-rs-1
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-11 09:47:23 +08:00
Zhongtao Hu
939959e726 docs: add Dragonball to hypervisors
Fixes:#4193
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-11 09:38:17 +08:00
xuejun-xj
f6f96b8fee dragonball: add legacy device support for aarch64
Implement RTC device for aarch64.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-10 17:35:30 +08:00