Add --cpu option.
[qemu-sanity-check.git] / qemu-sanity-check.pod.in
1 =encoding utf8
2
3 =head1 NAME
4
5 qemu-sanity-check - run a simple sanity check on qemu and the Linux kernel
6
7 =head1 SUMMARY
8
9 qemu-sanity-check [options]
10
11 =head1 DESCRIPTION
12
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.
16
17 You can use the command on its own:
18
19  qemu-sanity-check
20
21 In this case, the script will look for a suitable qemu binary on the
22 C<$PATH> and the latest Linux kernel in C</boot> and try to boot that
23 kernel on that qemu.
24
25 You can also specify a qemu binary or a Linux kernel (either or both
26 options can be omitted):
27
28  qemu-sanity-check --qemu=/path/to/qemu --kernel=/path/to/vmlinuz
29
30 =head2 KVM
31
32 KVM (C<kvm> or C<qemu-kvm>) can be used in place of qemu.
33
34 =head2 KERNEL DRIVERS
35
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
39 filesystems, etc.
40
41 The kernel B<must> support only the following, compiled in (not as
42 modules):
43
44 =over 4
45
46 =item *
47
48 A serial port (usually: C<CONFIG_SERIAL_8250=y>)
49
50 =item *
51
52 Initrd/initramfs (C<CONFIG_BLK_DEV_INITRD=y>)
53
54 =back
55
56 =head1 OPTIONS
57
58 =over 4
59
60 =item B<--help>
61
62 Display short help message and exit.
63
64 =item B<--accel>=kvm
65
66 =item B<--accel>=tcg
67
68 =item B<--accel>=kvm:tcg
69
70 This sets the C<-machine accel=...> parameter which is passed to
71 qemu.
72
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.
76
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.
80
81 =item B<--cpu>=CPU
82
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.
86
87 =item B<-i> INITRD
88
89 =item B<--initrd>=INITRD
90
91 Use the initramfs image named C<INITRD> instead of the default.
92
93 =item B<-k> VMLINUZ
94
95 =item B<--kernel>=VMLINUZ
96
97 Use the kernel image C<VMLINUZ> instead of searching for the latest
98 kernel installed in C</boot>.
99
100 =item B<-m> MACHINE
101
102 =item B<--machine>=MACHINE
103
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.
107
108 =item B<-q> QEMU
109
110 =item B<--qemu>=QEMU
111
112 Use the qemu (or KVM) binary C<QEMU> instead of searching C<$PATH> for
113 a suitable binary.
114
115 =item B<-t> TIMEOUT
116
117 =item B<--timeout>=TIMEOUT
118
119 Specify a timeout instead of the default which is C<10m> (10 minutes).
120
121 The syntax for the C<TIMEOUT> is described in full in the man page for
122 L<timeout(1)>.
123
124 =item B<-v>
125
126 =item B<--verbose>
127
128 Print extra debugging information.
129
130 =item B<-V>
131
132 =item B<--version>
133
134 Display version and exit.
135
136 =back
137
138 =head1 EXIT STATUS
139
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.
142
143 The exit status is 1 if the kernel boot failed under qemu.
144
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).
147
148 =head1 FILES
149
150 =over 4
151
152 =item B<@libdir@/qemu-sanity-check/initrd>
153
154 The default location for the small initramfs image that is used to
155 test that userspace has been reached.
156
157 =back
158
159 =head1 SEE ALSO
160
161 L<http://qemu.org>,
162 L<http://kernel.org>
163
164 =head1 AUTHORS
165
166 Richard W.M. Jones <rjones@redhat.com>
167
168 =head1 COPYRIGHT
169
170 (C) Copyright 2013-2020 Red Hat Inc.
171
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.
176
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.
181
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.