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