qemu-kvm/kvm-trace-update-qemu-trace-stap-to-Python-3.patch
Danilo C. L. de Paula 6ca2f341c2 * Mon Feb 10 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.2.0-9.el8
- kvm-ppc-Deassert-the-external-interrupt-pin-in-KVM-on-re.patch [bz#1776638]
- kvm-xics-Don-t-deassert-outputs.patch [bz#1776638]
- kvm-ppc-Don-t-use-CPUPPCState-irq_input_state-with-moder.patch [bz#1776638]
- kvm-trace-update-qemu-trace-stap-to-Python-3.patch [bz#1787395]
- kvm-redhat-Remove-redundant-fix-for-qemu-trace-stap.patch [bz#1787395]
- kvm-iscsi-Cap-block-count-from-GET-LBA-STATUS-CVE-2020-1.patch [bz#1794503]
- kvm-tpm-ppi-page-align-PPI-RAM.patch [bz#1787444]
- kvm-target-arm-kvm-trivial-Clean-up-header-documentation.patch [bz#1647366]
- kvm-target-arm-kvm64-kvm64-cpus-have-timer-registers.patch [bz#1647366]
- kvm-tests-arm-cpu-features-Check-feature-default-values.patch [bz#1647366]
- kvm-target-arm-kvm-Implement-virtual-time-adjustment.patch [bz#1647366]
- kvm-target-arm-cpu-Add-the-kvm-no-adjvtime-CPU-property.patch [bz#1647366]
- kvm-migration-Define-VMSTATE_INSTANCE_ID_ANY.patch [bz#1529231]
- kvm-migration-Change-SaveStateEntry.instance_id-into-uin.patch [bz#1529231]
- kvm-apic-Use-32bit-APIC-ID-for-migration-instance-ID.patch [bz#1529231]
- Resolves: bz#1529231
  ([q35] VM hangs after migration with 200 vCPUs)
- Resolves: bz#1647366
  (aarch64: Add support for the kvm-no-adjvtime ARM CPU feature)
- Resolves: bz#1776638
  (Guest failed to boot up after system_reset  20 times)
- Resolves: bz#1787395
  (qemu-trace-stap list : TypeError: startswith first arg must be bytes or a tuple of bytes, not str)
- Resolves: bz#1787444
  (Broken postcopy migration with vTPM device)
- Resolves: bz#1794503
  (CVE-2020-1711 qemu-kvm: QEMU: block: iscsi: OOB heap access via an unexpected response of iSCSI Server [rhel-av-8.2.0])
2020-02-10 22:47:04 +00:00

83 lines
3.2 KiB
Diff

From e7cdcd1e39c4c030a32c9e8ef79316eae8555bc8 Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Thu, 16 Jan 2020 17:52:48 +0000
Subject: [PATCH 04/15] trace: update qemu-trace-stap to Python 3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20200116175248.286556-2-stefanha@redhat.com>
Patchwork-id: 93365
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 1/1] trace: update qemu-trace-stap to Python 3
Bugzilla: 1787395
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
qemu-trace-stap does not support Python 3 yet:
$ scripts/qemu-trace-stap list path/to/qemu-system-x86_64
Traceback (most recent call last):
File "scripts/qemu-trace-stap", line 175, in <module>
main()
File "scripts/qemu-trace-stap", line 171, in main
args.func(args)
File "scripts/qemu-trace-stap", line 118, in cmd_list
print_probes(args.verbose, "*")
File "scripts/qemu-trace-stap", line 114, in print_probes
if line.startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Now that QEMU requires Python 3.5 or later we can switch to pure Python
3. Use Popen()'s universal_newlines=True argument to treat stdout as
text instead of binary.
Fixes: 62dd1048c0bd ("trace: add ability to do simple printf logging via systemtap")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1787395
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20200107112438.383958-1-stefanha@redhat.com
Message-Id: <20200107112438.383958-1-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 3f0097169bb60268cc5dda0c5ea47c31ab57b22f)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
scripts/qemu-trace-stap | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qemu-trace-stap b/scripts/qemu-trace-stap
index 91d1051..90527eb 100755
--- a/scripts/qemu-trace-stap
+++ b/scripts/qemu-trace-stap
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
# -*- python -*-
#
# Copyright (C) 2019 Red Hat, Inc
@@ -18,8 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
-from __future__ import print_function
-
import argparse
import copy
import os.path
@@ -104,7 +102,9 @@ def cmd_list(args):
if verbose:
print("Listing probes with name '%s'" % script)
proc = subprocess.Popen(["stap", "-l", script],
- stdout=subprocess.PIPE, env=tapset_env(tapsets))
+ stdout=subprocess.PIPE,
+ universal_newlines=True,
+ env=tapset_env(tapsets))
out, err = proc.communicate()
if proc.returncode != 0:
print("No probes found, are the tapsets installed in %s" % tapset_dir(args.binary))
--
1.8.3.1