Skip to content

Commit f56bf06

Browse files
committed
swagger: fix schema for PATCH /machine-config
The description for PATCH /machine-config was reusing the schema for the PUT request, which specified default values and required fields that do not apply to the PATCH request. This was wrong, because the defaults for the PATCH are `null` for all fields (e.g. "leave as is), and no field is required. Signed-off-by: Patrick Roy <[email protected]>
1 parent b7e03e5 commit f56bf06

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

src/firecracker/swagger/firecracker.yaml

+37-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ paths:
365365
in: body
366366
description: A subset of Machine Configuration Parameters
367367
schema:
368-
$ref: "#/definitions/MachineConfiguration"
368+
$ref: "#/definitions/MachineConfigurationPatch"
369369
responses:
370370
204:
371371
description: Machine Configuration created/updated
@@ -1064,6 +1064,42 @@ definitions:
10641064
- 2M
10651065
description: Which huge pages configuration (if any) should be used to back guest memory.
10661066

1067+
MachineConfigurationPatch:
1068+
type: object
1069+
description:
1070+
Describes an update to the number of vCPUs, memory size, SMT capabilities, huge page configuration or
1071+
the CPU template. Fields set to null will remain unchanged.
1072+
properties:
1073+
cpu_template:
1074+
$ref: "#/definitions/CpuTemplate"
1075+
# gdb_socket_path:
1076+
# type: string
1077+
# description: Path to the GDB socket. Requires the gdb feature to be enabled.
1078+
smt:
1079+
type: boolean
1080+
description: Flag for enabling/disabling simultaneous multithreading. Can be enabled only on x86.
1081+
mem_size_mib:
1082+
type: integer
1083+
description: Memory size of VM
1084+
track_dirty_pages:
1085+
type: boolean
1086+
description:
1087+
Enable dirty page tracking. If this is enabled, then incremental guest memory
1088+
snapshots can be created. These belong to diff snapshots, which contain, besides
1089+
the microVM state, only the memory dirtied since a previous snapshot. Full snapshots
1090+
each contain a full copy of the guest memory.
1091+
vcpu_count:
1092+
type: integer
1093+
minimum: 1
1094+
maximum: 32
1095+
description: Number of vCPUs (either 1 or an even number)
1096+
huge_pages:
1097+
type: string
1098+
enum:
1099+
- None
1100+
- 2M
1101+
description: Which huge pages configuration (if any) should be used to back guest memory.
1102+
10671103
MemoryBackend:
10681104
type: object
10691105
required:

0 commit comments

Comments
 (0)