Skip to content

Commit 5505958

Browse files
committed
🗃️ Initial Commit 🗃️
0001-sgx-stub-fix.patch 0004-Initial-redhat-build.patch 0005-Enable-disable-devices-for-RHEL.patch 0006-Machine-type-related-general-changes.patch 0007-Add-aarch64-machine-types.patch 0008-Add-ppc64-machine-types.patch 0009-Add-s390x-machine-types.patch 0010-Add-x86_64-machine-types.patch 0011-Enable-make-check.patch 0012-vfio-cap-number-of-devices-that-can-be-assigned.patch 0013-Add-support-statement-to-help-output.patch 0014-globally-limit-the-maximum-number-of-CPUs.patch 0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch 0016-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch 0017-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch 0018-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch 0019-WRB-Introduce-RHEL-9.0.0-hw-compat-structure.patch 0020-redhat-Update-s390x-machine-type-compatibility-for-r.patch 0021-pc-Move-s3-s4-suspend-disabling-to-compat.patch 95-kvm-memlock.conf 99-qemu-guest-agent.rules bridge.conf kvm.conf kvm-s390x.conf kvm-x86.conf qemu-7.0.0.tar.xz qemu-ga.sysconfig qemu-guest-agent.service qemu.spec README.tests vhost.conf
1 parent de0309a commit 5505958

31 files changed

+6857
-0
lines changed

0001-sgx-stub-fix.patch

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 509b6078631ad2437e1a452f749831e401fb8afb Mon Sep 17 00:00:00 2001
2+
From: Paolo Bonzini <[email protected]>
3+
Date: Tue, 1 Feb 2022 20:09:37 +0100
4+
Subject: [PATCH] target/i386: the sgx_epc_get_section stub is reachable
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
The sgx_epc_get_section stub is reachable from cpu_x86_cpuid. It
10+
should not assert, instead it should just return true just like
11+
the "real" sgx_epc_get_section does when SGX is disabled.
12+
13+
Reported-by: Vladimír Beneš <[email protected]>
14+
15+
Signed-off-by: Paolo Bonzini <[email protected]>
16+
17+
diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
18+
index 26833eb233..16b1dfd90b 100644
19+
--- a/hw/i386/sgx-stub.c
20+
+++ b/hw/i386/sgx-stub.c
21+
@@ -34,5 +34,5 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
22+
23+
bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
24+
{
25+
- g_assert_not_reached();
26+
+ return true;
27+
}

0004-Initial-redhat-build.patch

