Skip to content

Commit

Permalink
Merge pull request kubevirt#1814 from gaahrdner/add-uefi-support
Browse files Browse the repository at this point in the history
Initial EFI support
  • Loading branch information
davidvossel authored Jan 30, 2019
2 parents 8b12c41 + c0c8daf commit a2b7fa7
Show file tree
Hide file tree
Showing 21 changed files with 557 additions and 14 deletions.
29 changes: 28 additions & 1 deletion api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4005,6 +4005,22 @@
}
}
},
"v1.BIOS": {
"description": "If set (default), BIOS will be used."
},
"v1.Bootloader": {
"description": "Represents the firmware blob used to assist in the domain creation process.\nUsed for setting the QEMU BIOS file path for the libvirt domain.",
"properties": {
"bios": {
"description": "If set (default), BIOS will be used.\n+optional",
"$ref": "#/definitions/v1.BIOS"
},
"efi": {
"description": "If set, EFI will be used instead of BIOS.\n+optional",
"$ref": "#/definitions/v1.EFI"
}
}
},
"v1.CDRomTarget": {
"properties": {
"bus": {
Expand Down Expand Up @@ -4328,7 +4344,7 @@
"$ref": "#/definitions/v1.Devices"
},
"features": {
"description": "Features like acpi, apic, hyperv.\n+optional",
"description": "Features like acpi, apic, hyperv, smm.\n+optional",
"$ref": "#/definitions/v1.Features"
},
"firmware": {
Expand All @@ -4353,6 +4369,9 @@
}
}
},
"v1.EFI": {
"description": "If set, EFI will be used instead of BIOS."
},
"v1.EmptyDiskSource": {
"description": "EmptyDisk represents a temporary disk which shares the vmis lifecycle.",
"required": [
Expand Down Expand Up @@ -4472,11 +4491,19 @@
"hyperv": {
"description": "Defaults to the machine type setting.\n+optional",
"$ref": "#/definitions/v1.FeatureHyperv"
},
"smm": {
"description": "SMM enables/disables System Management Mode.\nTSEG not yet implemented.\n+optional",
"$ref": "#/definitions/v1.FeatureState"
}
}
},
"v1.Firmware": {
"properties": {
"bootloader": {
"description": "Settings to control the bootloader that is used.\n+optional",
"$ref": "#/definitions/v1.Bootloader"
},
"uuid": {
"description": "UUID reported by the vmi bios.\nDefaults to a random generated uid.",
"type": "string"
Expand Down
27 changes: 27 additions & 0 deletions cluster/examples/vmi-alpine-efi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachineInstance
metadata:
labels:
special: vmi-alpine-efi
name: vmi-alpine-efi
spec:
domain:
devices:
disks:
- disk:
bus: virtio
name: containerdisk
firmware:
bootloader:
efi: {}
machine:
type: ""
resources:
requests:
memory: 1Gi
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/alpine-container-disk-demo:devel
name: containerdisk
1 change: 1 addition & 0 deletions cmd/virt-launcher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FROM kubevirt/libvirt:4.9.0
LABEL maintainer="The KubeVirt Project <[email protected]>"

RUN dnf -y install \
edk2-ovmf \
socat \
genisoimage \
&& dnf -y clean all && \
Expand Down
86 changes: 85 additions & 1 deletion pkg/api/v1/deepcopy_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pkg/api/v1/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ var _ = Describe("Defaults", func() {
Expect(vmi.Spec.Domain.Features.Hyperv).To(BeNil())
})

It("should not add SMM feature if it is unspecified", func() {
vmi := &VirtualMachineInstance{}
SetObjectDefaults_VirtualMachineInstance(vmi)
Expect(vmi.Spec.Domain.Features.SMM).To(BeNil())
})

It("should add interface and pod network by default", func() {
vmi := &VirtualMachineInstance{}
SetObjectDefaults_VirtualMachineInstance(vmi)
Expand All @@ -35,6 +41,7 @@ var _ = Describe("Defaults", func() {
}
vmi.Spec.Domain.Features = &Features{
ACPI: FeatureState{},
SMM: &FeatureState{},
APIC: &FeatureAPIC{},
Hyperv: &FeatureHyperv{
Relaxed: &FeatureState{},
Expand All @@ -54,6 +61,7 @@ var _ = Describe("Defaults", func() {
hyperv := features.Hyperv

Expect(*features.ACPI.Enabled).To(BeTrue())
Expect(*features.SMM.Enabled).To(BeTrue())
Expect(*features.APIC.Enabled).To(BeTrue())
Expect(*hyperv.Relaxed.Enabled).To(BeTrue())
Expect(*hyperv.VAPIC.Enabled).To(BeTrue())
Expand Down
70 changes: 68 additions & 2 deletions pkg/api/v1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2b7fa7

Please sign in to comment.