diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..a30a4bb117f9893a30f356b6ce2432af6307a5b2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +cloud-hypervisor-v45.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 0000000000000000000000000000000000000000..b27da5929563a76371f0b8ce8c3f44ef3626f3b7 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/nieyuting/cloud-hypervisor diff --git a/cloud-hypervisor-45.0.tar.gz b/cloud-hypervisor-45.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1e94f798eb98c5e99295198e2b3b440399413152 Binary files /dev/null and b/cloud-hypervisor-45.0.tar.gz differ diff --git a/cloud-hypervisor.spec b/cloud-hypervisor.spec new file mode 100644 index 0000000000000000000000000000000000000000..d06deb2b1c6066118dbccf93e8155640adc11f7e --- /dev/null +++ b/cloud-hypervisor.spec @@ -0,0 +1,111 @@ +# +# Copyright © 2024 Institute of Software, CAS. All rights reserved. +# + +%global debug_package %{nil} +%define VERSION 45.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 Apr 10 2025 nieyuting - 45.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 0000000000000000000000000000000000000000..91c8326f6decdd6d636ef3cc5ef4478dd8454ff1 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03449dfa40818df1827498a2e145feb9dab0d37b9a666cdfdddb411f806c5056 +size 54854352