From nobody Mon Apr 29 14:29:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617285529; cv=none; d=zohomail.com; s=zohoarc; b=aLKWO/Gv7KI/dqR+CUrd4Fe6YtYtYw3qvcSQUEHDIhxj+Pv3XpKalsczDS9cZCI21mPQOFj/9MpPKuzomWtuyXQprffCrsZ+pQcHcR/9xbLg8Ck/Zj3ad7rGJFfW+F/6UwR5bImKAlqJ5x1+jXrmst9XijeCOvM37KM7f2+6a5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617285529; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kBydi4G2HMTWGs+miE3qhbLvy6VWo1EygufKXdW6AGY=; b=EFlLcHALYwHms4OOP+Y95FDH4odlnptIUoFj7omfbkucxriDSFY4LwjUUAwe9bYDNr7kVC8zMdSzncOgZp23GxbQunE+ieLqzKzZLmY7hHaAf0pDkIUjnUYiAfSMO2vcQP4ljf/vlciQMdjR7/f82dev/M62I0nvwbxh8q6iBq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617285529706129.2306839620354; Thu, 1 Apr 2021 06:58:49 -0700 (PDT) Received: from localhost ([::1]:55716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRxqS-0001i5-Gv for importer@patchew.org; Thu, 01 Apr 2021 09:58:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpT-0000ak-BV for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpQ-0005U3-Jx for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-nQuY2V5WPXGQGY0onjHx0A-1; Thu, 01 Apr 2021 09:57:42 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63D65107B7C4; Thu, 1 Apr 2021 13:57:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-128.ams2.redhat.com [10.36.113.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 395A35D6B1; Thu, 1 Apr 2021 13:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617285463; 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=kBydi4G2HMTWGs+miE3qhbLvy6VWo1EygufKXdW6AGY=; b=ZrpoX/yLcnJh/b9jwe4X7NGgdODE4OVmEf32t+1dyEwrzcZzZjXUcu+J13UBDnlsxxn96f /UapsRHsn8j3TFtPDAHdFMQjOP9gEg+W5WT5JLWAHmS6h8xjeWiSG3tuEwCJNelsj7YUmp iHAN72QzREM/n4lHcDu9OLTq7wIySb8= X-MC-Unique: nQuY2V5WPXGQGY0onjHx0A-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH 1/3] python: qemu: add timer parameter for qmp.accept socket Date: Thu, 1 Apr 2021 15:57:31 +0200 Message-Id: <20210401135733.32177-2-eesposit@redhat.com> In-Reply-To: <20210401135733.32177-1-eesposit@redhat.com> References: <20210401135733.32177-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Emanuele Giuseppe Esposito , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Extend the _post_launch function to include the timer as parameter instead of defaulting to 15 sec. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 ++-- python/qemu/qtest.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 6e44bda337..c721e07d63 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -321,9 +321,9 @@ def _pre_launch(self) -> None: nickname=3Dself._name ) =20 - def _post_launch(self) -> None: + def _post_launch(self, timer) -> None: if self._qmp_connection: - self._qmp.accept() + self._qmp.accept(timer) =20 def _post_shutdown(self) -> None: """ diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py index 39a0cf62fe..0d01715086 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -138,9 +138,9 @@ def _pre_launch(self) -> None: super()._pre_launch() self._qtest =3D QEMUQtestProtocol(self._qtest_path, server=3DTrue) =20 - def _post_launch(self) -> None: + def _post_launch(self, timer) -> None: assert self._qtest is not None - super()._post_launch() + super()._post_launch(timer) self._qtest.accept() =20 def _post_shutdown(self) -> None: --=20 2.30.2 From nobody Mon Apr 29 14:29:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617285639; cv=none; d=zohomail.com; s=zohoarc; b=PNiaQUsgdEm5h0v/qr7OVrA01fIaaWVeBVpCN+ENzTtyuls9xulkUtzDkKZBxRCNp5daBTuSsT1sji1Y36uany0SWmlc2eMTc83iyjUZUndDquGNRIsUyNBYFzreT/YusFbf1H9de4LMWXA2h0ct9ZBtpnS7FWm3RHbBsCfHsV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617285639; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=06zkH2GcUMaNtbOjoz06jRcUceiEYuacsyKkje1TjRo=; b=farTODBsK2EP6KDaNtcRvoXD6FSAK7XMvbRffByieGwbfMsf3eYY5XYY/rc906LkJph6aRDm7s1He8nxgpwF4eDq8YpywQFtFpO++6Ljq0w7qxYg0r3CyPSHRVCbOhIl1ezs0PNvqWlw65gB9DFPvbbASQlgo/GFsKg2XcWzp3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617285638814116.74163928142343; Thu, 1 Apr 2021 07:00:38 -0700 (PDT) Received: from localhost ([::1]:58816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRxsB-00033t-JQ for importer@patchew.org; Thu, 01 Apr 2021 10:00:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpV-0000gF-HV for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpT-0005VS-Hd for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-559-K6zz-nq5NMis-VyuGF7-6g-1; Thu, 01 Apr 2021 09:57:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA9238710F4; Thu, 1 Apr 2021 13:57:43 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-128.ams2.redhat.com [10.36.113.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id C37D15D6B1; Thu, 1 Apr 2021 13:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617285466; 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=06zkH2GcUMaNtbOjoz06jRcUceiEYuacsyKkje1TjRo=; b=cM96T6/abXPJp0YjtwvBWumXDHqjz5XQoADB1ATan2QQjNVsUjCdgcW0g5d8Ee2AIlOJOU 8eX+1IxlNwUb6d70HTR1IJBbbk+iF2UAH1rAkNX/tExd/s4w5iM2+4Urn2dFnL102mQbGC 2vrmCIhre5pV0fLhPOjk5O3PL2eOYa8= X-MC-Unique: K6zz-nq5NMis-VyuGF7-6g-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH 2/3] qemu-iotests: add option to attach gdbserver Date: Thu, 1 Apr 2021 15:57:32 +0200 Message-Id: <20210401135733.32177-3-eesposit@redhat.com> In-Reply-To: <20210401135733.32177-1-eesposit@redhat.com> References: <20210401135733.32177-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Emanuele Giuseppe Esposito , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu_system instance. The GDB_QEMU will just contain the options to provide to gdbserver, if empty and -gdb is set it will default to "localhost:12345". The gdb option is provided to python/qemu/machine.py through the "wrapper" parameter, currently unused by qemu-iotests. Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU, otherwise the connection will drop after 15 seconds. if -gdb is not provided but $GDB_QEMU is set, the script will ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 +++- python/qemu/qtest.py | 4 +++- tests/qemu-iotests/check | 5 ++++- tests/qemu-iotests/iotests.py | 7 ++++++- tests/qemu-iotests/testenv.py | 15 +++++++++++++-- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index c721e07d63..d7fca6b3c1 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -408,7 +408,9 @@ def _launch(self) -> None: stderr=3Dsubprocess.STDOUT, shell=3DFalse, close_fds=3DFalse) - self._post_launch() + + timer =3D None if 'gdbserver' in self._wrapper else 15.0 + self._post_launch(timer) =20 def _early_cleanup(self) -> None: """ diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py index 0d01715086..4c90daf430 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -111,6 +111,7 @@ class QEMUQtestMachine(QEMUMachine): def __init__(self, binary: str, args: Sequence[str] =3D (), + wrapper: Sequence[str] =3D (), name: Optional[str] =3D None, test_dir: str =3D "/var/tmp", socket_scm_helper: Optional[str] =3D None, @@ -119,7 +120,8 @@ def __init__(self, name =3D "qemu-%d" % os.getpid() if sock_dir is None: sock_dir =3D test_dir - super().__init__(binary, args, name=3Dname, test_dir=3Dtest_dir, + super().__init__(binary, args, wrapper=3Dwrapper, name=3Dname, + test_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, sock_dir=3Dsock_dir) self._qtest: Optional[QEMUQtestProtocol] =3D None diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index df9fd733ff..5a1d0518f1 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -36,6 +36,8 @@ def make_argparser() -> argparse.ArgumentParser: help=3D'pretty print output for make check') =20 p.add_argument('-d', dest=3D'debug', action=3D'store_true', help=3D'de= bug') + p.add_argument('-gdb', action=3D'store_true', + help=3D"start gdb server on localhost. Default port is = 12345") p.add_argument('-misalign', action=3D'store_true', help=3D'misalign memory allocations') p.add_argument('--color', choices=3D['on', 'off', 'auto'], @@ -115,7 +117,8 @@ if __name__ =3D=3D '__main__': env =3D TestEnv(imgfmt=3Dargs.imgfmt, imgproto=3Dargs.imgproto, aiomode=3Dargs.aiomode, cachemode=3Dargs.cachemode, imgopts=3Dargs.imgopts, misalign=3Dargs.misalign, - debug=3Dargs.debug, valgrind=3Dargs.valgrind) + debug=3Dargs.debug, valgrind=3Dargs.valgrind, + gdb=3Dargs.gdb) =20 if len(sys.argv) > 1 and sys.argv[-len(args.tests)-1] =3D=3D '--': if not args.tests: diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 2a34eef601..138cf135ea 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -74,6 +74,10 @@ qemu_prog =3D os.environ.get('QEMU_PROG', 'qemu') qemu_opts =3D os.environ.get('QEMU_OPTIONS', '').strip().split(' ') =20 +qemu_gdb =3D [] +if os.environ.get('GDB_QEMU'): + qemu_gdb =3D ['gdbserver'] + os.environ.get('GDB_QEMU').strip().split(= ' ') + imgfmt =3D os.environ.get('IMGFMT', 'raw') imgproto =3D os.environ.get('IMGPROTO', 'file') output_dir =3D os.environ.get('OUTPUT_DIR', '.') @@ -574,7 +578,8 @@ class VM(qtest.QEMUQtestMachine): =20 def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) - super().__init__(qemu_prog, qemu_opts, name=3Dname, + super().__init__(qemu_prog, qemu_opts, wrapper=3Dqemu_gdb, + name=3Dname, test_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, sock_dir=3Dsock_dir) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 169268f61a..62749becbd 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -72,7 +72,8 @@ class TestEnv(ContextManager['TestEnv']): 'QEMU_NBD_OPTIONS', 'IMGOPTS', 'IMGFMT', 'IMGPROTO', 'AIOMODE', 'CACHEMODE', 'VALGRIND_QEMU', 'CACHEMODE_IS_DEFAULT', 'IMGFMT_GENERIC', 'IMGOPTSSYN= TAX', - 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_'] + 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_', + 'GDB_QEMU'] =20 def prepare_subprocess(self, args: List[str]) -> Dict[str, str]: if self.debug: @@ -178,7 +179,8 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, imgopts: Optional[str] =3D None, misalign: bool =3D False, debug: bool =3D False, - valgrind: bool =3D False) -> None: + valgrind: bool =3D False, + gdb: bool =3D False) -> None: self.imgfmt =3D imgfmt self.imgproto =3D imgproto self.aiomode =3D aiomode @@ -186,6 +188,14 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode= : str, self.misalign =3D misalign self.debug =3D debug =20 + self.gdb_qemu =3D os.getenv('GDB_QEMU') + + if gdb and not self.gdb_qemu: + self.gdb_qemu =3D 'localhost:12345' + elif self.gdb_qemu and not gdb: + del self.gdb_qemu + del os.environ['GDB_QEMU'] + if valgrind: self.valgrind_qemu =3D 'y' =20 @@ -284,6 +294,7 @@ def print_env(self) -> None: TEST_DIR -- {TEST_DIR} SOCK_DIR -- {SOCK_DIR} SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} +GDB_QEMU -- "{GDB_QEMU}" """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.30.2 From nobody Mon Apr 29 14:29:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617285744; cv=none; d=zohomail.com; s=zohoarc; b=hKz6fjfMr7JbFnE5tM+g1aiU6MXwmREPEqUW8jQzx4RZTXeSXAWTwEfrZhltC90PwW4ePiY0cgoonhGiAXjuzROLaXVWKZZeVdki29yXlzD82d74/0ByAWB5B14F3mdEmJDnlnbxUgYTzjBZ6JhJcnAAOu1fQDL3XnxBEZGu52Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617285744; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d62TMt5YDr4JQhQ2/G1Iwa/04QA/k+hmEugujLvxxvY=; b=Bz1RTTJilk228lyA8SWUo6wB92phIE/CqU6tI9Li1t9XWsljBuaIJgWFnDlLF0HH3mTmFctkuN31a29Dkl3aThZPhCnnl1inBGf5uG1GAujuiGrwJy8sNOJwTroygXfeq+5mFHtjaO4vnwxNiIOx0tMHHC5Lz8nunYBI0IMOXMI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617285744569989.8978077576261; Thu, 1 Apr 2021 07:02:24 -0700 (PDT) Received: from localhost ([::1]:32926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRxtu-0004BM-E7 for importer@patchew.org; Thu, 01 Apr 2021 10:02:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpX-0000l2-J2 for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRxpV-0005XT-Ut for qemu-devel@nongnu.org; Thu, 01 Apr 2021 09:57:51 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-RNrNAaEyM0yGXvBg5fS3Sw-1; Thu, 01 Apr 2021 09:57:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83F22107ACCD; Thu, 1 Apr 2021 13:57:46 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-128.ams2.redhat.com [10.36.113.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51F485D6B1; Thu, 1 Apr 2021 13:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617285468; 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=d62TMt5YDr4JQhQ2/G1Iwa/04QA/k+hmEugujLvxxvY=; b=eaSFSjS6TwEITjlZkTPjVdsxLXuk2jZ5lnz1rpIvICVdTxBP13H0pqzUwwM8b5HsHuDtbv ESDjp5I0vjd1XqLtXCBGbYuk/kFKXuk5ZRCH7rjZlKp/bQaY/PiFXbX95matVUWHCjxTGk GGyMqWCOGqX9O3YvuIV8w/MkJPvZwdM= X-MC-Unique: RNrNAaEyM0yGXvBg5fS3Sw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH 3/3] qemu-iotests: add gdbserver option to script tests too Date: Thu, 1 Apr 2021 15:57:33 +0200 Message-Id: <20210401135733.32177-4-eesposit@redhat.com> In-Reply-To: <20210401135733.32177-1-eesposit@redhat.com> References: <20210401135733.32177-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Emanuele Giuseppe Esposito , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The only limitation here is that running a script with gdbserver will make the test output mismatch with the expected results, making the test fail. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 65cdba5723..53a3310fee 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -166,8 +166,14 @@ _qemu_wrapper() if [ -n "${QEMU_NEED_PID}" ]; then echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" fi + + GDB=3D"${QEMU_PROG}" + if [ ! -z ${GDB_QEMU} ]; then + GDB=3D"gdbserver ${GDB_QEMU} ${GDB}" + fi + VALGRIND_QEMU=3D"${VALGRIND_QEMU_VM}" _qemu_proc_exec "${VALGRIND_= LOGFILE}" \ - "$QEMU_PROG" $QEMU_OPTIONS "$@" + $GDB $QEMU_OPTIONS "$@" ) RETVAL=3D$? _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL --=20 2.30.2