From 3613b4c0960aa9923ac9ca03fadd2ab5b6a69583 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Thu, 24 Jun 2021 10:49:04 +0800 Subject: [PATCH] aarch64: Enable default build option We have been building Cloud Hypervisor with command like: `cargo build --no-default-features --features ...`. After implementing ACPI, we donot have to use specify all features explicitly. Default build command `cargo build` can work. This commit fixed some build warnings with default build option and changed github workflow correspondingly. Signed-off-by: Michael Zhao --- .github/workflows/quality-aarch64.yaml | 22 ++++++++++++++++++++++ vmm/src/cpu.rs | 4 ++++ vmm/src/device_manager.rs | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quality-aarch64.yaml b/.github/workflows/quality-aarch64.yaml index 4edc47b2f..9b7af0763 100644 --- a/.github/workflows/quality-aarch64.yaml +++ b/.github/workflows/quality-aarch64.yaml @@ -31,9 +31,31 @@ jobs: components: rustfmt, clippy - name: Formatting (rustfmt) run: cargo fmt -- --check + - name: Clippy (kvm) uses: actions-rs/cargo@v1 with: use-cross: true command: clippy args: --target=${{ matrix.target }} --no-default-features --features "kvm" -- -D warnings + + - name: Clippy (kvm,acpi) + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: clippy + args: --target=${{ matrix.target }} --no-default-features --features "kvm,acpi" -- -D warnings + + - name: Clippy (all features,kvm) + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: clippy + args: --target=${{ matrix.target }} --no-default-features --features "common,kvm" -- -D warnings + + - name: Clippy (default) + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: clippy + args: --target=${{ matrix.target }} -- -D warnings diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index c8ca75839..8c8d11707 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -173,6 +173,7 @@ struct Ioapic { } #[cfg(all(target_arch = "aarch64", feature = "acpi"))] +#[allow(dead_code)] #[repr(packed)] struct GicC { pub r#type: u8, @@ -196,6 +197,7 @@ struct GicC { } #[cfg(all(target_arch = "aarch64", feature = "acpi"))] +#[allow(dead_code)] #[repr(packed)] struct GicD { pub r#type: u8, @@ -209,6 +211,7 @@ struct GicD { } #[cfg(all(target_arch = "aarch64", feature = "acpi"))] +#[allow(dead_code)] #[repr(packed)] struct GicR { pub r#type: u8, @@ -219,6 +222,7 @@ struct GicR { } #[cfg(all(target_arch = "aarch64", feature = "acpi"))] +#[allow(dead_code)] #[repr(packed)] struct GicIts { pub r#type: u8, diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index ee0d7751d..2b4222e8c 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -97,7 +97,7 @@ use vm_memory::guest_memory::FileOffset; #[cfg(feature = "kvm")] use vm_memory::GuestMemoryRegion; use vm_memory::{Address, GuestAddress, GuestUsize, MmapRegion}; -#[cfg(feature = "cmos")] +#[cfg(all(target_arch = "x86_64", feature = "cmos"))] use vm_memory::{GuestAddressSpace, GuestMemory}; use vm_migration::{ Migratable, MigratableError, Pausable, Snapshot, SnapshotDataSection, Snapshottable,