From ae2255c197ac795fcee8671ea2c60cce04d5d0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BB=81=E9=B9=8F?= <2110459069@qq.com> Date: Thu, 30 May 2024 14:48:12 +0800 Subject: [PATCH] feat: add copyright and Supplement readme content --- README.ch.md | 2 ++ README.md | 2 ++ cli/src/blk.rs | 10 ++++++++++ cli/src/config.rs | 10 ++++++++++ cli/src/config_arg.rs | 10 ++++++++++ cli/src/daemon.rs | 10 ++++++++++ cli/src/ioctl_arg.rs | 10 ++++++++++ cli/src/main.rs | 10 ++++++++++ cli/src/sys.rs | 10 ++++++++++ cli/src/util.rs | 10 ++++++++++ cli/src/vmm.rs | 10 ++++++++++ 11 files changed, 94 insertions(+) diff --git a/README.ch.md b/README.ch.md index 0d0defe..2ca72c7 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 ae4668e..a7b7267 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 389796a..414ae4f 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 23da528..4c45199 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 4de1610..89b9fea 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 17ced4c..98770b7 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 edfe086..66352d0 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 b904166..27d5cd4 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 6817bbd..b4a2411 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 5c25982..615b760 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 350faae..fed206e 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}; -- Gitee