From nobody Sat Feb 7 07:11:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770151040; cv=none; d=zohomail.com; s=zohoarc; b=TVYyDLjVSV1stkSmYOul8PrGk3fGpF0vmKM3mmPyQtIu23QE1hFRC5yA5NXxmDfrdNLgU2bpFVRBMGz8jW9msegSD04Jdtp//z3Pp+2UeRc+VsNOTCJms1yniW2WAuWqVisFjXwuQ/3Wk6Rppg3yij0GS+qbQVLILnQff0TFO4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770151040; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oJmSAQmgIxTVzY03JW3eXIg22TcdyfFyh8muUwq0NEw=; b=dOPPEJXQMpEni8DfFUh7EaH11D0SNwFIwgWvvX4UN9vALPxhkerSUssX26knwnYssknBBgIiP7xHEdz+PwQv7fDCjza+exz2snLb8h3IvtgBuijIiLkei1RTbINEAOmh9KgEt1Co+dH4pY82q6drLAJMrDFhGCfcIc2BJaeVHr4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770151040295568.4733576372442; Tue, 3 Feb 2026 12:37:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnN8G-0004CG-4S; Tue, 03 Feb 2026 15:36:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vnN8D-0003vg-Ph for qemu-devel@nongnu.org; Tue, 03 Feb 2026 15:36:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vnN8B-000158-7a for qemu-devel@nongnu.org; Tue, 03 Feb 2026 15:36:17 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-t4AF3JgcOw61WH0YJ1CHFA-1; Tue, 03 Feb 2026 15:36:12 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 666E71956053; Tue, 3 Feb 2026 20:36:10 +0000 (UTC) Received: from jsnow-thinkpadp16vgen1.westford.csb (unknown [10.22.88.43]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6657918004D8; Tue, 3 Feb 2026 20:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770150974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oJmSAQmgIxTVzY03JW3eXIg22TcdyfFyh8muUwq0NEw=; b=TLlIQwAq6UrddWRdOaiO/ElJG84dm4lpo6Ht39rK8giiOhg6tTjG51gPE/DYpODw/XVoq5 KjgQ6zZqJjGsv8yfyUX27rBQ+R5cxOLuHn69L8ugSn7nvjh92ew31iO6sIpLUwkr3hBh+B S2R+1nCzr/8NqCXqQ35ULSBLCz/XUW0= X-MC-Unique: t4AF3JgcOw61WH0YJ1CHFA-1 X-Mimecast-MFC-AGG-ID: t4AF3JgcOw61WH0YJ1CHFA_1770150970 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Thomas Huth , Maksim Davydov , Markus Armbruster , Peter Xu , Ed Maste , Li-Wen Hsu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Michael Roth , Yonggang Luo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mauro Carvalho Chehab , Kevin Wolf , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fabiano Rosas Subject: [PATCH v5 14/16] scripts: nudge users to use 'run' script for scripts that import qemu.qmp Date: Tue, 3 Feb 2026 15:35:09 -0500 Message-ID: <20260203203512.672552-15-jsnow@redhat.com> In-Reply-To: <20260203203512.672552-1-jsnow@redhat.com> References: <20260203203512.672552-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770151041788158500 Now that qmp has to be installed and isn't local, we can no longer offer a simple forwarder for these scripts (nor path hacks) and hope that it works. Encourage users to use the 'run' script to use these scripts instead. Signed-off-by: John Snow Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/compare-machine-types.py | 7 ++----- scripts/qmp/qemu-ga-client | 13 ++++++------- scripts/qmp/qmp-shell | 13 ++++++------- scripts/qmp/qmp-shell-wrap | 13 ++++++------- scripts/qmp/qom-fuse | 13 ++++++------- scripts/qmp/qom-get | 13 ++++++------- scripts/qmp/qom-list | 13 ++++++------- scripts/qmp/qom-set | 13 ++++++------- scripts/qmp/qom-tree | 13 ++++++------- scripts/qmp_helper.py | 9 ++------- scripts/render_block_graph.py | 10 +++++++--- scripts/simplebench/bench_block_job.py | 10 +++++++--- tests/migration-stress/guestperf/engine.py | 15 ++++++++++++--- 13 files changed, 78 insertions(+), 77 deletions(-) diff --git a/scripts/compare-machine-types.py b/scripts/compare-machine-typ= es.py index b4f899082a7..83be361f4f6 100755 --- a/scripts/compare-machine-types.py +++ b/scripts/compare-machine-types.py @@ -27,19 +27,16 @@ # along with this program; if not, see . =20 import sys -from os import path from argparse import ArgumentParser, RawTextHelpFormatter, Namespace import pandas as pd from contextlib import ExitStack from typing import Optional, List, Dict, Generator, Tuple, Union, Any, Set =20 try: - qemu_dir =3D path.abspath(path.dirname(path.dirname(__file__))) - sys.path.append(path.join(qemu_dir, 'python')) from qemu.machine import QEMUMachine except ModuleNotFoundError as exc: - print(f"Module '{exc.name}' not found.") - print("Try export PYTHONPATH=3Dtop-qemu-dir/python or run from top-qem= u-dir") + print(f"Module '{exc.name}' not found.", file=3Dsys.stderr) + print(f"Try $builddir/run {' '.join(sys.argv)}", file=3Dsys.stderr) sys.exit(1) =20 =20 diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client index 56edd0234a6..7ea01b9a11d 100755 --- a/scripts/qmp/qemu-ga-client +++ b/scripts/qmp/qemu-ga-client @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils import qemu_ga_client - - -if __name__ =3D=3D '__main__': - sys.exit(qemu_ga_client.main()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qemu-ga-client [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 4a20f97db70..436c4940c26 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.qmp import qmp_shell - - -if __name__ =3D=3D '__main__': - qmp_shell.main() +print( + "This script has moved; after running configure," + " please use '$builddir/run qmp-shell [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qmp-shell-wrap b/scripts/qmp/qmp-shell-wrap index 9e94da114f5..f63dadad1ed 100755 --- a/scripts/qmp/qmp-shell-wrap +++ b/scripts/qmp/qmp-shell-wrap @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.qmp import qmp_shell - - -if __name__ =3D=3D '__main__': - qmp_shell.main_wrap() +print( + "This script has moved; after running configure," + " please use '$builddir/run qmp-shell-wrap [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qom-fuse b/scripts/qmp/qom-fuse index d453807b273..7d4724a3710 100755 --- a/scripts/qmp/qom-fuse +++ b/scripts/qmp/qom-fuse @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils.qom_fuse import QOMFuse - - -if __name__ =3D=3D '__main__': - sys.exit(QOMFuse.entry_point()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qom-fuse [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qom-get b/scripts/qmp/qom-get index 04ebe052e82..96363539624 100755 --- a/scripts/qmp/qom-get +++ b/scripts/qmp/qom-get @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils.qom import QOMGet - - -if __name__ =3D=3D '__main__': - sys.exit(QOMGet.entry_point()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qom-get [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qom-list b/scripts/qmp/qom-list index 853b85a8d3f..e988274d1e7 100755 --- a/scripts/qmp/qom-list +++ b/scripts/qmp/qom-list @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils.qom import QOMList - - -if __name__ =3D=3D '__main__': - sys.exit(QOMList.entry_point()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qom-list [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qom-set b/scripts/qmp/qom-set index 06820feec42..c2569afdcd7 100755 --- a/scripts/qmp/qom-set +++ b/scripts/qmp/qom-set @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils.qom import QOMSet - - -if __name__ =3D=3D '__main__': - sys.exit(QOMSet.entry_point()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qom-set [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree index 760e172277e..b3cd5ab6f82 100755 --- a/scripts/qmp/qom-tree +++ b/scripts/qmp/qom-tree @@ -1,11 +1,10 @@ #!/usr/bin/env python3 =20 -import os import sys =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.utils.qom import QOMTree - - -if __name__ =3D=3D '__main__': - sys.exit(QOMTree.entry_point()) +print( + "This script has moved; after running configure," + " please use '$builddir/run qom-tree [...]' instead.", + file=3Dsys.stderr +) +sys.exit(1) diff --git a/scripts/qmp_helper.py b/scripts/qmp_helper.py index c1e7e0fd80c..521612fb946 100755 --- a/scripts/qmp_helper.py +++ b/scripts/qmp_helper.py @@ -13,17 +13,12 @@ import sys =20 from datetime import datetime -from os import path as os_path =20 try: - qemu_dir =3D os_path.abspath(os_path.dirname(os_path.dirname(__file__)= )) - sys.path.append(os_path.join(qemu_dir, 'python')) - from qemu.qmp.legacy import QEMUMonitorProtocol - except ModuleNotFoundError as exc: - print(f"Module '{exc.name}' not found.") - print("Try export PYTHONPATH=3Dtop-qemu-dir/python or run from top-qem= u-dir") + print(f"Module '{exc.name}' not found.", file=3Dsys.stderr) + print(f"Try $builddir/run {' '.join(sys.argv)}", file=3Dsys.stderr) sys.exit(1) =20 from base64 import b64encode diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py index 3e1a2e3fa71..b9079bbed52 100755 --- a/scripts/render_block_graph.py +++ b/scripts/render_block_graph.py @@ -24,9 +24,13 @@ import json from graphviz import Digraph =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) -from qemu.qmp import QMPError -from qemu.qmp.legacy import QEMUMonitorProtocol +try: + from qemu.qmp import QMPError + from qemu.qmp.legacy import QEMUMonitorProtocol +except ModuleNotFoundError as exc: + print(f"Module '{exc.name}' not found.", file=3Dsys.stderr) + print(f"Try $builddir/run {' '.join(sys.argv)}", file=3Dsys.stderr) + sys.exit(1) =20 =20 def perm(arr): diff --git a/scripts/simplebench/bench_block_job.py b/scripts/simplebench/b= ench_block_job.py index e575a3af10e..541a47e586d 100755 --- a/scripts/simplebench/bench_block_job.py +++ b/scripts/simplebench/bench_block_job.py @@ -25,9 +25,13 @@ import socket import json =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.machine import QEMUMachine -from qemu.qmp import ConnectError +try: + from qemu.machine import QEMUMachine + from qemu.qmp import ConnectError +except ModuleNotFoundError as exc: + print(f"Module '{exc.name}' not found.", file=3Dsys.stderr) + print(f"Try $builddir/run {' '.join(sys.argv)}", file=3Dsys.stderr) + sys.exit(1) =20 =20 def bench_block_job(cmd, cmd_args, qemu_args): diff --git a/tests/migration-stress/guestperf/engine.py b/tests/migration-s= tress/guestperf/engine.py index d8462db7653..8d2ed757af3 100644 --- a/tests/migration-stress/guestperf/engine.py +++ b/tests/migration-stress/guestperf/engine.py @@ -27,9 +27,18 @@ from guestperf.report import Report, ReportResult from guestperf.timings import TimingRecord, Timings =20 -sys.path.append(os.path.join(os.path.dirname(__file__), - '..', '..', '..', 'python')) -from qemu.machine import QEMUMachine +try: + from qemu.machine import QEMUMachine +except ModuleNotFoundError as exc: + print( + f"Module '{exc.name}' not found.\n" + "It should be installed as part of the configure-time " + "virtual environment in $builddir/pyvenv.\n" + "Try re-running this script as:\n" + f"> $builddir/run {' '.join(sys.argv)}", + file=3Dsys.stderr + ) + sys.exit(1) =20 # multifd supported compression algorithms MULTIFD_CMP_ALGS =3D ("zlib", "zstd", "qpl", "uadk") --=20 2.52.0