Skip to content

Commit 218660d

Browse files
committed
config-vm: Recycle the hook-process schema
We already have two ways to specify a process to launch (for the container process and for hooks). This commit recycles the hook-process schema for launcing the hypervisor. I prefer using the more-fundamental container process schema, but Michael felt it had too many properties that wouldn't apply to the hypervisor-launching case [1]. [1]: opencontainers#949 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
1 parent a36c1bb commit 218660d

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

config-vm.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ The virtual-machine container specification provides additional configuration fo
55

66
## <a name="HypervisorObject" /> Hypervisor Object
77

8-
**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine.
9-
* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine.
10-
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace).
11-
* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor.
8+
**`hypervisor`** (object, OPTIONAL) configures the hypervisor process using the [hook-process schema](config.md#hook-process).
129

1310
### Example
1411

1512
```json
1613
"hypervisor": {
1714
"path": "/path/to/vmm",
18-
"parameters": ["opts1=foo", "opts2=bar"]
15+
"args": ["vmm", "opts1=foo", "opts2=bar"]
1916
}
2017
```
2118

schema/config-vm.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,7 @@
77
],
88
"properties": {
99
"hypervisor": {
10-
"description": "hypervisor config used by VM-based containers",
11-
"type": "object",
12-
"required": [
13-
"path"
14-
],
15-
"properties": {
16-
"path": {
17-
"$ref": "defs.json#/definitions/FilePath"
18-
},
19-
"parameters": {
20-
"$ref": "defs.json#/definitions/ArrayOfStrings"
21-
}
22-
}
10+
"$ref": "defs.json#/definitions/Hook"
2311
},
2412
"kernel": {
2513
"description": "kernel config used by VM-based containers",

specs-go/config.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,21 +504,13 @@ type WindowsHyperV struct {
504504
// VM contains information for virtual-machine-based containers.
505505
type VM struct {
506506
// Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers.
507-
Hypervisor VMHypervisor `json:"hypervisor,omitempty"`
507+
Hypervisor *Hook `json:"hypervisor,omitempty"`
508508
// Kernel specifies kernel-related configuration for virtual-machine-based containers.
509509
Kernel VMKernel `json:"kernel"`
510510
// Image specifies guest image related configuration for virtual-machine-based containers.
511511
Image VMImage `json:"image,omitempty"`
512512
}
513513

514-
// VMHypervisor contains information about the hypervisor to use for a virtual machine.
515-
type VMHypervisor struct {
516-
// Path is the host path to the hypervisor used to manage the virtual machine.
517-
Path string `json:"path"`
518-
// Parameters specifies parameters to pass to the hypervisor.
519-
Parameters string `json:"parameters,omitempty"`
520-
}
521-
522514
// VMKernel contains information about the kernel to use for a virtual machine.
523515
type VMKernel struct {
524516
// Path is the host path to the kernel used to boot the virtual machine.

0 commit comments

Comments
 (0)