Skip to content

Commit

Permalink
Make license headers consistent (and checked)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmooney committed Jul 21, 2023
1 parent 1ee4175 commit 4145083
Show file tree
Hide file tree
Showing 166 changed files with 673 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
run: cargo clippy -- --version
- name: Check clippy
run: cargo xtask clippy --strict
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check license headers
uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff
build-docs:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 12 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
header:
license:
spdx-id: MPL-2.0

content: |
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
paths:
- '**/*.rs'

comment: on-failure
4 changes: 4 additions & 0 deletions bin/propolis-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::fs::File;
use std::io::BufReader;
use std::path::{Path, PathBuf};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Describes a server config which may be parsed from a TOML file.

use std::num::NonZeroUsize;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/initializer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::convert::TryInto;
use std::fs::File;
use std::io::{Error, ErrorKind};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// always present
pub mod config;
#[cfg(any(test, feature = "mock-only"))]
Expand Down
6 changes: 4 additions & 2 deletions bin/propolis-server/src/lib/migrate/codec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Copyright 2021 Oxide Computer Company
//!
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Support for encoding messages in the propolis/bhyve live
//! migration protocol. Messages are serialized to binary and
//! wrapped in Binary websocket frames with a trailing byte
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/destination.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use bitvec::prelude as bv;
use futures::{SinkExt, StreamExt};
use propolis::common::{GuestAddr, PAGE_SIZE};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/memx.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use crate::migrate::codec;

// The bitmap data structure uses a single bit to represent
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::sync::Arc;

use bit_field::BitField;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/preamble.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use propolis_client::instance_spec::{
BackendNames, DeviceSpec, InstanceSpec, MigrationCompatibilityError,
};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/protocol.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Functions for dealing with protocol negotiation.
//!
//! Protocols are identified by strings of the form
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/migrate/source.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use futures::{SinkExt, StreamExt};
use propolis::common::{GuestAddr, PAGE_SIZE};
use propolis::inventory::Order;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/mock_server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Implementation of a mock Propolis server

use base64::Engine;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/serial/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Routines to expose a connection to an instance's serial port.

#![cfg_attr(feature = "mock-only", allow(unused))]
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! HTTP server callback functions.
//!
//! Functions in this module verify parameters and convert between types (API
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/spec.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Helper functions for building instance specs from server parameters.

use std::str::FromStr;
Expand Down
6 changes: 4 additions & 2 deletions bin/propolis-server/src/lib/stats.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Methods for starting an Oximeter endpoint and gathering server-level stats.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// Copyright 2022 Oxide Computer Company
//! Methods for starting an Oximeter endpoint and gathering server-level stats.

use anyhow::anyhow;
use dropshot::{
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/vcpu_tasks.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Tasks for vCPU backing threads and controls for them.

use std::sync::{
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/vm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Implements the VM controller: the public interface to a single Propolis
//! instance.
//!
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/vm/request_queue.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Handles requests to change a Propolis server's state via the external API.
//!
//! An instance accepts or rejects requests to change state based on a
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/vm/state_driver.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::sync::Arc;

use crate::migrate::MigrateError;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/lib/vnc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use async_trait::async_trait;
use propolis::common::GuestAddr;
use propolis::hw::ps2::ctrl::PS2Ctrl;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![cfg_attr(feature = "mock-only", allow(unused))]

use anyhow::{anyhow, Context};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-standalone/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::num::NonZeroUsize;
use std::str::FromStr;
use std::sync::Arc;
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-standalone/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::collections::VecDeque;
use std::fs::File;
use std::io::{Error, ErrorKind, Result};
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-standalone/src/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Routines and types for saving and restoring a snapshot of a VM.
//!
//! TODO(luqmana) do this in a more structed way, it's a fun mess of
Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-utils/src/bin/cpuid-gen.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::cmp::{Ord, Ordering};
use std::collections::BTreeMap;

Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-utils/src/bin/rsrvrctl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use bhyve_api::{ReservoirError, VmmCtlFd};
use clap::Parser;

Expand Down
4 changes: 4 additions & 0 deletions bin/propolis-utils/src/bin/savex.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::convert::{TryFrom, TryInto};
use std::fs::File;
use std::io::{Read, Seek, SeekFrom};
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/header-check/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![deny(warnings)]

use std::convert::TryFrom;
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/header-check/test/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

extern crate bhyve_api_sys;
extern crate libc;

Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::fs::{File, OpenOptions};
use std::io::{Error, ErrorKind, Result};
use std::mem::{size_of, size_of_val};
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/sys/src/enums.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use num_enum::TryFromPrimitive;

#[repr(C)]
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/sys/src/ioctls.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// Define constants from machine/vmm_dev.h

const VMMCTL_IOC_BASE: i32 = ((b'V' as i32) << 16) | ((b'M' as i32) << 8);
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

mod enums;
pub mod ioctls;
mod structs;
Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/sys/src/structs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::io::{Error, ErrorKind, Result};
use std::os::raw::{c_int, c_uint, c_void};

Expand Down
4 changes: 4 additions & 0 deletions crates/bhyve-api/sys/src/vmm_data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![allow(non_camel_case_types)]
// VMM Data Classes

Expand Down
4 changes: 4 additions & 0 deletions crates/dladm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

extern crate libc;
extern crate num_enum;

Expand Down
4 changes: 4 additions & 0 deletions crates/dladm/src/sys.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use libc::c_int;
use num_enum::TryFromPrimitive;

Expand Down
4 changes: 4 additions & 0 deletions crates/propolis-server-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use std::str::FromStr;
Expand Down
4 changes: 4 additions & 0 deletions crates/propolis-standalone-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::collections::BTreeMap;

use num_enum::{IntoPrimitive, TryFromPrimitive};
Expand Down
4 changes: 4 additions & 0 deletions crates/propolis-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Fundamental types shared by other Propolis crates.
//!
//! This crate defines some basic types that are shared by multiple other
Expand Down
4 changes: 4 additions & 0 deletions crates/viona-api/header-check/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![deny(warnings)]

use std::convert::TryFrom;
Expand Down
4 changes: 4 additions & 0 deletions crates/viona-api/header-check/test/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

extern crate viona_api_sys;
extern crate libc;

Expand Down
4 changes: 4 additions & 0 deletions crates/viona-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::fs::{File, OpenOptions};
use std::io::{Error, ErrorKind, Result};
use std::os::fd::*;
Expand Down
4 changes: 4 additions & 0 deletions crates/viona-api/sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

pub mod ioctls {
const VNA_IOC: i32 = ((b'V' as i32) << 16) | ((b'C' as i32) << 8);

Expand Down
5 changes: 4 additions & 1 deletion lib/propolis-client/src/generated.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Copyright 2022 Oxide Computer Company
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Experimental progenitor-generated propolis-server API client.

progenitor::generate_api!(
Expand Down
Loading

0 comments on commit 4145083

Please sign in to comment.