# shellcheck shell=bash # QEMU/KVM backend — local development and dry runs. backend_check() { if qemu-system-x86_64 -M help 2>/dev/null | grep -q '^q35'; then _c_ok "qemu: q35 machine type available" else _c_fail "qemu: q35 machine type unavailable" fi if qemu-system-x86_64 -device help 2>/dev/null | grep -q 'name "e1000"'; then _c_ok "qemu: e1000 NIC model available" else _c_warn "qemu: e1000 NIC model not listed" fi if qemu-system-x86_64 -device help 2>/dev/null | grep -q 'name "ich9-ahci"'; then _c_ok "qemu: ich9-ahci controller available" else _c_warn "qemu: ich9-ahci controller not listed" fi # `-netdev help` omits bridge even when it is compiled in, so probe it instead: # an unsupported type answers "Invalid netdev type", a supported one complains # about the missing bridge device (br0). if qemu-system-x86_64 -netdev bridge,id=probe 2>&1 | grep -qi 'invalid netdev'; then _c_fail "qemu: bridge netdev not supported" else _c_ok "qemu: bridge netdev supported" fi if [[ -x /usr/libexec/qemu-bridge-helper ]]; then _c_ok "qemu-bridge-helper present" else _c_warn "qemu-bridge-helper not found: unprivileged bridge attach will fail" fi }