+313
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
From fc113ecd7c99646a7ced0b99570b5927ae6d595f Mon Sep 17 00:00:00 2001
2+
From: Miroslav Rezanina <[email protected]>
3+
Date: Wed, 26 May 2021 10:56:02 +0200
4+
Subject: Initial redhat build
5+
6+
This patch introduces redhat build structure in redhat subdirectory. In addition,
7+
several issues are fixed in QEMU tree:
8+
9+
- Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm
10+
- As we use qemu-kvm as name in all places, this is updated to be consistent
11+
- Man page renamed from qemu to qemu-kvm
12+
- man page is installed using make install so we have to fix it in qemu tree
13+
14+
We disable make check due to issues with some of the tests.
15+
16+
This rebase is based on qemu-kvm-6.2.0-13.el9
17+
18+
Signed-off-by: Miroslav Rezanina <[email protected]>
19+
--
20+
Rebase changes (6.1.0):
21+
- Move build to .distro
22+
- Move changes for support file to related commit
23+
- Added dependency for python3-sphinx-rtd_theme
24+
- Removed --disable-sheepdog configure option
25+
- Added new hw-display modules
26+
- SASL initialization moved to ui/vnc-auth-sasl.c
27+
- Add accel-qtest-<arch> and accel-tcg-x86_64 libraries
28+
- Added hw-usb-host module
29+
- Disable new configure options (bpf, nvmm, slirp-smbd)
30+
- Use -pie for ksmctl build (annocheck complain fix)
31+
32+
Rebase changes (6.2.0):
33+
- removed --disable-jemalloc and --disable-tcmalloc configure options
34+
- added audio-oss.so
35+
- added fdt requirement for x86_64
36+
- tests/acceptance renamed to tests/avocado
37+
- added multiboot_dma.bin
38+
- Add -Wno-string-plus-int to extra flags
39+
- Updated configure options
40+
41+
Rebase changes (7.0.0):
42+
- Do not use -mlittle CFLAG on ppc64le
43+
- Used upstream handling issue with ui/clipboard.c
44+
- Use -mlittle-endian on ppc64le instead of deleteing it in configure
45+
- Drop --disable-libxml2 option for configure (upstream)
46+
- Remove vof roms
47+
- Disable AVX2 support
48+
- Use internal meson
49+
- Disable new configure options (dbus-display and qga-vss)
50+
- Change permissions on installing tests/Makefile.include
51+
- Remove ssh block driver
52+
53+
Merged patches (6.0.0):
54+
- 605758c902 Limit build on Power to qemu-img and qemu-ga only
55+
56+
Merged patches (6.1.0):
57+
- f04f91751f Use cached tarballs
58+
- 6581165c65 Remove message with running VM count
59+
- 03c3cac9fc spec-file: build qemu-kvm without SPICE and QXL
60+
- e0ae6c1f6c spec-file: Obsolete qemu-kvm-ui-spice
61+
- 9d2e9f9ecf spec: Do not build qemu-kvm-block-gluster
62+
- cf470b4234 spec: Do not link pcnet and ne2k_pci roms
63+
- e981284a6b redhat: Install the s390-netboot.img that we've built
64+
- 24ef557f33 spec: Remove usage of Group: tag
65+
- c40d69b4f4 spec: Drop %defattr usage
66+
- f8e98798ce spec: Clean up BuildRequires
67+
- 47246b43ee spec: Remove iasl BuildRequires
68+
- 170dc1cbe0 spec: Remove redundant 0 in conditionals
69+
- 8718f6fa11 spec: Add more have_XXX conditionals
70+
- a001269ce9 spec: Remove binutils versioned Requires
71+
- 34545ee641 spec: Remove diffutils BuildRequires
72+
- c2c82beac9 spec: Remove redundant Requires:
73+
- 9314c231f4 spec: Add XXX_version macros
74+
- c43db0bf0f spec: Add have_block_rbd
75+
- 3ecb0c0319 qga: drop StandardError=syslog
76+
- 018049dc80 Remove iscsi support
77+
- a2edf18777 redhat: Replace the kvm-setup.service with a /etc/modules-load.d config file
78+
- 387b5fbcfe redhat: Move qemu-kvm-docs dependency to qemu-kvm
79+
- 4ead693178 redhat: introducting qemu-kvm-hw-usbredir
80+
- 4dc6fc3035 redhat: use the standard vhost-user JSON path
81+
- 84757178b4 Fix local build
82+
- 8c394227dd spec: Restrict block drivers in tools
83+
- b6aa7c1fae Move tools to separate package
84+
- eafd82e509 Split qemu-pr-helper to separate package
85+
- 2c0182e2aa spec: RPM_BUILD_ROOT -> %{buildroot}
86+
- 91bd55ca13 spec: More use of %{name} instead of 'qemu-kvm'
87+
- 50ba299c61 spec: Use qemu-pr-helper.service from qemu.git (partial)
88+
- ee08d4e0a3 spec: Use %{_sourcedir} for referencing sources
89+
- 039e7f7d02 spec: Add tools_only
90+
- 884ba71617 spec: %build: Add run_configure helper
91+
- 8ebd864d65 spec: %build: Disable more bits with %{disable_everything} (partial)
92+
- f23fdb53f5 spec: %build: Add macros for some 'configure' parameters
93+
- fe951a8bd8 spec: %files: Move qemu-guest-agent and qemu-img earlier
94+
- 353b632e37 spec: %install: Remove redundant bits
95+
- 9d2015b752 spec: %install: Add %{modprobe_kvm_conf} macro
96+
- 6d05134e8c spec: %install: Remove qemu-guest-agent /etc/qemu-kvm usage
97+
- 985b226467 spec: %install: clean up qemu-ga section
98+
- dfaf9c600d spec: %install: Use a single %{tools_only} section
99+
- f6978ddb46 spec: Make tools_only not cross spec sections
100+
- 071c211098 spec: %install: Limit time spent in %{qemu_kvm_build}
101+
- 1b65c674be spec: misc syntactic merges with Fedora
102+
- 4da16294cf spec: Use Fedora's pattern for specifying rc version
103+
- d7ee259a79 spec: %files: don't use fine grained -docs file list
104+
- 64cad0c60f spec: %files: Add licenses to qemu-common too
105+
- c3de4f080a spec: %install: Drop python3 shebang fixup
106+
- 46fc216115 Update local build to work with spec file improvements
107+
- bab9531548 spec: Remove buildldflags
108+
- c8360ab6a9 spec: Use %make_build macro
109+
- f6966c66e9 spec: Drop make install sharedir and datadir usage
110+
- 86982421bc spec: use %make_install macro
111+
- 191c405d22 spec: parallelize `make check`
112+
- 251a1fb958 spec: Drop explicit --build-id
113+
- 44c7dda6c3 spec: use %{build_ldflags}
114+
- 0009a34354 Move virtiofsd to separate package
115+
- 34d1b200b3 Utilize --firmware configure option
116+
- 2800e1dd03 spec: Switch toolchain to Clang/LLVM (except process-patches.sh)
117+
- e8a70f500f spec: Use safe-stack for x86_64
118+
- e29445d50d spec: Reenable write support for VMDK etc. in tools
119+
- a4fe2a3e16 redhat: Disable LTO on non-x86 architectures
120+
121+
Merged patches (6.2.0):
122+
- 333452440b remove sgabios dependency
123+
- 7d3633f184 enable pulseaudio
124+
- bd898709b0 spec: disable use of gcrypt for crypto backends in favour of gnutls
125+
- e4f0c6dee6 spec: Remove block-curl and block-ssh dependency
126+
- 4dc13bfe63 spec: Build the VDI block driver
127+
- d2f2ff3c74 spec: Explicitly include compress filter
128+
- a7d047f9c2 Move ksmtuned files to separate package
129+
130+
Merged patches (7.0.0):
131+
- 098d4d08d0 spec: Rename qemu-kvm-hw-usbredir to qemu-kvm-device-usb-redirect
132+
- c2bd0d6834 spec: Split qemu-kvm-ui-opengl
133+
- 2c9cda805d spec: Introduce packages for virtio-gpu-* modules (changed as rhel device tree not set)
134+
- d0414a3e0b spec: Introduce device-display-virtio-vga* packages
135+
- 3534ec46d4 spec: Move usb-host module to separate package
136+
- ddc14d4737 spec: Move qtest accel module to tests package
137+
- 6f2c4befa6 spec: Extend qemu-kvm-core description
138+
- 6f11866e4e (rhel/rhel-9.0.0) Update to qemu-kvm-6.2.0-6.el9
139+
- da0a28758f ui/clipboard: fix use-after-free regression
140+
- 895d4d52eb spec: Remove qemu-virtiofsd
141+
- c8c8c8bd84 spec: Fix obsolete for spice subpackages
142+
- d46d2710b2 spec: Obsolete old usb redir subpackage
143+
- 6f52a50b68 spec: Obsolete ssh driver
144+
145+
Signed-off-by: Miroslav Rezanina <[email protected]>
146+
---
147+
.distro/85-kvm.preset | 5 -
148+
.distro/Makefile | 100 +
149+
.distro/Makefile.common | 40 +
150+
.distro/README.tests | 39 +
151+
.distro/ksm.service | 13 -
152+
.distro/ksm.sysconfig | 4 -
153+
.distro/ksmctl.c | 77 -
154+
.distro/ksmtuned | 139 -
155+
.distro/ksmtuned.conf | 21 -
156+
.distro/ksmtuned.service | 12 -
157+
.distro/kvm-setup | 49 -
158+
.distro/kvm-setup.service | 14 -
159+
.distro/modules-load.conf | 4 +
160+
.distro/qemu-guest-agent.service | 1 -
161+
.distro/qemu-kvm.spec.template | 4034 +++++++++++++++++++++++
162+
.distro/rpminspect.yaml | 6 +-
163+
.distro/scripts/extract_build_cmd.py | 12 +
164+
.gitignore | 1 +
165+
README.systemtap | 43 +
166+
meson.build | 4 +-
167+
scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
168+
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +
169+
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
170+
tests/check-block.sh | 2 +
171+
ui/vnc-auth-sasl.c | 2 +-
172+
25 files changed, 4290 insertions(+), 339 deletions(-)
173+
delete mode 100644 .distro/85-kvm.preset
174+
create mode 100644 .distro/Makefile
175+
create mode 100644 .distro/Makefile.common
176+
create mode 100644 .distro/README.tests
177+
delete mode 100644 .distro/ksm.service
178+
delete mode 100644 .distro/ksm.sysconfig
179+
delete mode 100644 .distro/ksmctl.c
180+
delete mode 100644 .distro/ksmtuned
181+
delete mode 100644 .distro/ksmtuned.conf
182+
delete mode 100644 .distro/ksmtuned.service
183+
delete mode 100644 .distro/kvm-setup
184+
delete mode 100644 .distro/kvm-setup.service
185+
create mode 100644 .distro/modules-load.conf
186+
create mode 100644 .distro/qemu-kvm.spec.template
187+
create mode 100644 README.systemtap
188+
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
189+
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
190+
191+
diff --git a/README.systemtap b/README.systemtap
192+
new file mode 100644
193+
index 0000000000..ad913fc990
194+
--- /dev/null
195+
+++ b/README.systemtap
196+
@@ -0,0 +1,43 @@
197+
+QEMU tracing using systemtap-initscript
198+
+---------------------------------------
199+
+
200+
+You can capture QEMU trace data all the time using systemtap-initscript. This
201+
+uses SystemTap's flight recorder mode to trace all running guests to a
202+
+fixed-size buffer on the host. Old trace entries are overwritten by new
203+
+entries when the buffer size wraps.
204+
+
205+
+1. Install the systemtap-initscript package:
206+
+ # yum install systemtap-initscript
207+
+
208+
+2. Install the systemtap scripts and the conf file:
209+
+ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/
210+
+ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/
211+
+
212+
+The set of trace events to enable is given in qemu_kvm.stp. This SystemTap
213+
+script can be customized to add or remove trace events provided in
214+
+/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp.
215+
+
216+
+SystemTap customizations can be made to qemu_kvm.conf to control the flight
217+
+recorder buffer size and whether to store traces in memory only or disk too.
218+
+See stap(1) for option documentation.
219+
+
220+
+3. Start the systemtap service.
221+
+ # service systemtap start qemu_kvm
222+
+
223+
+4. Make the service start at boot time.
224+
+ # chkconfig systemtap on
225+
+
226+
+5. Confirm that the service works.
227+
+ # service systemtap status qemu_kvm
228+
+ qemu_kvm is running...
229+
+
230+
+When you want to inspect the trace buffer, perform the following steps:
231+
+
232+
+1. Dump the trace buffer.
233+
+ # staprun -A qemu_kvm >/tmp/trace.log
234+
+
235+
+2. Start the systemtap service because the preceding step stops the service.
236+
+ # service systemtap start qemu_kvm
237+
+
238+
+3. Translate the trace record to readable format.
239+
+ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
240+
diff --git a/meson.build b/meson.build
241+
index 861de93c4f..6f7e430f0f 100644
242+
--- a/meson.build
243+
+++ b/meson.build
244+
@@ -2394,7 +2394,9 @@ if capstone_opt == 'internal'
245+
# Include all configuration defines via a header file, which will wind up
246+
# as a dependency on the object file, and thus changes here will result
247+
# in a rebuild.
248+
- '-include', 'capstone-defs.h'
249+
+ '-include', 'capstone-defs.h',
250+
+
251+
+ '-Wp,-D_GLIBCXX_ASSERTIONS',
252+
]
253+
254+
libcapstone = static_library('capstone',
255+
diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook
256+
index 13aafd4845..e9b84ec028 100755
257+
--- a/scripts/qemu-guest-agent/fsfreeze-hook
258+
+++ b/scripts/qemu-guest-agent/fsfreeze-hook
259+
@@ -8,7 +8,7 @@
260+
# request, it is issued with "thaw" argument after filesystem is thawed.
261+
262+
LOGFILE=/var/log/qga-fsfreeze-hook.log
263+
-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d
264+
+FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d
265+
266+
# Check whether file $1 is a backup or rpm-generated file and should be ignored
267+
is_ignored_file() {
268+
diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf
269+
new file mode 100644
270+
index 0000000000..372d8160a4
271+
--- /dev/null
272+
+++ b/scripts/systemtap/conf.d/qemu_kvm.conf
273+
@@ -0,0 +1,4 @@
274+
+# Force load uprobes (see BZ#1118352)
275+
+stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true
276+
+
277+
+qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes
278+
diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp
279+
new file mode 100644
280+
index 0000000000..c04abf9449
281+
--- /dev/null
282+
+++ b/scripts/systemtap/script.d/qemu_kvm.stp
283+
@@ -0,0 +1 @@
284+
+probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {}
285+
diff --git a/tests/check-block.sh b/tests/check-block.sh
286+
index f59496396c..d900d8b35e 100755
287+
--- a/tests/check-block.sh
288+
+++ b/tests/check-block.sh
289+
@@ -48,6 +48,8 @@ if LANG=C bash --version | grep -q 'GNU bash, version [123]' ; then
290+
skip "bash version too old ==> Not running the qemu-iotests."
291+
fi
292+
293+
+exit 0
294+
+
295+
cd tests/qemu-iotests
296+
297+
# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
298+
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
299+
index 47fdae5b21..2a950caa2a 100644
300+
--- a/ui/vnc-auth-sasl.c
301+
+++ b/ui/vnc-auth-sasl.c
302+
@@ -42,7 +42,7 @@
303+
304+
bool vnc_sasl_server_init(Error **errp)
305+
{
306+
- int saslErr = sasl_server_init(NULL, "qemu");
307+
+ int saslErr = sasl_server_init(NULL, "qemu-kvm");
308+
309+
if (saslErr != SASL_OK) {
310+
error_setg(errp, "Failed to initialize SASL auth: %s",
311+
--
312+
2.31.1
313+

0 commit comments

Comments
 (0)