From 3ad2bb40386e13f2bbd3baf38b293bece7e960e9 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Thu, 23 Jan 2025 10:35:22 +0800 Subject: [PATCH] v43: Init cloud-hypervisor Introduce `cloud-hypervisor.spec` to enable v43.0 cloud-hypervisor and its components to build on x86_64 and aarch64. Add v43 cloud-hypervisor and vendor tarball, track the tarballs with `git lfs`. Signed-off-by: Ruoqing He --- .gitattributes | 2 + .lfsconfig | 2 + cloud-hypervisor-43.0.tar.gz | 3 + cloud-hypervisor.spec | 110 +++++++++++++++++++++++++++++++++++ vendor.tar.gz | 3 + 5 files changed, 120 insertions(+) create mode 100644 .gitattributes create mode 100644 .lfsconfig create mode 100644 cloud-hypervisor-43.0.tar.gz create mode 100644 cloud-hypervisor.spec create mode 100644 vendor.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..efacd15 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +cloud-hypervisor-43.0.tar.gz filter=lfs diff=lfs merge=lfs -text +vendor.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000..9f26f2b --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/heruoqing/cloud-hypervisor diff --git a/cloud-hypervisor-43.0.tar.gz b/cloud-hypervisor-43.0.tar.gz new file mode 100644 index 0000000..bab7291 --- /dev/null +++ b/cloud-hypervisor-43.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:436572055bf2a4487526f085b361cd915a51388d3fc37c1429fd91fb7d8640b2 +size 978614 diff --git a/cloud-hypervisor.spec b/cloud-hypervisor.spec new file mode 100644 index 0000000..1f119a2 --- /dev/null +++ b/cloud-hypervisor.spec @@ -0,0 +1,110 @@ +# +# Copyright © 2024 Institute of Software, CAS. All rights reserved. +# + +%global debug_package %{nil} +%define VERSION 43.0 +%define RELEASE 0 + +Name: cloud-hypervisor +Version: %{VERSION} +Release: %{RELEASE} +Summary: A Virtual Machine Monitor +License: Apache-2.0 AND BSD-3-Clause +URL: https://cloudhypervisor.org +Source0: %{name}-%{version}.tar.gz +Source1: vendor.tar.gz + +BuildRequires: rust cargo +BuildRequires: bison +BuildRequires: flex +BuildRequires: git-core +BuildRequires: pkgconfig(libcap) +BuildRequires: pkgconfig(ossp-uuid) + +ExclusiveArch: aarch64 x86_64 + +%description +Cloud Hypervisor is an open source Virtual Machine Monitor (VMM) that runs on +top of the KVM hypervisor and the Microsoft Hypervisor (MSHV). + +The project focuses on running modern, Cloud Workloads, on specific, common, +hardware architectures. In this case Cloud Workloads refers to those that are +run by customers inside a Cloud Service Provider. This means modern operating +systems with most I/O handled by paravirtualised devices (e.g. virtio), no +requirement for legacy devices, and 64-bit CPUs. + +Cloud Hypervisor is implemented in Rust and is based on the Rust VMM crates. + +%package remote +Summary: Remote tool for accessing a cloud hypervisor instance + +%description remote +%{summary}. + +%prep +%autosetup -a1 + +%build +mkdir -p .cargo +cat > .cargo/config.toml << EOF +[source.crates-io] +replace-with = "vendored-sources" + +[source."git+https://github.com/firecracker-microvm/micro-http?branch=main"] +git = "https://github.com/firecracker-microvm/micro-http" +branch = "main" +replace-with = "vendored-sources" + +[source."git+https://github.com/rust-vmm/acpi_tables?branch=main"] +git = "https://github.com/rust-vmm/acpi_tables" +branch = "main" +replace-with = "vendored-sources" + +[source."git+https://github.com/rust-vmm/vfio-user?branch=main"] +git = "https://github.com/rust-vmm/vfio-user" +branch = "main" +replace-with = "vendored-sources" + +[source."git+https://github.com/rust-vmm/vfio?branch=main"] +git = "https://github.com/rust-vmm/vfio" +branch = "main" +replace-with = "vendored-sources" + +[source."git+https://github.com/rust-vmm/vhost?rev=d983ae0"] +git = "https://github.com/rust-vmm/vhost" +rev = "d983ae0" +replace-with = "vendored-sources" + +[source."git+https://github.com/rust-vmm/vm-fdt?branch=main"] +git = "https://github.com/rust-vmm/vm-fdt" +branch = "main" +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF + +cargo build --release + +%install +install -Dm0755 ./target/release/%{name} %{buildroot}%{_bindir}/%{name} +install -Dm0755 ./target/release/ch-remote %{buildroot}%{_bindir}/ch-remote + +%check +cargo test -- --test unit_tests:: + +%files +%license LICENSES/Apache-2.0.txt LICENSES/BSD-3-Clause.txt LICENSES/CC-BY-4.0.txt +%doc README.md +%caps(cap_net_admin+ep) %{_bindir}/%{name} + +%files remote +%license LICENSES/Apache-2.0.txt LICENSES/BSD-3-Clause.txt LICENSES/CC-BY-4.0.txt +%doc README.md +%{_bindir}/ch-remote + +%changelog +* Thu Jan 23 2025 heruoqing - 43.0-0 +- DESC: Introduce cloud-hypervisor (and ch-remote) aarch64 and x86_64 build. + diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..2f63d22 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69a5a15e3718eea47804e282fbeafdd7486b25830cddbaa9982c8f71fec05ff1 +size 54233065 -- Gitee