5 qemu-sanity-check - run a simple sanity check on qemu and the Linux kernel
9 qemu-sanity-check [options]
13 B<qemu-sanity-check> is a short shell script that test-boots a Linux
14 kernel under qemu, making sure it boots up to userspace. The idea is
15 to test the Linux kernel and/or qemu to make sure they are working.
17 You can use the command on its own:
21 In this case, the script will look for a suitable qemu binary on the
22 C<$PATH> and the latest Linux kernel in F</boot> and try to boot that
25 You can also specify a qemu binary or a Linux kernel (either or both
26 options can be omitted):
28 qemu-sanity-check --qemu=/path/to/qemu --kernel=/path/to/vmlinuz
32 KVM (C<kvm> or C<qemu-kvm>) can be used in place of qemu.
36 No kernel modules or special drivers are required except as noted
37 below. The test uses an initramfs containing a static binary, so the
38 kernel is B<not> required to locate block devices, use virtio, mount
41 The kernel B<must> support only the following, compiled in (not as
48 A serial port (usually: C<CONFIG_SERIAL_8250=y>)
52 Initrd/initramfs (C<CONFIG_BLK_DEV_INITRD=y>)
62 Display short help message and exit.
68 =item B<--accel>=kvm:tcg
70 This sets the C<-machine accel=...> parameter which is passed to
73 If not set, then C<kvm:tcg> is the default, which means to try to use
74 KVM (hardware-assisted virtualization), and fall back to software
75 emulation if KVM is not possible.
77 Other typical values of this parameter are: C<tcg>, which means to
78 force software emulation. C<kvm>, which means to force KVM and fail
79 if KVM is unavailable.
83 Set the qemu I<--cpu> option. If not set then a suitable default is
84 picked depending on the architecture and whether KVM is available.
85 You can also use I<--cpu=> to let qemu pick the default.
89 =item B<--initrd>=INITRD
91 Use the initramfs image named F<INITRD> instead of the default.
95 =item B<--kernel>=VMLINUZ
97 Use the kernel image F<VMLINUZ> instead of searching for the latest
98 kernel installed in F</boot>.
102 =item B<--machine>=MACHINE
104 Set the qemu I<-m> (machine type) option. If not set then a suitable
105 default is picked depending on the architecture. You can also use
106 I<--machine=> to let qemu pick the default.
112 Use the qemu (or KVM) binary F<QEMU> instead of searching C<$PATH> for
117 =item B<--timeout>=TIMEOUT
119 Specify a timeout instead of the default which is C<10m> (10 minutes).
121 The syntax for the C<TIMEOUT> is described in full in the man page for
128 Print extra debugging information.
134 Display version and exit.
140 The exit status is 0 if the Linux kernel booted as far as userspace
141 under qemu; or if the I<--help> or I<--version> options were used.
143 The exit status is 1 if the kernel boot failed under qemu.
145 The exit status is 2 if the script itself failed (eg. incorrect
146 command line options were used, a suitable kernel could not be found).
152 =item B<@libdir@/qemu-sanity-check/initrd>
154 The default location for the small initramfs image that is used to
155 test that userspace has been reached.
166 Richard W.M. Jones <rjones@redhat.com>
170 (C) Copyright 2013-2020 Red Hat Inc.
172 This program is free software; you can redistribute it and/or modify
173 it under the terms of the GNU General Public License as published by
174 the Free Software Foundation; either version 2 of the License, or
175 (at your option) any later version.
177 This program is distributed in the hope that it will be useful,
178 but WITHOUT ANY WARRANTY; without even the implied warranty of
179 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 GNU General Public License for more details.
182 You should have received a copy of the GNU General Public License along
183 with this program; if not, write to the Free Software Foundation, Inc.,
184 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.