libs/sys-util: add kata-sys-util crate under src/libs

The kata-sys-util crate is a collection of modules that provides helpers
and utilities used by multiple Kata Containers components.

Fixes: #3305

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
This commit is contained in:
Liu Jiang 2021-12-08 23:09:13 +08:00 committed by Fupan Li
parent 48c201a1ac
commit 45a00b4f02
6 changed files with 43 additions and 19 deletions

24
src/libs/Cargo.lock generated
View File

@ -89,7 +89,6 @@ dependencies = [
"libc",
"num-integer",
"num-traits",
"time",
"winapi",
]
@ -307,6 +306,10 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
[[package]]
name = "kata-sys-util"
version = "0.1.0"
[[package]]
name = "kata-types"
version = "0.1.0"
@ -382,7 +385,7 @@ dependencies = [
"log",
"miow",
"ntapi",
"wasi 0.11.0+wasi-snapshot-preview1",
"wasi",
"winapi",
]
@ -810,17 +813,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "time"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi",
]
[[package]]
name = "tokio"
version = "1.17.0"
@ -938,12 +930,6 @@ dependencies = [
"nix 0.23.1",
]
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"

View File

@ -2,6 +2,7 @@
members = [
"logging",
"kata-types",
"kata-sys-util",
"safe-path",
"protocols",
"oci",

View File

@ -7,5 +7,6 @@ Currently it provides following library crates:
| Library | Description |
|-|-|
| [logging](logging/) | Facilities to setup logging subsystem based on slog. |
| [system utilities](kata-sys-util/) | Collection of facilities and helpers to access system services. |
| [types](kata-types/) | Collection of constants and data types shared by multiple Kata Containers components. |
| [safe-path](safe-path/) | Utilities to safely resolve filesystem paths. |

View File

@ -0,0 +1,13 @@
[package]
name = "kata-sys-util"
version = "0.1.0"
description = "System Utilities for Kata Containers"
keywords = ["kata", "container", "runtime"]
authors = ["The Kata Containers community <kata-dev@lists.katacontainers.io>"]
repository = "https://github.com/kata-containers/kata-containers.git"
homepage = "https://katacontainers.io/"
readme = "README.md"
license = "Apache-2.0"
edition = "2018"
[dependencies]

View File

@ -0,0 +1,19 @@
# kata-sys-util
This crate is a collection of utilities and helpers for
[Kata Containers](https://github.com/kata-containers/kata-containers/) components to access system services.
It provides safe wrappers over system services, such as:
- cgroups
- file systems
- mount
- NUMA
## Support
**Operating Systems**:
- Linux
## License
This code is licensed under [Apache-2.0](../../../LICENSE).

View File

@ -0,0 +1,4 @@
// Copyright (c) 2021 Alibaba Cloud
//
// SPDX-License-Identifier: Apache-2.0
//