Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ test_results/*
/resources/linux
/resources/x86_64
/resources/aarch64
aws/
2 changes: 1 addition & 1 deletion docs/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ process:
```

The other Logger fields have, in this case, the default values:
`Level -> Warning`, `show_level -> false`, `show_log_origin -> false`. For
`Level -> Debug`, `show_level -> false`, `show_log_origin -> false`. For
configuring these too, you can also pass the following optional parameters:
`--level <log_level>`, `--show-level`, `--show-log-origin`:

Expand Down
131 changes: 49 additions & 82 deletions src/firecracker/swagger/firecracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ paths:
Will fail if update is not possible.
operationId: putBalloon
parameters:
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/Balloon"
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/Balloon"
responses:
204:
description: Balloon device created/updated
Expand All @@ -109,12 +109,12 @@ paths:
Will fail if update is not possible.
operationId: patchBalloon
parameters:
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/BalloonUpdate"
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/BalloonUpdate"
responses:
204:
description: Balloon device updated
Expand Down Expand Up @@ -151,12 +151,12 @@ paths:
Will fail if update is not possible.
operationId: patchBalloonStatsInterval
parameters:
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/BalloonStatsUpdate"
- name: body
in: body
description: Balloon properties
required: true
schema:
$ref: "#/definitions/BalloonStatsUpdate"
responses:
204:
description: Balloon statistics interval updated
Expand Down Expand Up @@ -220,7 +220,6 @@ paths:
schema:
$ref: "#/definitions/Error"


/drives/{drive_id}:
put:
summary: Creates or updates a drive. Pre-boot only.
Expand Down Expand Up @@ -488,8 +487,7 @@ paths:
/entropy:
put:
summary: Creates an entropy device. Pre-boot only.
description:
Enables an entropy device that provides high-quality random data to the guest.
description: Enables an entropy device that provides high-quality random data to the guest.
operationId: putEntropyDevice
parameters:
- name: body
Expand All @@ -506,12 +504,10 @@ paths:
schema:
$ref: "#/definitions/Error"


/network-interfaces/{iface_id}:
put:
summary: Creates a network interface. Pre-boot only.
description:
Creates new network interface with ID specified by iface_id path parameter.
description: Creates new network interface with ID specified by iface_id path parameter.
operationId: putGuestNetworkInterfaceByID
parameters:
- name: iface_id
Expand All @@ -538,8 +534,7 @@ paths:
$ref: "#/definitions/Error"
patch:
summary: Updates the rate limiters applied to a network interface. Post-boot only.
description:
Updates the rate limiters applied to a network interface.
description: Updates the rate limiters applied to a network interface.
operationId: patchGuestNetworkInterfaceByID
parameters:
- name: iface_id
Expand Down Expand Up @@ -594,8 +589,7 @@ paths:
/snapshot/load:
put:
summary: Loads a snapshot. Pre-boot only.
description:
Loads the microVM state from a snapshot.
description: Loads the microVM state from a snapshot.
Only accepted on a fresh Firecracker process (before configuring
any resource other than the Logger and Metrics).
operationId: loadSnapshot
Expand Down Expand Up @@ -635,8 +629,7 @@ paths:
/vm:
patch:
summary: Updates the microVM state.
description:
Sets the desired state (Paused or Resumed) for the microVM.
description: Sets the desired state (Paused or Resumed) for the microVM.
operationId: patchVm
parameters:
- name: body
Expand Down Expand Up @@ -707,8 +700,7 @@ definitions:
required:
- amount_mib
- deflate_on_oom
description:
Balloon device descriptor.
description: Balloon device descriptor.
properties:
amount_mib:
type: integer
Expand All @@ -724,17 +716,15 @@ definitions:
type: object
required:
- amount_mib
description:
Balloon device descriptor.
description: Balloon device descriptor.
properties:
amount_mib:
type: integer
description: Target balloon size in MiB.

BalloonStats:
type: object
description:
Describes the balloon device statistics.
description: Describes the balloon device statistics.
required:
- target_pages
- actual_pages
Expand Down Expand Up @@ -798,8 +788,7 @@ definitions:
type: object
required:
- stats_polling_interval_s
description:
Update the statistics polling interval, with the first statistics update scheduled immediately. Statistics cannot be turned on/off after boot.
description: Update the statistics polling interval, with the first statistics update scheduled immediately. Statistics cannot be turned on/off after boot.
properties:
stats_polling_interval_s:
type: integer
Expand All @@ -809,8 +798,7 @@ definitions:
type: object
required:
- kernel_image_path
description:
Boot source descriptor.
description: Boot source descriptor.
properties:
boot_args:
type: string
Expand Down Expand Up @@ -879,21 +867,18 @@ definitions:
type: boolean
cache_type:
type: string
description:
Represents the caching strategy for the block device.
description: Represents the caching strategy for the block device.
enum: ["Unsafe", "Writeback"]
default: "Unsafe"

# VirtioBlock specific parameters
is_read_only:
type: boolean
description:
Is block read only.
description: Is block read only.
This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
path_on_host:
type: string
description:
Host level path for the guest drive.
description: Host level path for the guest drive.
This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
rate_limiter:
$ref: "#/definitions/RateLimiter"
Expand All @@ -909,8 +894,7 @@ definitions:
# VhostUserBlock specific parameters
socket:
type: string
description:
Path to the socket of vhost-user-block backend.
description: Path to the socket of vhost-user-block backend.
This field is required for vhost-user-block config should be omitted for virtio-block configuration.

Error:
Expand Down Expand Up @@ -955,8 +939,7 @@ definitions:

InstanceActionInfo:
type: object
description:
Variant wrapper containing the real action.
description: Variant wrapper containing the real action.
required:
- action_type
properties:
Expand All @@ -970,8 +953,7 @@ definitions:

InstanceInfo:
type: object
description:
Describes MicroVM instance information.
description: Describes MicroVM instance information.
required:
- app_name
- id
Expand Down Expand Up @@ -999,14 +981,13 @@ definitions:

Logger:
type: object
description:
Describes the configuration option for the logging capability.
description: Describes the configuration option for the logging capability.
properties:
level:
type: string
description: Set the level. The possible values are case-insensitive.
enum: [Error, Warning, Info, Debug, Trace, Off]
default: Info
default: Debug
log_path:
type: string
description: Path to the named pipe or file for the human readable log output.
Expand Down Expand Up @@ -1085,8 +1066,7 @@ definitions:

Metrics:
type: object
description:
Describes the configuration option for the metrics capability.
description: Describes the configuration option for the metrics capability.
required:
- metrics_path
properties:
Expand All @@ -1096,8 +1076,7 @@ definitions:

MmdsConfig:
type: object
description:
Defines the MMDS configuration.
description: Defines the MMDS configuration.
required:
- network_interfaces
properties:
Expand Down Expand Up @@ -1134,13 +1113,11 @@ definitions:

MmdsContentsObject:
type: object
description:
Describes the contents of MMDS in JSON format.
description: Describes the contents of MMDS in JSON format.

NetworkInterface:
type: object
description:
Defines a network interface.
description: Defines a network interface.
required:
- host_dev_name
- iface_id
Expand All @@ -1166,8 +1143,7 @@ definitions:
type: string
path_on_host:
type: string
description:
Host level path for the guest drive.
description: Host level path for the guest drive.
This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
rate_limiter:
$ref: "#/definitions/RateLimiter"
Expand Down Expand Up @@ -1233,12 +1209,10 @@ definitions:
properties:
iface_id:
type: string
description:
The name of the interface to modify
description: The name of the interface to modify
host_dev_name:
type: string
description:
The new host device of the interface
description: The new host device of the interface

SnapshotLoadParams:
type: object
Expand All @@ -1250,12 +1224,10 @@ definitions:
properties:
enable_diff_snapshots:
type: boolean
description:
(Deprecated) Enable dirty page tracking to improve space efficiency of diff snapshots
description: (Deprecated) Enable dirty page tracking to improve space efficiency of diff snapshots
track_dirty_pages:
type: boolean
description:
Enable dirty page tracking to improve space efficiency of diff snapshots
description: Enable dirty page tracking to improve space efficiency of diff snapshots
mem_file_path:
type: string
description:
Expand All @@ -1273,15 +1245,13 @@ definitions:
description: Path to the file that contains the microVM state to be loaded.
resume_vm:
type: boolean
description:
When set to true, the vm is also resumed if the snapshot load is successful.
description: When set to true, the vm is also resumed if the snapshot load is successful.
network_overrides:
type: array
description: Network host device names to override
items:
$ref: "#/definitions/NetworkOverride"


TokenBucket:
type: object
description:
Expand Down Expand Up @@ -1315,8 +1285,7 @@ definitions:

Vm:
type: object
description:
Defines the microVM running state. It is especially useful in the snapshotting context.
description: Defines the microVM running state. It is especially useful in the snapshotting context.
required:
- state
properties:
Expand All @@ -1328,16 +1297,14 @@ definitions:

EntropyDevice:
type: object
description:
Defines an entropy device.
description: Defines an entropy device.
properties:
rate_limiter:
$ref: "#/definitions/RateLimiter"

FirecrackerVersion:
type: object
description:
Describes the Firecracker version.
description: Describes the Firecracker version.
required:
- firecracker_version
properties:
Expand Down
4 changes: 3 additions & 1 deletion src/vmm/src/device_manager/pci_mngr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ impl<'a> Persist<'a> for PciDevices {
snapshotting yet"
);
} else {
block_dev.prepare_save();
if let Err(err) = block_dev.prepare_save() {
warn!("Failed to prepare block device for save: {:?}", err);
}
let device_state = block_dev.save();
state.block_devices.push(VirtioDeviceState {
device_id: block_dev.id().to_string(),
Expand Down
4 changes: 3 additions & 1 deletion src/vmm/src/device_manager/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ impl<'a> Persist<'a> for MMIODeviceManager {
snapshotting yet"
);
} else {
block.prepare_save();
if let Err(err) = block.prepare_save() {
warn!("Failed to prepare block device for save: {:?}", err);
}
let device_state = block.save();
states.block_devices.push(VirtioDeviceState {
device_id,
Expand Down
Loading