Skip to content

Commit 941cad2

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 0f52e60 commit 941cad2

File tree

14 files changed

+39
-44
lines changed

14 files changed

+39
-44
lines changed

mantle/cmd/kola/kola.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ func syncFindParentImageOptions() error {
617617
// Here we handle the --fetch-parent-image --> platform-specific options
618618
// based on its cosa build metadata
619619
switch kolaPlatform {
620-
case "qemu-unpriv":
620+
case "qemu":
621621
if qemuImageDir == "" {
622622
if qemuImageDir, err = os.MkdirTemp("/var/tmp", "kola-run-upgrade"); err != nil {
623623
return err

mantle/cmd/kola/options.go

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

@@ -177,23 +177,23 @@ func syncOptionsImpl(useCosa bool) error {
177177
return fmt.Errorf("unsupported %v %q", name, item)
178178
}
179179

180-
// TODO: Could also auto-synchronize if e.g. --aws-ami is passed
181-
if kolaPlatform == "" {
182-
if kola.QEMUIsoOptions.IsoPath != "" {
183-
kolaPlatform = "qemu-iso"
184-
} else {
185-
kolaPlatform = "qemu-unpriv"
186-
}
180+
if kolaPlatform == "iso" {
181+
kolaPlatform = "qemu-iso"
187182
}
188183

189-
// There used to be a "privileged" qemu path, it is no longer supported.
190-
// Alias qemu to qemu-unpriv.
191-
if kolaPlatform == "qemu" {
192-
kolaPlatform = "qemu-unpriv"
193-
} else if kolaPlatform == "iso" {
184+
if kolaPlatform == "" && kola.QEMUIsoOptions.IsoPath != "" {
194185
kolaPlatform = "qemu-iso"
195186
}
196187

188+
// There used to be two QEMU platforms: privileged ('qemu') and
189+
// unprivileged ('qemu-unpriv'). We first removed support for privileged
190+
// QEMU and aliased it to 'qemu-unpriv' and then renamed and merged
191+
// 'qemu-unpriv' to 'qemu' to unify on a single name. 'qemu' is now the
192+
// default.
193+
if kolaPlatform == "" {
194+
kolaPlatform = "qemu"
195+
}
196+
197197
// test parallelism
198198
if kolaParallelArg == "auto" {
199199
ncpu, err := system.GetProcessors()
@@ -339,7 +339,7 @@ func syncOptions() error {
339339
// options that can be derived from the cosa build metadata
340340
func syncCosaOptions() error {
341341
switch kolaPlatform {
342-
case "qemu-unpriv", "qemu":
342+
case "qemu":
343343
if kola.QEMUOptions.SecureExecution && kola.QEMUOptions.DiskImage == "" && kola.CosaBuild.Meta.BuildArtifacts.SecureExecutionQemu != nil {
344344
kola.QEMUOptions.DiskImage = filepath.Join(kola.CosaBuild.Dir, kola.CosaBuild.Meta.BuildArtifacts.SecureExecutionQemu.Path)
345345
}

mantle/cmd/kola/spawn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/coreos/coreos-assembler/mantle/kola"
3333
"github.com/coreos/coreos-assembler/mantle/platform"
3434
"github.com/coreos/coreos-assembler/mantle/platform/conf"
35-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
35+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
3636
)
3737

3838
var (
@@ -178,7 +178,7 @@ func runSpawn(cmd *cobra.Command, args []string) error {
178178
}
179179

180180
switch qc := cluster.(type) {
181-
case *unprivqemu.Cluster:
181+
case *qemu.Cluster:
182182
mach, err = qc.NewMachineWithQemuOptions(userdata, machineOpts)
183183
default:
184184
plog.Fatalf("unreachable: qemu cluster %v unknown type", qc)

mantle/kola/harness.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ import (
5454
"github.com/coreos/coreos-assembler/mantle/platform/machine/gcloud"
5555
"github.com/coreos/coreos-assembler/mantle/platform/machine/openstack"
5656
"github.com/coreos/coreos-assembler/mantle/platform/machine/packet"
57+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
5758
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemuiso"
58-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
5959
"github.com/coreos/coreos-assembler/mantle/system"
6060
"github.com/coreos/coreos-assembler/mantle/util"
6161
coreosarch "github.com/coreos/stream-metadata-go/arch"
@@ -114,7 +114,7 @@ var (
114114
GCPOptions = gcloudapi.Options{Options: &Options} // glue to set platform options from main
115115
OpenStackOptions = openstackapi.Options{Options: &Options} // glue to set platform options from main
116116
PacketOptions = packetapi.Options{Options: &Options} // glue to set platform options from main
117-
QEMUOptions = unprivqemu.Options{Options: &Options} // glue to set platform options from main
117+
QEMUOptions = qemu.Options{Options: &Options} // glue to set platform options from main
118118
QEMUIsoOptions = qemuiso.Options{Options: &Options} // glue to set platform options from main
119119

120120
CosaBuild *util.LocalBuild // this is a parsed cosa build
@@ -299,8 +299,8 @@ func NewFlight(pltfrm string) (flight platform.Flight, err error) {
299299
flight, err = openstack.NewFlight(&OpenStackOptions)
300300
case "packet":
301301
flight, err = packet.NewFlight(&PacketOptions)
302-
case "qemu-unpriv":
303-
flight, err = unprivqemu.NewFlight(&QEMUOptions)
302+
case "qemu":
303+
flight, err = qemu.NewFlight(&QEMUOptions)
304304
case "qemu-iso":
305305
flight, err = qemuiso.NewFlight(&QEMUIsoOptions)
306306
default:
@@ -480,11 +480,6 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
480480

481481
checkPlatforms := []string{pltfrm}
482482

483-
// qemu-unpriv has the same restrictions as QEMU but might also want additional restrictions due to the lack of a Local cluster
484-
if pltfrm == "qemu-unpriv" {
485-
checkPlatforms = append(checkPlatforms, "qemu")
486-
}
487-
488483
// sort tags into include/exclude
489484
positiveTags := []string{}
490485
negativeTags := []string{}
@@ -638,7 +633,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
638633
if allowed, excluded := isAllowed(Options.Distribution, t.Distros, t.ExcludeDistros); !allowed || excluded {
639634
continue
640635
}
641-
if pltfrm == "qemu-unpriv" {
636+
if pltfrm == "qemu" {
642637
if allowed, excluded := isAllowed(QEMUOptions.Firmware, t.Firmwares, t.ExcludeFirmwares); !allowed || excluded {
643638
continue
644639
}

mantle/kola/tests/ignition/luks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
ut "github.com/coreos/coreos-assembler/mantle/kola/tests/util"
1313
"github.com/coreos/coreos-assembler/mantle/platform"
1414
"github.com/coreos/coreos-assembler/mantle/platform/conf"
15-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
15+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
1616
"github.com/coreos/coreos-assembler/mantle/util"
1717
)
1818

@@ -76,7 +76,7 @@ func setupTangMachine(c cluster.TestCluster) ut.TangServer {
7676
// the golang compiler no longer checks that the individual types in the case have the
7777
// NewMachineWithQemuOptions function, but rather whether platform.Cluster
7878
// does which fails
79-
case *unprivqemu.Cluster:
79+
case *qemu.Cluster:
8080
m, err = pc.NewMachineWithQemuOptions(ignition, options)
8181
for _, hfp := range options.HostForwardPorts {
8282
if hfp.Service == "tang" {

mantle/kola/tests/ignition/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func init() {
6262
"TLSServe": register.CreateNativeFuncWrap(TLSServe),
6363
},
6464
Tags: []string{"ignition"},
65-
// QEMU unprivileged doesn't support multiple VMs communicating with each other.
65+
// QEMU doesn't support multiple VMs communicating with each other.
6666
ExcludePlatforms: []string{"qemu"},
6767
Timeout: 20 * time.Minute,
6868
})

mantle/kola/tests/misc/boot-mirror.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/coreos/coreos-assembler/mantle/kola/tests/util"
2727
"github.com/coreos/coreos-assembler/mantle/platform"
2828
"github.com/coreos/coreos-assembler/mantle/platform/conf"
29-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
29+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
3030
ut "github.com/coreos/coreos-assembler/mantle/util"
3131
)
3232

@@ -103,7 +103,7 @@ func runBootMirrorTest(c cluster.TestCluster) {
103103
// FIXME: for QEMU tests kola currently assumes the host CPU architecture
104104
// matches the one under test
105105
userdata := bootmirror.Subst("LAYOUT", coreosarch.CurrentRpmArch())
106-
m, err = c.Cluster.(*unprivqemu.Cluster).NewMachineWithQemuOptions(userdata, options)
106+
m, err = c.Cluster.(*qemu.Cluster).NewMachineWithQemuOptions(userdata, options)
107107
if err != nil {
108108
c.Fatal(err)
109109
}
@@ -150,7 +150,7 @@ func runBootMirrorLUKSTest(c cluster.TestCluster) {
150150
// FIXME: for QEMU tests kola currently assumes the host CPU architecture
151151
// matches the one under test
152152
userdata := bootmirrorluks.Subst("LAYOUT", coreosarch.CurrentRpmArch())
153-
m, err = c.Cluster.(*unprivqemu.Cluster).NewMachineWithQemuOptions(userdata, options)
153+
m, err = c.Cluster.(*qemu.Cluster).NewMachineWithQemuOptions(userdata, options)
154154
if err != nil {
155155
c.Fatal(err)
156156
}

mantle/kola/tests/misc/network.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/coreos/coreos-assembler/mantle/kola/register"
2727
"github.com/coreos/coreos-assembler/mantle/platform"
2828
"github.com/coreos/coreos-assembler/mantle/platform/conf"
29-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
29+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
3030
"github.com/coreos/coreos-assembler/mantle/util"
3131
)
3232

@@ -488,7 +488,7 @@ func setupMultipleNetworkTest(c cluster.TestCluster, primaryMac, secondaryMac st
488488
// the golang compiler no longer checks that the individual types in the case have the
489489
// NewMachineWithQemuOptions function, but rather whether platform.Cluster
490490
// does which fails
491-
case *unprivqemu.Cluster:
491+
case *qemu.Cluster:
492492
m, err = pc.NewMachineWithQemuOptions(userdata, options)
493493
default:
494494
panic("unreachable")
@@ -553,7 +553,7 @@ func setupWithInterfacesTest(c cluster.TestCluster, primaryMac, secondaryMac str
553553
// the golang compiler no longer checks that the individual types in the case have the
554554
// NewMachineWithQemuOptions function, but rather whether platform.Cluster
555555
// does which fails
556-
case *unprivqemu.Cluster:
556+
case *qemu.Cluster:
557557
m, err = pc.NewMachineWithQemuOptions(userdata, options)
558558
default:
559559
panic("unreachable")

mantle/kola/tests/rhcos/upgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/coreos/coreos-assembler/mantle/kola/tests/util"
3535
"github.com/coreos/coreos-assembler/mantle/platform"
3636
"github.com/coreos/coreos-assembler/mantle/platform/conf"
37-
"github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu"
37+
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemu"
3838
installer "github.com/coreos/coreos-assembler/mantle/util"
3939
"github.com/coreos/go-semver/semver"
4040
)
@@ -213,7 +213,7 @@ func rhcosUpgradeFromOcpRhcos(c cluster.TestCluster) {
213213
}`)
214214

215215
switch pc := c.Cluster.(type) {
216-
case *unprivqemu.Cluster:
216+
case *qemu.Cluster:
217217
ostreeCommit := kola.CosaBuild.Meta.OstreeCommit
218218
temp := os.TempDir()
219219
rhcosQcow2, err := downloadLatestReleasedRHCOS(temp)

mantle/platform/machine/unprivqemu/cluster.go renamed to mantle/platform/machine/qemu/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package unprivqemu
15+
package qemu
1616

1717
import (
1818
"fmt"
@@ -102,7 +102,7 @@ func (qc *Cluster) NewMachineWithQemuOptions(userdata *conf.UserData, options pl
102102
}
103103
} else if conf.IsEmpty() {
104104
} else {
105-
return nil, fmt.Errorf("unprivileged qemu only supports Ignition or empty configs")
105+
return nil, fmt.Errorf("qemu only supports Ignition or empty configs")
106106
}
107107

108108
builder.ConfigFile = confPath

mantle/platform/machine/unprivqemu/flight.go renamed to mantle/platform/machine/qemu/flight.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package unprivqemu
15+
package qemu
1616

1717
import (
1818
"github.com/coreos/pkg/capnslog"

mantle/platform/machine/unprivqemu/machine.go renamed to mantle/platform/machine/qemu/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package unprivqemu
15+
package qemu
1616

1717
import (
1818
"context"

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)