osbuild2: rename Qcow2Options -> QCOW2Options
Make the format type options structure naming consistent.
This commit is contained in:
parent
2521c18cf4
commit
8697713ce8
6 changed files with 8 additions and 8 deletions
|
|
@ -233,7 +233,7 @@ func qemuStageOptions(filename string, format osbuild.QEMUFormat, compat string)
|
|||
var options osbuild.QEMUFormatOptions
|
||||
switch format {
|
||||
case osbuild.QEMUFormatQCOW2:
|
||||
options = osbuild.Qcow2Options{
|
||||
options = osbuild.QCOW2Options{
|
||||
Type: format,
|
||||
Compat: compat,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ func qemuStageOptions(filename string, format osbuild.QEMUFormat, compat string)
|
|||
var options osbuild.QEMUFormatOptions
|
||||
switch format {
|
||||
case osbuild.QEMUFormatQCOW2:
|
||||
options = osbuild.Qcow2Options{
|
||||
options = osbuild.QCOW2Options{
|
||||
Type: format,
|
||||
Compat: compat,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ func qemuStageOptions(filename string, format osbuild.QEMUFormat, compat string)
|
|||
var options osbuild.QEMUFormatOptions
|
||||
switch format {
|
||||
case osbuild.QEMUFormatQCOW2:
|
||||
options = osbuild.Qcow2Options{
|
||||
options = osbuild.QCOW2Options{
|
||||
Type: format,
|
||||
Compat: compat,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ func qemuStageOptions(filename string, format osbuild.QEMUFormat, compat string)
|
|||
var options osbuild.QEMUFormatOptions
|
||||
switch format {
|
||||
case osbuild.QEMUFormatQCOW2:
|
||||
options = osbuild.Qcow2Options{
|
||||
options = osbuild.QCOW2Options{
|
||||
Type: format,
|
||||
Compat: compat,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ type QEMUFormatOptions interface {
|
|||
validate() error
|
||||
}
|
||||
|
||||
type Qcow2Options struct {
|
||||
type QCOW2Options struct {
|
||||
// The type of the format must be 'qcow2'
|
||||
Type QEMUFormat `json:"type"`
|
||||
|
||||
|
|
@ -43,9 +43,9 @@ type Qcow2Options struct {
|
|||
Compat string `json:"compat"`
|
||||
}
|
||||
|
||||
func (Qcow2Options) isQEMUFormatOptions() {}
|
||||
func (QCOW2Options) isQEMUFormatOptions() {}
|
||||
|
||||
func (o Qcow2Options) validate() error {
|
||||
func (o QCOW2Options) validate() error {
|
||||
if o.Type != QEMUFormatQCOW2 {
|
||||
return fmt.Errorf("invalid format type %q for %q options", o.Type, QEMUFormatQCOW2)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
func TestNewQemuStage(t *testing.T) {
|
||||
|
||||
formatOptionsList := []QEMUFormatOptions{
|
||||
Qcow2Options{
|
||||
QCOW2Options{
|
||||
Type: QEMUFormatQCOW2,
|
||||
Compat: "0.10",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue