m/t/ktest: allow more memory and extra fssepcs
ktest until now used the QEMU default memory which is only 128MiB which
can be insufficent for tests with more data. Increase that to 1GiB
which is a more reasonable limit. Since ktest doesn't use any filesystem
cache in practice this shouldn't be using much more memory.
Also allow adding additional fsspecs to ktest which get integrated into
the test initramfs.
Change-Id: Ib1a1611cb8e3fdce11a3fac7c0c1ed04097032ea
Reviewed-on: https://review.monogon.dev/c/monogon/+/1788
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/test/launch/launch.go b/metropolis/test/launch/launch.go
index 9760f54..cd51549 100644
--- a/metropolis/test/launch/launch.go
+++ b/metropolis/test/launch/launch.go
@@ -181,7 +181,7 @@
// Generate options for all the file descriptors we'll be passing as virtio "serial
// ports"
var extraArgs []string
- for idx, _ := range opts.ExtraChardevs {
+ for idx := range opts.ExtraChardevs {
idxStr := strconv.Itoa(idx)
id := "extra" + idxStr
// That this works is pretty much a hack, but upstream QEMU doesn't have a
@@ -206,7 +206,7 @@
"-chardev", chardevConf.ToOption("pipe"), "-device", deviceConf.ToOption("virtserialport"))
}
- for idx, _ := range opts.ExtraNetworkInterfaces {
+ for idx := range opts.ExtraNetworkInterfaces {
id := fmt.Sprintf("net%v", idx)
netdevConf := QemuValue{
"id": {id},
@@ -226,8 +226,10 @@
// kernel, initramfs and command line are mapped into VM memory at boot time and
// not loaded from any sort of disk. Booting and shutting off one of these VMs
// takes <100ms.
- baseArgs := []string{"-nodefaults", "-no-user-config", "-nographic", "-no-reboot",
+ baseArgs := []string{
+ "-nodefaults", "-no-user-config", "-nographic", "-no-reboot",
"-accel", "kvm", "-cpu", "host",
+ "-m", "1G",
// Needed until QEMU updates their bundled qboot version (needs
// https://github.com/bonzini/qboot/pull/28)
"-bios", "external/com_github_bonzini_qboot/bios.bin",