diff --git a/README.ch.md b/README.ch.md index 0d0defe1b951c0d8312a463f89920000cec99f16..2ca72c78d4122608acdf3b1c8e779befac6e5ccf 100644 --- a/README.ch.md +++ b/README.ch.md @@ -67,6 +67,8 @@ insmod tools/shyper.ko 注:shyper-cli是Rust-Shyper配套的一个简单的命令行工具,以二进制的形式提供在tools目录下,其编译的目标平台为aarch64。 +> `cli`目录下是Rust版本的cli工具源码,您可以用cli目录下的源码在您所在的平台上编译,得到shyper-cli可执行文件,然后用其代替 `tools/shyper-cli` 进行后续的虚拟机管理操作。 + ```bash sudo tools/shyper system daemon [mediated-cfg.json] & ``` diff --git a/README.md b/README.md index ae4668e453c9163d4250b29f3b04f2064a5db211..a7b726703256a21bf537aa26e4e95298cdabb2b6 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ The kernel module on NVIDIA L4T 32.6.1 (for Jestion TX2), Linux 4.9.140/5.10.160 When starting Rust-Shyper, the MVM will boot automatically. Logging on to the MVM (a Linux priviledged VM), take the QEMU configuration as an example, then can we configure and start the Guest VMs. +> The `cli` directory contains the Rust version of the cli tool source code, which you can use to compile on your platform, obtain the shyper-cli executable file, and then use it in place of the `tools/shyper-cli` for subsequent virtual machine management operations. + **Step 1**: Install the kernel module ```bash diff --git a/cli/src/blk.rs b/cli/src/blk.rs index 389796a621a4f7ae3e509c18d25ea692a151651f..414ae4fc505c5c78bcab0be54a2eb43e6b5059b7 100644 --- a/cli/src/blk.rs +++ b/cli/src/blk.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use std::{ fs, os::linux::fs::MetadataExt, diff --git a/cli/src/config.rs b/cli/src/config.rs index 23da5281c4a8fa03ebd805216caa9b46b63814e0..4c4519997c0cc488ae446c89e7f28388f3ceaba1 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use std::{ fs::{File, OpenOptions}, io::BufReader, diff --git a/cli/src/config_arg.rs b/cli/src/config_arg.rs index 4de161024040c9c87f7aa5e0dc490d29baf3340d..89b9feacc0001065dcfe79e2e2a647b90dc44304 100644 --- a/cli/src/config_arg.rs +++ b/cli/src/config_arg.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + #[repr(C)] pub struct VmAddConfigArg { pub vm_name_addr: u64, diff --git a/cli/src/daemon.rs b/cli/src/daemon.rs index 17ced4ce1b4ba8d2e0cc0053ace6fa3afcf09c7a..98770b7b7c5c185997a14238671d30339acfaab1 100644 --- a/cli/src/daemon.rs +++ b/cli/src/daemon.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use std::{ fs::{self, File}, io::Read, diff --git a/cli/src/ioctl_arg.rs b/cli/src/ioctl_arg.rs index edfe086f758384db74a70b252558f5180abf595a..66352d09b66d51c34a54d9f47320386e2b2ad35a 100644 --- a/cli/src/ioctl_arg.rs +++ b/cli/src/ioctl_arg.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + pub const IOCTL_SYS: usize = 0x10; // ioctl_sys_event diff --git a/cli/src/main.rs b/cli/src/main.rs index b90416651f733c78f9ff418268a41d43db582fe9..27d5cd4efd0d56ad985c358574604bac0cbd0d08 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + mod blk; mod config; mod config_arg; diff --git a/cli/src/sys.rs b/cli/src/sys.rs index 6817bbdc56948f0fc0830f8fdbe178318922f5c2..b4a2411ea258f21d5d15f1a71e57bb1163e4aa80 100644 --- a/cli/src/sys.rs +++ b/cli/src/sys.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use libc::{ c_void, close, ioctl, lseek, open, read, size_t, MAP_LOCKED, MAP_SHARED, O_RDONLY, O_RDWR, PROT_READ, PROT_WRITE, SEEK_SET, diff --git a/cli/src/util.rs b/cli/src/util.rs index 5c259822fefd1afcfe5b6dcfb85e27e2df1f16a4..615b7605cea399ee7ca99622f899e540014ac5d2 100644 --- a/cli/src/util.rs +++ b/cli/src/util.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use std::{ ffi::CString, fs::File, diff --git a/cli/src/vmm.rs b/cli/src/vmm.rs index 350faaef0e0c22f8402f12f4df23e22f0b35b6d2..fed206e6aacafb914b42c7f4b456a3565a3070bb 100644 --- a/cli/src/vmm.rs +++ b/cli/src/vmm.rs @@ -1,3 +1,13 @@ +// Copyright (c) 2023 Beihang University, Huawei Technologies Co.,Ltd. All rights reserved. +// Rust-Shyper is licensed under Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +// See the Mulan PSL v2 for more details. + use std::mem; use libc::{close, ioctl, open, O_RDWR};