Skip to content

Commit ce01d8a

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 8bc7ec8 commit ce01d8a

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

src/firecracker/swagger/firecracker.yaml

+42-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,47 @@ 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+
default: null
1082+
mem_size_mib:
1083+
type: integer
1084+
description: Memory size of VM
1085+
default: null
1086+
track_dirty_pages:
1087+
type: boolean
1088+
description:
1089+
Enable dirty page tracking. If this is enabled, then incremental guest memory
1090+
snapshots can be created. These belong to diff snapshots, which contain, besides
1091+
the microVM state, only the memory dirtied since a previous snapshot. Full snapshots
1092+
each contain a full copy of the guest memory.
1093+
default: null
1094+
vcpu_count:
1095+
type: integer
1096+
minimum: 1
1097+
maximum: 32
1098+
default: null
1099+
description: Number of vCPUs (either 1 or an even number)
1100+
huge_pages:
1101+
type: string
1102+
enum:
1103+
- None
1104+
- 2M
1105+
default: null
1106+
description: Which huge pages configuration (if any) should be used to back guest memory.
1107+
10671108
MemoryBackend:
10681109
type: object
10691110
required:

0 commit comments

Comments
 (0)