qemu-kvm/0005-Initial-redhat-build.patch

308 lines
11 KiB
Diff
Raw Normal View History

2021-01-05 05:59:21 +00:00
From e4cd78dda8017f181fa94bbad1f0f015a99271db Mon Sep 17 00:00:00 2001
2018-10-14 17:48:54 +00:00
From: Miroslav Rezanina <mrezanin@redhat.com>
2018-11-29 12:09:34 +00:00
Date: Fri, 12 Oct 2018 07:31:11 +0200
2018-10-14 17:48:54 +00:00
Subject: Initial redhat build
2018-11-08 17:02:33 +00:00
This patch introduces redhat build structure in redhat subdirectory. In addition,
several issues are fixed in QEMU tree:
2018-10-14 17:48:54 +00:00
2018-11-29 12:09:34 +00:00
- 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
2018-10-14 17:48:54 +00:00
2021-01-05 05:59:21 +00:00
This rebase includes changes up to qemu-kvm-5.1.0-16.el8
2018-12-13 12:54:47 +00:00
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)
2019-11-15 14:35:04 +00:00
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
2019-12-09 20:39:05 +00:00
Rebase notes (4.2.0):
2019-11-15 14:35:04 +00:00
- 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)
2019-12-09 20:39:05 +00:00
- Require newer SLOF (20191022)
2019-11-15 14:35:04 +00:00
2020-08-12 15:53:34 +00:00
Rebase notes (5.1.0):
2020-05-13 01:03:43 +00:00
- 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
2020-08-12 15:53:34 +00:00
- New documentation structure (upstream)
2020-05-13 01:03:43 +00:00
- 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)
2020-08-12 15:53:34 +00:00
- 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.
2020-11-26 09:42:21 +00:00
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
2018-12-13 12:54:47 +00:00
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)
2019-11-15 14:35:04 +00:00
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):
2019-11-15 14:35:04 +00:00
- 69e1fb2 enable virgla
- d4f6115 enable virgl, for real this time ...
2020-08-12 15:53:34 +00:00
Merged patches (5.1.0):
2020-05-13 01:03:43 +00:00
- 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
2020-07-15 20:28:51 +00:00
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-*)
2020-11-26 09:42:21 +00:00
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
2018-10-14 17:48:54 +00:00
---
.gitignore | 1 +
README.systemtap | 43 +
hw/s390x/s390-pci-vfio.c | 4 +-
2020-11-26 09:42:21 +00:00
meson.build | 4 +-
redhat/Makefile | 90 +
redhat/Makefile.common | 53 +
redhat/README.tests | 39 +
2021-01-05 05:59:21 +00:00
redhat/qemu-kvm.spec.template | 3402 +++++++++++++++++++++++
2020-11-26 09:42:21 +00:00
redhat/scripts/extract_build_cmd.py | 5 +-
redhat/scripts/process-patches.sh | 17 +-
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.c | 2 +-
2021-01-05 05:59:21 +00:00
15 files changed, 3653 insertions(+), 16 deletions(-)
create mode 100644 README.systemtap
2018-10-14 17:48:54 +00:00
create mode 100644 redhat/Makefile
create mode 100644 redhat/Makefile.common
create mode 100644 redhat/README.tests
2018-10-14 17:48:54 +00:00
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
2018-10-14 17:48:54 +00:00
diff --git a/README.systemtap b/README.systemtap
new file mode 100644
2021-01-05 05:59:21 +00:00
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/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
2021-01-05 05:59:21 +00:00
index 9296e1bb6e..f70c5a8946 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -28,7 +28,7 @@
*/
bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
{
- g_autofree struct vfio_iommu_type1_info *info;
+ g_autofree struct vfio_iommu_type1_info *info = NULL;
uint32_t argsz;
assert(avail);
@@ -229,7 +229,7 @@ static void s390_pci_read_pfip(S390PCIBusDevice *pbdev,
*/
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
{
- g_autofree struct vfio_device_info *info;
+ g_autofree struct vfio_device_info *info = NULL;
VFIOPCIDevice *vfio_pci;
uint32_t argsz;
int fd;
diff --git a/meson.build b/meson.build
2021-01-05 05:59:21 +00:00
index e3386196ba..8c38b2ea36 100644
--- a/meson.build
+++ b/meson.build
2021-01-05 05:59:21 +00:00
@@ -1148,7 +1148,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',
]
2018-10-14 17:48:54 +00:00
libcapstone = static_library('capstone',
diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook
2021-01-05 05:59:21 +00:00
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
2021-01-05 05:59:21 +00:00
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
2021-01-05 05:59:21 +00:00
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 {}
2020-05-13 01:03:43 +00:00
diff --git a/tests/check-block.sh b/tests/check-block.sh
2021-01-05 05:59:21 +00:00
index f6b1bda7b9..645b550af8 100755
2020-05-13 01:03:43 +00:00
--- a/tests/check-block.sh
+++ b/tests/check-block.sh
@@ -58,6 +58,8 @@ if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
2020-05-13 01:03:43 +00:00
fi
fi
+exit 0
+
cd tests/qemu-iotests
# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
2018-10-14 17:48:54 +00:00
diff --git a/ui/vnc.c b/ui/vnc.c
2021-01-05 05:59:21 +00:00
index 49235056f7..eb5520ed73 100644
2018-10-14 17:48:54 +00:00
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3982,7 +3982,7 @@ void vnc_display_open(const char *id, Error **errp)
2018-10-14 17:48:54 +00:00
#ifdef CONFIG_VNC_SASL
2018-11-29 12:09:34 +00:00
if (sasl) {
- 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",
2018-10-14 17:48:54 +00:00
--
2021-01-05 05:59:21 +00:00
2.18.4
2018-10-14 17:48:54 +00:00