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