cryptospore / rpms / qemu-kvm

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