Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage fixes for crate features and autogenerated files #37

Merged
merged 3 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coverage_config_aarch64.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"coverage_score": 80.8,
"exclude_path": "",
"crate_features": ""
"crate_features": "pe"
}
5 changes: 3 additions & 2 deletions coverage_config_x86_64.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"coverage_score": 78.7,
"coverage_score": 84.8,
"exclude_path": "",
"crate_features": ""
"crate_features": "bzimage,elf",
"exclude_path": "loader_gen"
}
2 changes: 1 addition & 1 deletion rust-vmm-ci
2 changes: 1 addition & 1 deletion src/configurator/x86_64/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl BootConfigurator for LinuxBootConfigurator {
#[cfg(test)]
mod tests {
use super::*;
use crate::loader::bootparam::boot_params;
use crate::loader_gen::bootparam::boot_params;
use std::mem;
use vm_memory::{Address, GuestAddress, GuestMemoryMmap};

Expand Down
2 changes: 1 addition & 1 deletion src/configurator/x86_64/pvh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use vm_memory::{ByteValued, Bytes, GuestMemory};

use crate::configurator::{BootConfigurator, BootParams, Error as BootConfiguratorError, Result};
use crate::loader::elf::start_info::{hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info};
use crate::loader_gen::start_info::{hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info};

use std::error::Error as StdError;
use std::fmt;
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,9 @@ pub mod cmdline;
pub mod configurator;
pub mod loader;

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod loader_gen;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use loader_gen::*;

extern crate vm_memory;
10 changes: 1 addition & 9 deletions src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@ use std::io::{Read, Seek};
use vm_memory::ByteValued;
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestUsize};

#[allow(dead_code)]
#[allow(non_camel_case_types)]
#[allow(non_snake_case)]
#[allow(non_upper_case_globals)]
#[allow(missing_docs)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
// Hide the autogenerated documentation for bindgen'ed sources.
#[doc(hidden)]
pub mod bootparam;
pub use crate::loader_gen::bootparam;

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod x86_64;
Expand Down
15 changes: 3 additions & 12 deletions src/loader/x86_64/elf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ use std::mem;

use vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestUsize};

use super::super::{Error as KernelLoaderError, KernelLoader, KernelLoaderResult, Result};

#[allow(dead_code)]
#[allow(non_camel_case_types)]
#[allow(non_snake_case)]
#[allow(non_upper_case_globals)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
mod elf;

#[allow(missing_docs)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
pub mod start_info;
use crate::loader::{Error as KernelLoaderError, KernelLoader, KernelLoaderResult, Result};
use crate::loader_gen::elf;
pub use crate::loader_gen::start_info;

unsafe impl ByteValued for elf::Elf64_Ehdr {}
unsafe impl ByteValued for elf::Elf64_Nhdr {}
Expand Down
15 changes: 15 additions & 0 deletions src/loader_gen/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2019 Intel Corporation. All rights reserved.
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-BSD-3-Clause file.
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause

//! Bindgen autogenerated structs for boot parameters.

#![cfg(any(target_arch = "x86", target_arch = "x86_64"))]

mod x86_64;
pub use x86_64::*;
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions src/loader_gen/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2019 Intel Corporation. All rights reserved.
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-BSD-3-Clause file.
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause

//! Bindgen autogenerated structs for `x86_64` boot parameters.

#![cfg(any(target_arch = "x86", target_arch = "x86_64"))]

#![cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

// Hide the autogenerated documentation for bindgen'ed sources.
#[doc(hidden)]
pub mod bootparam;

#[cfg(feature = "elf")]
pub mod elf;

#[cfg(feature = "elf")]
pub mod start_info;