treewide: remove qemu build

We aren't bundling it right now and it is fairly out of date. Let's kick
it out until we need it, then reengineer the build.

Change-Id: I5362616922d4b9d3e971868636f3792e33880f7a
Reviewed-on: https://review.monogon.dev/c/monogon/+/3568
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/osbase/bringup/test/BUILD.bazel b/osbase/bringup/test/BUILD.bazel
index 7e010e0..ecb893d 100644
--- a/osbase/bringup/test/BUILD.bazel
+++ b/osbase/bringup/test/BUILD.bazel
@@ -11,14 +11,12 @@
         ":kernel_succeeded",
         "//third_party/edk2:OVMF_CODE.fd",
         "//third_party/edk2:OVMF_VARS.fd",
-        "@qemu//:qemu-x86_64-softmmu",
     ],
     importpath = "source.monogon.dev/metropolis/installer/test",
     visibility = ["//visibility:private"],
     x_defs = {
         "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
         "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
-        "xQemuPath": "$(rlocationpath @qemu//:qemu-x86_64-softmmu )",
         "xSucceedKernelPath": "$(rlocationpath :kernel_succeeded )",
         "xFailedKernelPath": "$(rlocationpath :kernel_failed )",
     },
diff --git a/osbase/bringup/test/run_test.go b/osbase/bringup/test/run_test.go
index 3252c54..87d3309 100644
--- a/osbase/bringup/test/run_test.go
+++ b/osbase/bringup/test/run_test.go
@@ -16,7 +16,6 @@
 	// with the rules_go runfiles package to the real path.
 	xOvmfCodePath      string
 	xOvmfVarsPath      string
-	xQemuPath          string
 	xSucceedKernelPath string
 	xFailedKernelPath  string
 )
@@ -24,7 +23,7 @@
 func init() {
 	var err error
 	for _, path := range []*string{
-		&xOvmfCodePath, &xOvmfVarsPath, &xQemuPath,
+		&xOvmfCodePath, &xOvmfVarsPath,
 		&xSucceedKernelPath, &xFailedKernelPath,
 	} {
 		*path, err = runfiles.Rlocation(*path)
@@ -53,7 +52,7 @@
 	}
 	qemuArgs := append(defaultArgs, args...)
 	pf := cmd.TerminateIfFound(expectedOutput, nil)
-	return cmd.RunCommand(ctx, xQemuPath, qemuArgs, pf)
+	return cmd.RunCommand(ctx, "qemu-system-x86_64", qemuArgs, pf)
 }
 
 func TestBringupSuccess(t *testing.T) {
diff --git a/osbase/test/launch/BUILD.bazel b/osbase/test/launch/BUILD.bazel
index 10be93d..3df6b40 100644
--- a/osbase/test/launch/BUILD.bazel
+++ b/osbase/test/launch/BUILD.bazel
@@ -6,9 +6,6 @@
         "launch.go",
         "log.go",
     ],
-    data = [
-        "@com_github_bonzini_qboot//:qboot-bin",
-    ],
     importpath = "source.monogon.dev/osbase/test/launch",
     visibility = [
         "//metropolis:__subpackages__",
@@ -16,7 +13,6 @@
     ],
     deps = [
         "//osbase/freeport",
-        "@io_bazel_rules_go//go/runfiles:go_default_library",
         "@org_golang_x_sys//unix",
     ],
 )
diff --git a/osbase/test/launch/launch.go b/osbase/test/launch/launch.go
index d030b22..cf165a1 100644
--- a/osbase/test/launch/launch.go
+++ b/osbase/test/launch/launch.go
@@ -30,7 +30,6 @@
 	"strings"
 	"syscall"
 
-	"github.com/bazelbuild/rules_go/go/runfiles"
 	"golang.org/x/sys/unix"
 
 	"source.monogon.dev/osbase/freeport"
@@ -246,18 +245,13 @@
 	// 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.
-	biosPath, err := runfiles.Rlocation("com_github_bonzini_qboot/bios.bin")
-	if err != nil {
-		return fmt.Errorf("while searching bios: %w", err)
-	}
-
 	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", biosPath,
+		// Needed because QEMU does not boot without specifying the qboot bios
+		// even tho the documentation clearly states that this is the default.
+		"-bios", "/usr/share/qemu/qboot.rom",
 		"-M", "microvm,x-option-roms=off,pic=off,pit=off,rtc=off,isa-serial=off",
 		"-kernel", opts.KernelPath,
 		// We force using a triple-fault reboot strategy since otherwise the kernel first
@@ -309,7 +303,7 @@
 
 	PrettyPrintQemuArgs(opts.Name, cmd.Args)
 
-	err = cmd.Run()
+	err := cmd.Run()
 	// If it's a context error, just quit. There's no way to tell a
 	// killed-due-to-context vs killed-due-to-external-reason error returned by Run,
 	// so we approximate by looking at the context's status.