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

allow writing snapshot on top of existing files #1

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
85999df
net: simplify writing to frame to guest logic
bchalios Mar 24, 2022
0b932a4
net: enable notification suppression
bchalios Mar 24, 2022
8c5d9c4
net: use only `prepare_kick()` to raise queue irqs
bchalios Apr 4, 2022
a647750
net: unit tests in virtio-net device
bchalios Apr 14, 2022
a973291
snap: make v1.0.0 incompatible with v1.1.1
bchalios Apr 19, 2022
3737291
CI: update code coverage
bchalios Apr 29, 2022
f81d944
Use == when comparing with an int literal
pb8o May 25, 2022
4ed4646
docs: add serial console kernel config for aarch64
mochja May 28, 2022
6e35f23
tests/perf/net: update baselines for x86_64
May 30, 2022
f7348ff
tests/perf/net: update baselines for aarch64
May 31, 2022
d324ea9
Upgrade devtool contain to use Python 3.10
mattschlebusch May 27, 2022
e97bf9f
Bump internal crate vm-memory version to 0.3.0
mattschlebusch May 31, 2022
5b6d29a
tests/perf/net: update network latency baselines
Jun 2, 2022
7d1ba56
Enhanced code coverage error message
Jun 6, 2022
3d21560
devices: import only required virtio_gen bindings
avr1 Dec 22, 2021
f96f67a
virtio_gen: regenerate only necessary bindings
dianpopa Apr 22, 2022
6ed1dde
test_num_deps: pretty-print and sort the keys
alindima Feb 21, 2022
f25b8be
[deps]: Add vm-allocator dependency
AlexandruCihodaru Apr 14, 2022
6b3e87c
[mmio]: Use vm-allocator error
AlexandruCihodaru Apr 14, 2022
7a58f88
[legacy_irq]: Replace irq allocator
AlexandruCihodaru Apr 14, 2022
a4b25a7
[address_allocator]: Replace address allocator
May 25, 2022
da669d1
Propagating vm-allocator errors
May 25, 2022
e1a18ca
MMIO Memory size constant
May 27, 2022
2a60ce3
PortIODeviceManager constants
May 31, 2022
8cffeee
Updated test coverage
Jun 6, 2022
2fc473b
Add SHA256SUMS checksums when making a release
pb8o May 25, 2022
8bc8d5e
Fixing loosely define behaviour within `write_log`
Jun 7, 2022
b1b7035
Increased binary test target & limit
Jun 13, 2022
a85cd83
CI: Add checks for commit body format
CuriousCorrelation Jun 9, 2022
b73d107
docs: Add commit message example
CuriousCorrelation Jun 9, 2022
0fa080b
CI: Add doctests for commit msg validation
CuriousCorrelation Jun 10, 2022
18c70af
allow writing snapshot on top of existing files
CompuIves May 25, 2022
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
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ testing. Your contribution needs to meet the following standards:
- Document all your public functions.
- Add a descriptive message for each commit. Follow
[commit message best practices](https://github.com/erlang/otp/wiki/writing-good-commit-messages).
- A good commit message may look like

```
A descriptive title of 50 characters or fewer

A concise description where each line is 72 characters or fewer.

Signed-Off-By <A full name> <A email>
Co-Authored-By: <B full name> <B email>
```

- Document your pull requests. Include the reasoning behind each change, and
the testing done.
- Acknowledge Firecracker's [Apache 2.0 license](LICENSE) and certify that no
Expand Down
27 changes: 19 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/kernel-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ on which Firecracker is run:
### ARM

* timekeeping - `CONFIG_ARM_AMBA`, `CONFIG_RTC_DRV_PL031`
* serial console - `CONFIG_SERIAL_OF_PLATFORM`

### x86_64

Expand Down
12 changes: 6 additions & 6 deletions docs/snapshotting/snapshot-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ The Firecracker snapshotting implementation offers support for snapshot versioni
Firecracker release `v` might drop the possibility to save snapshots at any
versions older than `v`.

For example Firecracker v1.0 adds support for some additional virtio features
(e.g. notification suppression). These features lead the guest drivers to
behave in a very specific way and as a consequence the Firecracker devices
have to respond accordingly. As a result, the snapshots that are created
while these features are in use will not be backwards compatible with
For example Firecracker v1.0 and v1.1 adds support for some additional virtio
features (e.g. notification suppression). These features lead the guest
drivers to behave in a very specific way and as a consequence the Firecracker
devices have to respond accordingly. As a result, the snapshots that are
created while these features are in use will not be backwards compatible with
previous versions of Firecracker since the devices that come with these older
versions do not behave in a way that’s compatible with the snapshotted guest
drivers.

The list of versions that break snapshot backwards compatibility: `1.0`
The list of versions that break snapshot backwards compatibility: `1.0`, `1.1`
- Loading snapshots from older versions (being able to load a snapshot created
by any Firecracker version in the `[N, N + o]` interval, in a Firecracker
version `N+o`).
Expand Down
2 changes: 2 additions & 0 deletions src/arch/src/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub enum Error {

/// The start of the memory area reserved for MMIO devices.
pub const MMIO_MEM_START: u64 = layout::MAPPED_IO_START;
/// The size of the memory area reserved for MMIO devices.
pub const MMIO_MEM_SIZE: u64 = layout::DRAM_MEM_START - layout::MAPPED_IO_START; //>> 1GB

/// Returns a Vec of the valid memory addresses for aarch64.
/// See [`layout`](layout) module for a drawing of the specific memory model for this platform.
Expand Down
6 changes: 4 additions & 2 deletions src/arch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ pub mod aarch64;
#[cfg(target_arch = "aarch64")]
pub use aarch64::{
arch_memory_regions, configure_system, get_kernel_start, initrd_load_addr,
layout::CMDLINE_MAX_SIZE, layout::IRQ_BASE, layout::IRQ_MAX, regs, Error, MMIO_MEM_START,
layout::CMDLINE_MAX_SIZE, layout::IRQ_BASE, layout::IRQ_MAX, regs, Error, MMIO_MEM_SIZE,
MMIO_MEM_START,
};

/// Module for x86_64 related functionality.
Expand All @@ -27,7 +28,8 @@ pub mod x86_64;
#[cfg(target_arch = "x86_64")]
pub use crate::x86_64::{
arch_memory_regions, configure_system, get_kernel_start, initrd_load_addr,
layout::CMDLINE_MAX_SIZE, layout::IRQ_BASE, layout::IRQ_MAX, Error, MMIO_MEM_START,
layout::CMDLINE_MAX_SIZE, layout::IRQ_BASE, layout::IRQ_MAX, Error, MMIO_MEM_SIZE,
MMIO_MEM_START,
};

/// Type for returning public functions outcome.
Expand Down
5 changes: 4 additions & 1 deletion src/arch/src/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ pub enum Error {
// Where BIOS/VGA magic would live on a real PC.
const EBDA_START: u64 = 0x9fc00;
const FIRST_ADDR_PAST_32BITS: u64 = 1 << 32;
const MEM_32BIT_GAP_SIZE: u64 = 768 << 20;
/// Size of MMIO gap at top of 32-bit address space.
pub const MEM_32BIT_GAP_SIZE: u64 = 768 << 20;
/// The start of the memory area reserved for MMIO devices.
pub const MMIO_MEM_START: u64 = FIRST_ADDR_PAST_32BITS - MEM_32BIT_GAP_SIZE;
/// The size of the memory area reserved for MMIO devices.
pub const MMIO_MEM_SIZE: u64 = MEM_32BIT_GAP_SIZE;

/// Returns a Vec of the valid memory addresses.
/// These should be used to configure the GuestMemoryMmap structure for the platform.
Expand Down
2 changes: 1 addition & 1 deletion src/devices/src/virtio/balloon/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use ::timerfd::{ClockId, SetTimeFlags, TimerFd, TimerState};

use ::logger::{error, IncMetric, METRICS};
use ::utils::eventfd::EventFd;
use ::virtio_gen::virtio_blk::*;
use ::virtio_gen::virtio_blk::VIRTIO_F_VERSION_1;
use ::vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemoryMmap};

use super::*;
Expand Down
8 changes: 5 additions & 3 deletions src/devices/src/virtio/block/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ use std::sync::Arc;

use logger::{error, warn, IncMetric, METRICS};
use rate_limiter::{BucketUpdate, RateLimiter};
use serde::{Deserialize, Serialize};
use utils::eventfd::EventFd;
use utils::kernel_version::{min_kernel_version_for_io_uring, KernelVersion};
use virtio_gen::virtio_blk::*;
use virtio_gen::virtio_blk::{
VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_RO, VIRTIO_BLK_ID_BYTES, VIRTIO_F_VERSION_1,
};
use virtio_gen::virtio_ring::VIRTIO_RING_F_EVENT_IDX;
use vm_memory::GuestMemoryMmap;

use super::io as block_io;
Expand All @@ -31,8 +35,6 @@ use super::{
};
use crate::virtio::{IrqTrigger, IrqType};
use block_io::FileEngine;
use serde::{Deserialize, Serialize};
use virtio_gen::virtio_ring::VIRTIO_RING_F_EVENT_IDX;

/// Configuration options for disk caching.
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
Expand Down
7 changes: 4 additions & 3 deletions src/devices/src/virtio/block/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ impl MutEventSubscriber for Block {
pub mod tests {
use std::sync::{Arc, Mutex};

use event_manager::{EventManager, SubscriberOps};
use virtio_gen::virtio_blk::{VIRTIO_BLK_S_OK, VIRTIO_BLK_T_OUT};
use vm_memory::{Bytes, GuestAddress};

use super::*;
use crate::virtio::block::device::FileEngineType;
use crate::virtio::block::test_utils::{
default_block, set_queue, simulate_async_completion_event,
};
use crate::virtio::queue::tests::*;
use crate::virtio::test_utils::{default_mem, initialize_virtqueue, VirtQueue};
use event_manager::{EventManager, SubscriberOps};
use virtio_gen::virtio_blk::*;
use vm_memory::{Bytes, GuestAddress};

#[test]
fn test_event_handler() {
Expand Down
5 changes: 4 additions & 1 deletion src/devices/src/virtio/block/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use std::convert::From;
use std::result;

use logger::{error, IncMetric, METRICS};
use virtio_gen::virtio_blk::*;
pub use virtio_gen::virtio_blk::{
VIRTIO_BLK_ID_BYTES, VIRTIO_BLK_S_IOERR, VIRTIO_BLK_S_OK, VIRTIO_BLK_S_UNSUPP,
VIRTIO_BLK_T_FLUSH, VIRTIO_BLK_T_GET_ID, VIRTIO_BLK_T_IN, VIRTIO_BLK_T_OUT,
};
use vm_memory::{ByteValued, Bytes, GuestAddress, GuestMemoryError, GuestMemoryMmap};

use super::super::DescriptorChain;
Expand Down
Loading