From 19ce5ff93ddd6b8a998348f2a5f59f603c5e11b7 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Fri, 12 Oct 2018 07:31:11 +0200 Subject: Initial redhat build This patch introduces redhat build structure in redhat subdirectory. In addition, several issues are fixed in QEMU tree: - Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm - As we use qemu-kvm as name in all places, this is updated to be consistent - Man page renamed from qemu to qemu-kvm - man page is installed using make install so we have to fix it in qemu tree This rebase includes changes up to qemu-kvm-6.1.0-5.el9 Rebase notes (3.1.0): - added new configure options Rebase notes (4.0.0): - Added dependency to perl-Test-Harness (upstream) - Added dependency to python3-sphinx (upstream) - Change location of icons (upstream) - Remove .desktop file (added upstream) - Added qemu-trace-stap (added upstream) - Removed elf2dmp (added upstream) - Remove .buildinfo - Added pvh.bin rom (added upstream) - Added interop documentation files - Use python module instead of qemu.py (upstream) Rebase notes (4.1.0): - Remove edk2 files generated by build - Switch to rhel-8.1-candidate build target - Remove specs documentation - Switched from libssh2 to libssh - Add rc0 tarball usage hacks - Added BuildRequires for wget, rpm-build and python3-sphinx - Removed new unpacked files - Update configure line to use new options Rebase notes (4.2.0): - Disable iotest run during make check - README renamed to README.rst (upstream) - Removed ui-spice-app.so - Added relevant changes from "505f7f4 redhat: Adding slirp to the exploded tree" - Removed qemu-ga.8 install from spec file - installed by make - Removed spapr-rtas.bin (upstream) - Require newer SLOF (20191022) Rebase notes (5.1.0): - Use python3 for virtio_seg_max_adjust.py test - Removed qemu-trace-stap shebang from spec file - Added virtiofsd.1 (upstream) - Use out-of-tree build - New documentation structure (upstream) - Update local build - Removing installed qemu-storage-daemon (added upstream) - Removing opensbi-riscv32-sifive_u-fw_jump.bin (added upstream) - Disable iotests (moved from Enable make check commit) - Added missing configure options - Reorder configure options - qemu-pr-helper moved to /usr/libexec/ (upstream) - Added submodules for usb-redir, smartcard-reader and qxl display (upstream) - Added setting rc version in Makefile for build - removed --disable-vxhs configure option (removed upstream) - bumped required libusbx-devel version to 1.0.23 - bumped libfdt version to 1.6.0 Rebase notes (5.2.0 rc0): - Move libfdt dependency to qemu-kvm-core - Move manpage rename from Makefile to spec file - rename with-confsuffix configure option to with-suffix (upstream) - Bump libusbx Requires version to 1.0.234 - Manual copy of keymaps in spec file (BZ 1875217) - Removed /usr/share/qemu-kvm/npcm7xx_bootrom.bin, considering it unpackaged for now. - Removed /usr/share/qemu-kvm/qboot.rom, considering unpackaged. - Added build dependency for meson and ninja-build - hw/s390/s390-pci-vfio.c hack - set NULL for g_autofree variables - Removed Chanelog (upstream) - Fix in directory used for docs (upstream add %name so we do not pass it in configure) - Package various .so as part of qemu-kvm-core package. Rebase notes (5.2.0 rc2): - Added fix for dtrace build on RHEL 8.4.0 Rebase notes (5.2.0 rc3): - Added man page for qemu-pr-helper - Added new configure options - Update qemu-kiwi patches to v4 Rebase notes (6.0.0): - update tracetool usage in spec file - remove qemu-storage-daemon-qmp-ref man page - remove qemu-storage-daemon man page - Added devel documentation - do not package virtfs-proxy-helper files - Use --with-git-submodules instead of --(enable|disable)-git-update - Minor build fixes for sending upstream - g_autofree initialization fixed upstream - Updated rc information usage - do not package package hw-s390x-virtio-gpu-ccw.so - Disable new switch options Rebase notes (6.1.0): - Fix warning issue in block.c - Download tarball from dist-git cache - Removed sheepdog driver - Added new display modules: - hw-display-virtio-gpu-gl.so - hw-display-virtio-gpu-pci-gl.so - hw-display-virtio-vga-gl.so - sasl fix moved from ui/vnc.c to ui/vnc-auth-sasl.c - Added accel-qtest-%{kvm_target} and accel-tcg-%{kvm_target} - Added about docs - Use -q option for setup - Added hw-usb-host.so - Disable new options (bpf, nvmm, slirp-smbd) Rebase notes (6.2.0): - Using internal meson - removed --disable-jemalloc and --disable-tcmalloc configure options - added audio-oss.so - added fdt requirement for x86_64 - tests/acceptance renamed to tests/avocado - added multiboot_dma.bin - Removed conflict relics - Updated configure options Merged patches (3.1.0): - 01f0c9f RHEL8: Add disable configure options to qemu spec file - Spec file cleanups Merged patches (4.0.0): - aa4297c Add edk2 Requires to qemu-kvm - d124ff5779 Fixing brew build target - eb204b5 Introduce the qemu-kvm-tests rpm - 223cf0c Load kvm module during boot (partial) Merged patches (4.1.0): - ebb6e97 redhat: Fix LOCALVERSION creation - b0ab0cc redhat: enable tpmdev passthrough (not disabling tests) - 7cb3c4a Enable libpmem to support nvdimm - 8943607 qemu-kvm.spec: bump libseccomp >= 2.4.0 - 27b7c44 rh: set CONFIG_BOCHS_DISPLAY=y for x86 (partial) - e1fe9fe x86_64-rh-devices: enable TPM emulation (partial) Merged patches (4.2.0): - 69e1fb2 enable virgla - d4f6115 enable virgl, for real this time ... Merged patches (5.1.0): - 5edf6bd Add support for rh-brew-module - f77d52d redhat: ship virtiofsd vhost-user device backend - 63f12d4 redhat: Always use module build target for rh-brew (modified) - 9b1e140 redhat: updating the modular target - 44b8bd0 spec: Fix python shenigans for tests Merged patches (5.2.0 rc0): - 9238ce7 Add support for simpletrace - 5797cff Remove explicit glusterfs-api dependency - fd62478 disable virgl - 0205018 redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/ - 3645097 redhat: Make all generated so files executable (not only block-*) Merged patches (5.2.0 rc2): - pjw 99657 redhat: introduces disable_everything macro into the configure call - pjw 99659 redhat: scripts/extract_build_cmd.py - Avoid listing empty lines - pjw 99658 redhat: Fixing rh-local build - pjw 99660 redhat: Add qemu-kiwi subpackage - d2e59ce redhat: add (un/pre)install systemd hooks for qemu-ga Merged patches (5.2.0 rc3): - pjw 99887 - redhat: allow Makefile rh-prep builddep to fail - pjw 99885 - redhat: adding rh-rpm target Merged patches (6.0.0): - 5ab9954a3b spec: find system python via meson - cd0f7db11f build-system: use b_staticpic=false - 80d2dec42c udev-kvm-check: remove the "exceeded subscription limit" message - 38959d51c0 redhat: Allow make to inherit params from parent make for rh-local - 1e0cfe458f redhat: moving all documentation files to qemu-kvm-docs - d7a594d02b redhat: makes qemu respect system's crypto profile - e2bbf1572b spec: Package qemu-storage-daemon - 92f10993ba spec: ui-spice sub-package - 8931e46069 spec: ui-opengl sub-package Merged patches (6.1.0): - 7bb57541b3 redhat: Install the s390-netboot.img that we've built - b4a8531f41 redhat: Fix "unversioned Obsoletes" warning - 141a1693c7 redhat: Move qemu-kvm-docs dependency to qemu-kvm - d75f59c6f9 redhat: introducting qemu-kvm-hw-usbredir - a934d8bf44 redhat: use the standard vhost-user JSON path Merged patches (6.2.0): - 4f3f04bbb6 spec: Remove qemu-kiwi build --- .gitignore | 1 + .gitlab-ci.yml | 24 - .gitlab/issue_templates/bug.md | 64 - .gitlab/issue_templates/feature_request.md | 32 - README.systemtap | 43 + meson.build | 4 +- redhat/Makefile | 90 + redhat/Makefile.common | 48 + redhat/README.tests | 39 + redhat/qemu-kvm.spec.template | 3896 ++++++++++++++++++++ redhat/scripts/extract_build_cmd.py | 5 +- redhat/scripts/process-patches.sh | 20 +- redhat/scripts/tarball_checksum.sh | 2 +- redhat/udev-kvm-check.c | 19 +- scripts/qemu-guest-agent/fsfreeze-hook | 2 +- scripts/systemtap/conf.d/qemu_kvm.conf | 4 + scripts/systemtap/script.d/qemu_kvm.stp | 1 + tests/check-block.sh | 2 + ui/vnc-auth-sasl.c | 2 +- 19 files changed, 4142 insertions(+), 156 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 .gitlab/issue_templates/bug.md delete mode 100644 .gitlab/issue_templates/feature_request.md create mode 100644 README.systemtap create mode 100644 redhat/Makefile create mode 100644 redhat/Makefile.common create mode 100644 redhat/README.tests create mode 100644 redhat/qemu-kvm.spec.template create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp diff --git a/README.systemtap b/README.systemtap new file mode 100644 index 0000000000..ad913fc990 --- /dev/null +++ b/README.systemtap @@ -0,0 +1,43 @@ +QEMU tracing using systemtap-initscript +--------------------------------------- + +You can capture QEMU trace data all the time using systemtap-initscript. This +uses SystemTap's flight recorder mode to trace all running guests to a +fixed-size buffer on the host. Old trace entries are overwritten by new +entries when the buffer size wraps. + +1. Install the systemtap-initscript package: + # yum install systemtap-initscript + +2. Install the systemtap scripts and the conf file: + # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/ + # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/ + +The set of trace events to enable is given in qemu_kvm.stp. This SystemTap +script can be customized to add or remove trace events provided in +/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp. + +SystemTap customizations can be made to qemu_kvm.conf to control the flight +recorder buffer size and whether to store traces in memory only or disk too. +See stap(1) for option documentation. + +3. Start the systemtap service. + # service systemtap start qemu_kvm + +4. Make the service start at boot time. + # chkconfig systemtap on + +5. Confirm that the service works. + # service systemtap status qemu_kvm + qemu_kvm is running... + +When you want to inspect the trace buffer, perform the following steps: + +1. Dump the trace buffer. + # staprun -A qemu_kvm >/tmp/trace.log + +2. Start the systemtap service because the preceding step stops the service. + # service systemtap start qemu_kvm + +3. Translate the trace record to readable format. + # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log diff --git a/meson.build b/meson.build index 96de1a6ef9..5f6ba86dbb 100644 --- a/meson.build +++ b/meson.build @@ -2108,7 +2108,9 @@ if capstone_opt == 'internal' # Include all configuration defines via a header file, which will wind up # as a dependency on the object file, and thus changes here will result # in a rebuild. - '-include', 'capstone-defs.h' + '-include', 'capstone-defs.h', + + '-Wp,-D_GLIBCXX_ASSERTIONS', ] libcapstone = static_library('capstone', diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook index 13aafd4845..e9b84ec028 100755 --- a/scripts/qemu-guest-agent/fsfreeze-hook +++ b/scripts/qemu-guest-agent/fsfreeze-hook @@ -8,7 +8,7 @@ # request, it is issued with "thaw" argument after filesystem is thawed. LOGFILE=/var/log/qga-fsfreeze-hook.log -FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d +FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d # Check whether file $1 is a backup or rpm-generated file and should be ignored is_ignored_file() { diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf new file mode 100644 index 0000000000..372d8160a4 --- /dev/null +++ b/scripts/systemtap/conf.d/qemu_kvm.conf @@ -0,0 +1,4 @@ +# Force load uprobes (see BZ#1118352) +stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true + +qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp new file mode 100644 index 0000000000..c04abf9449 --- /dev/null +++ b/scripts/systemtap/script.d/qemu_kvm.stp @@ -0,0 +1 @@ +probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {} diff --git a/tests/check-block.sh b/tests/check-block.sh index f86cb863de..6d38340d49 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -69,6 +69,8 @@ else fi fi +exit 0 + cd tests/qemu-iotests # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c index 47fdae5b21..2a950caa2a 100644 --- a/ui/vnc-auth-sasl.c +++ b/ui/vnc-auth-sasl.c @@ -42,7 +42,7 @@ bool vnc_sasl_server_init(Error **errp) { - int saslErr = sasl_server_init(NULL, "qemu"); + int saslErr = sasl_server_init(NULL, "qemu-kvm"); if (saslErr != SASL_OK) { error_setg(errp, "Failed to initialize SASL auth: %s", -- 2.27.0