The build fails on linux/arm64 because libvirt.org/go/libvirt is using
CGO, and cross compiling CGO requires a C cross compiler. Setting
GOARCH=arm64 is not enough. The issue is tracked in
https://github.com/kubernetes/minikube/issues/19959.
Previously we built the kvm driver also on arm64 as part of the
docker-machine-driver-kvm2 executable, but the build was skipped on
arm64.
Now that we build the driver as part of minikube, we cannot skip the
entire build. Change the build tag so the libvirt bits are built only on
amd64.
To make this possible, the generic linux bits needed by the registry
moved to pkg/drivers/kvm/driver.go, and a kvm_stub.go is used for
unsupported architectures.
In the registry Driver.Status(), move the arm64 check to front since
there is no point in checking that libvirt is installed correctly if the
driver is not supported yet.