From 252a7226a90e6d949bd4f4a34b4832cebebc0341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Fri, 21 Oct 2022 16:08:52 +0200 Subject: [PATCH] Fix ordering of QEMU config values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- internal/config/config.go | 12 ++++++------ internal/config/config_doc.go | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index b932111f8..c4bade440 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -240,17 +240,17 @@ type QEMUConfig struct { // Container image to use for launching a containerized libvirt daemon. Only relevant if `libvirtSocket = ""`. LibvirtContainerImage string `yaml:"libvirtContainerImage"` // description: | - // Measurement used to enable measured boot. - Measurements Measurements `yaml:"measurements"` - // description: | - // List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning. - EnforcedMeasurements []uint32 `yaml:"enforcedMeasurements"` - // description: | // NVRAM template to be used for secure boot. Can be sentinel value "production", "testing" or a path to a custom NVRAM template NVRAM string `yaml:"nvram" validate:"required"` // description: | // Path to the OVMF firmware. Leave empty for auto selection. Firmware string `yaml:"firmware"` + // description: | + // Measurement used to enable measured boot. + Measurements Measurements `yaml:"measurements"` + // description: | + // List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning. + EnforcedMeasurements []uint32 `yaml:"enforcedMeasurements"` } // Default returns a struct with the default config. diff --git a/internal/config/config_doc.go b/internal/config/config_doc.go index 455426d5f..c6f1e51de 100644 --- a/internal/config/config_doc.go +++ b/internal/config/config_doc.go @@ -391,26 +391,26 @@ func init() { QEMUConfigDoc.Fields[6].Note = "" QEMUConfigDoc.Fields[6].Description = "Container image to use for launching a containerized libvirt daemon. Only relevant if `libvirtSocket = \"\"`." QEMUConfigDoc.Fields[6].Comments[encoder.LineComment] = "Container image to use for launching a containerized libvirt daemon. Only relevant if `libvirtSocket = \"\"`." - QEMUConfigDoc.Fields[7].Name = "measurements" - QEMUConfigDoc.Fields[7].Type = "Measurements" + QEMUConfigDoc.Fields[7].Name = "nvram" + QEMUConfigDoc.Fields[7].Type = "string" QEMUConfigDoc.Fields[7].Note = "" - QEMUConfigDoc.Fields[7].Description = "Measurement used to enable measured boot." - QEMUConfigDoc.Fields[7].Comments[encoder.LineComment] = "Measurement used to enable measured boot." - QEMUConfigDoc.Fields[8].Name = "enforcedMeasurements" - QEMUConfigDoc.Fields[8].Type = "[]uint32" + QEMUConfigDoc.Fields[7].Description = "NVRAM template to be used for secure boot. Can be sentinel value \"production\", \"testing\" or a path to a custom NVRAM template" + QEMUConfigDoc.Fields[7].Comments[encoder.LineComment] = "NVRAM template to be used for secure boot. Can be sentinel value \"production\", \"testing\" or a path to a custom NVRAM template" + QEMUConfigDoc.Fields[8].Name = "firmware" + QEMUConfigDoc.Fields[8].Type = "string" QEMUConfigDoc.Fields[8].Note = "" - QEMUConfigDoc.Fields[8].Description = "List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning." - QEMUConfigDoc.Fields[8].Comments[encoder.LineComment] = "List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning." - QEMUConfigDoc.Fields[9].Name = "nvram" - QEMUConfigDoc.Fields[9].Type = "string" + QEMUConfigDoc.Fields[8].Description = "Path to the OVMF firmware. Leave empty for auto selection." + QEMUConfigDoc.Fields[8].Comments[encoder.LineComment] = "Path to the OVMF firmware. Leave empty for auto selection." + QEMUConfigDoc.Fields[9].Name = "measurements" + QEMUConfigDoc.Fields[9].Type = "Measurements" QEMUConfigDoc.Fields[9].Note = "" - QEMUConfigDoc.Fields[9].Description = "NVRAM template to be used for secure boot. Can be sentinel value \"production\", \"testing\" or a path to a custom NVRAM template" - QEMUConfigDoc.Fields[9].Comments[encoder.LineComment] = "NVRAM template to be used for secure boot. Can be sentinel value \"production\", \"testing\" or a path to a custom NVRAM template" - QEMUConfigDoc.Fields[10].Name = "firmware" - QEMUConfigDoc.Fields[10].Type = "string" + QEMUConfigDoc.Fields[9].Description = "Measurement used to enable measured boot." + QEMUConfigDoc.Fields[9].Comments[encoder.LineComment] = "Measurement used to enable measured boot." + QEMUConfigDoc.Fields[10].Name = "enforcedMeasurements" + QEMUConfigDoc.Fields[10].Type = "[]uint32" QEMUConfigDoc.Fields[10].Note = "" - QEMUConfigDoc.Fields[10].Description = "Path to the OVMF firmware. Leave empty for auto selection." - QEMUConfigDoc.Fields[10].Comments[encoder.LineComment] = "Path to the OVMF firmware. Leave empty for auto selection." + QEMUConfigDoc.Fields[10].Description = "List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning." + QEMUConfigDoc.Fields[10].Comments[encoder.LineComment] = "List of values that should be enforced to be equal to the ones from the measurement list. Any non-equal values not in this list will only result in a warning." } func (_ Config) Doc() *encoder.Doc {