Skip to content

Commit 275c7f5

Browse files
committed
kola: Remove 'qemu-unpriv' and make 'qemu' the default
There is no longer a privileged 'qemu' platform and the 'qemu' and 'qemu-unpriv' platforms are the same.
1 parent 01d7818 commit 275c7f5

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

mantle/cmd/kola/kola.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ func syncFindParentImageOptions() error {
582582
// Here we handle the --fetch-parent-image --> platform-specific options
583583
// based on its cosa build metadata
584584
switch kolaPlatform {
585-
case "qemu-unpriv":
585+
case "qemu":
586586
if qemuImageDir == "" {
587587
if qemuImageDir, err = os.MkdirTemp("/var/tmp", "kola-run-upgrade"); err != nil {
588588
return err

mantle/cmd/kola/options.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
kolaPlatform string
4040
kolaParallelArg string
4141
kolaArchitectures = []string{"amd64"}
42-
kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "openstack", "packet", "qemu", "qemu-unpriv", "qemu-iso"}
42+
kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "openstack", "packet", "qemu", "qemu-iso"}
4343
kolaDistros = []string{"fcos", "rhcos", "scos"}
4444
)
4545

@@ -172,21 +172,21 @@ func syncOptionsImpl(useCosa bool) error {
172172
return fmt.Errorf("unsupported %v %q", name, item)
173173
}
174174

175+
if kolaPlatform == "iso" {
176+
kolaPlatform = "qemu-iso"
177+
}
175178
// TODO: Could also auto-synchronize if e.g. --aws-ami is passed
176-
if kolaPlatform == "" {
177-
if kola.QEMUIsoOptions.IsoPath != "" {
178-
kolaPlatform = "qemu-iso"
179-
} else {
180-
kolaPlatform = "qemu-unpriv"
181-
}
179+
if kolaPlatform == "" && kola.QEMUIsoOptions.IsoPath != "" {
180+
kolaPlatform = "qemu-iso"
182181
}
183182

184-
// There used to be a "privileged" qemu path, it is no longer supported.
185-
// Alias qemu to qemu-unpriv.
186-
if kolaPlatform == "qemu" {
187-
kolaPlatform = "qemu-unpriv"
188-
} else if kolaPlatform == "iso" {
189-
kolaPlatform = "qemu-iso"
183+
// There used to be two QEMU platforms: privileged ('qemu') and
184+
// unprivileged ('qemu-unpriv'). We first removed support for privileged
185+
// QEMU and aliased it to 'qemu-unpriv' and then renamed and merged
186+
// 'qemu-unpriv' to 'qemu' to unify on a single name. 'qemu' is now the
187+
// default.
188+
if kolaPlatform == "" {
189+
kolaPlatform = "qemu"
190190
}
191191

192192
// test parallelism
@@ -334,7 +334,7 @@ func syncOptions() error {
334334
// options that can be derived from the cosa build metadata
335335
func syncCosaOptions() error {
336336
switch kolaPlatform {
337-
case "qemu-unpriv", "qemu":
337+
case "qemu":
338338
if kola.QEMUOptions.DiskImage == "" && kola.CosaBuild.Meta.BuildArtifacts.Qemu != nil {
339339
kola.QEMUOptions.DiskImage = filepath.Join(kola.CosaBuild.Dir, kola.CosaBuild.Meta.BuildArtifacts.Qemu.Path)
340340
}

mantle/kola/harness.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func NewFlight(pltfrm string) (flight platform.Flight, err error) {
279279
flight, err = openstack.NewFlight(&OpenStackOptions)
280280
case "packet":
281281
flight, err = packet.NewFlight(&PacketOptions)
282-
case "qemu-unpriv":
282+
case "qemu":
283283
flight, err = unprivqemu.NewFlight(&QEMUOptions)
284284
case "qemu-iso":
285285
flight, err = qemuiso.NewFlight(&QEMUIsoOptions)
@@ -469,11 +469,6 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
469469

470470
checkPlatforms := []string{pltfrm}
471471

472-
// qemu-unpriv has the same restrictions as QEMU but might also want additional restrictions due to the lack of a Local cluster
473-
if pltfrm == "qemu-unpriv" {
474-
checkPlatforms = append(checkPlatforms, "qemu")
475-
}
476-
477472
// sort tags into include/exclude
478473
positiveTags := []string{}
479474
negativeTags := []string{}
@@ -627,7 +622,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
627622
if allowed, excluded := isAllowed(Options.Distribution, t.Distros, t.ExcludeDistros); !allowed || excluded {
628623
continue
629624
}
630-
if pltfrm == "qemu-unpriv" {
625+
if pltfrm == "qemu" {
631626
if allowed, excluded := isAllowed(QEMUOptions.Firmware, t.Firmwares, t.ExcludeFirmwares); !allowed || excluded {
632627
continue
633628
}

src/cmd-kola

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ r = re.compile("-p(=.+)?|--platform(=.+)?")
4949
platformargs = list(filter(r.match, unknown_args))
5050

5151
if os.getuid() != 0 and len(platformargs) == 0:
52-
kolaargs.extend(['-p', 'qemu-unpriv'])
52+
kolaargs.extend(['-p', 'qemu'])
5353

5454
if args.build is not None:
5555
kolaargs.extend(['--build', args.build])

src/cmd-offline-update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# cd /path/to/rhcos-4.8
1111
# cp --reflink=auto /path/to/rhcos-4.6.0-x86_64-qemu.qcow2 tmp/
1212
# cosa offline-update tmp/rhcos-4.6.0-x86_64-qemu.qcow2
13-
# kola run -p qemu-unpriv -b rhcos --qemu-image tmp/rhcos-4.6.0-x86_64-qemu.qcow2 basic
13+
# kola run -p qemu -b rhcos --qemu-image tmp/rhcos-4.6.0-x86_64-qemu.qcow2 basic
1414

1515
set -euo pipefail
1616

0 commit comments

Comments
 (0)