Skip to content

Commit

Permalink
config-vm: Recycle the hook-process schema
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wking committed Mar 21, 2018
1 parent fb2d6dd commit 85e26b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
7 changes: 2 additions & 5 deletions config-vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ The virtual-machine container specification provides additional configuration fo

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

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

### Example

```json
"hypervisor": {
"path": "/path/to/vmm",
"parameters": ["opts1=foo", "opts2=bar"]
"args": ["vmm", "opts1=foo", "opts2=bar"]
}
```

Expand Down
14 changes: 1 addition & 13 deletions schema/config-vm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@
],
"properties": {
"hypervisor": {
"description": "hypervisor config used by VM-based containers",
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"$ref": "defs.json#/definitions/FilePath"
},
"parameters": {
"$ref": "defs.json#/definitions/ArrayOfStrings"
}
}
"$ref": "defs.json#/definitions/Hook"
},
"kernel": {
"description": "kernel config used by VM-based containers",
Expand Down
10 changes: 1 addition & 9 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,13 @@ type WindowsHyperV struct {
// VM contains information for virtual-machine-based containers.
type VM struct {
// Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers.
Hypervisor VMHypervisor `json:"hypervisor,omitempty"`
Hypervisor *Hook `json:"hypervisor,omitempty"`
// Kernel specifies kernel-related configuration for virtual-machine-based containers.
Kernel VMKernel `json:"kernel"`
// Image specifies guest image related configuration for virtual-machine-based containers.
Image VMImage `json:"image,omitempty"`
}

// VMHypervisor contains information about the hypervisor to use for a virtual machine.
type VMHypervisor struct {
// Path is the host path to the hypervisor used to manage the virtual machine.
Path string `json:"path"`
// Parameters specifies parameters to pass to the hypervisor.
Parameters string `json:"parameters,omitempty"`
}

// VMKernel contains information about the kernel to use for a virtual machine.
type VMKernel struct {
// Path is the host path to the kernel used to boot the virtual machine.
Expand Down

0 comments on commit 85e26b0

Please sign in to comment.