From nobody Sat Apr 20 08:21:37 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=1617803874; cv=none; d=zohomail.com; s=zohoarc; b=RX3qRtDypzKz0ObVqpB8NSn3nD6rpInSDmuydy/kAgtSVXSR7kQ22kk8C+vvYouEjepfyyW7aL+kuGsZnVlSr/ZmW6CKb/K++NtuEcxYfWlBL+popS1Fn23FxDb4K9H75OExfGW58w5kWZW3K404C/d9fhW7yVuhlDR2olA59qc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803874; 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=Pxo2xDkPBZq0jGlcet6sWPsY9iT0RrHJxDgGXh6qTYTJqrYlj8OKGZjQiuvxhb0+t4SGWCQkCmaF0b2OEGCHZ0YAtRyOpfkl/rjZ2Yd/rfvtuWvg7gXNJTYxl22eJyTOUmJNj8n1DZ6rOLtPe22q7pvwt8AyaMGG3bcb3nb/Was= 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 1617803874174110.46808928000098; Wed, 7 Apr 2021 06:57:54 -0700 (PDT) Received: from localhost ([::1]:46958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8gr-00048r-2H for importer@patchew.org; Wed, 07 Apr 2021 09:57:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zw-0003uL-QB for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zq-0005te-Lm for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:44 -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-417-FHlgrd-SPpS7H4wOhMCu7w-1; Wed, 07 Apr 2021 09:50:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49F04802B5B; Wed, 7 Apr 2021 13:50:34 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9ACA21964B; Wed, 7 Apr 2021 13:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803436; 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=DcbW+XZQG0m4Q+YnPXyfNbfW0N+mO7iM0zQ0ZSVtCSdNulWgrqipASB/2FS9edZRkVYKKQ Cif6c5+vH6vs7xDHYwAn2MwO1RkpBIKEBFwhlllx82Ls4BO3X2H1Pr98m8x/UWD1o0+jgL Gwesc+Uu3A3neciNUPvD9IlQrQaC3wE= X-MC-Unique: FHlgrd-SPpS7H4wOhMCu7w-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 01/11] python: qemu: add timer parameter for qmp.accept socket Date: Wed, 7 Apr 2021 15:50:11 +0200 Message-Id: <20210407135021.48330-2-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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 Sat Apr 20 08:21:37 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=1617803606; cv=none; d=zohomail.com; s=zohoarc; b=brRoUcCy3+DhkHsqN0z9kr+0L9i8YdO1SW1pvqPUmW8ZdlJ+Jn1IU//V8INYm63Pw3i2ns4+s/GFtKgZaW4ecjmFWSDC8j1ly06aB5ZV+pQ8JX6IWn3OOpJQgmouVMEZWIKrUYLbAc/KMGAyA7ml2lnHnDN6bJ3qDtTUXBBopEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803606; 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=rZb60AHYAxc2t644nFRKZffZboFDS8lZKfZBIUYO0sA=; b=mO3EFoqKxu7ZXZayovmFKxVmcPWlqu6jvogAkkqLTpmNdr8vJAdzQKuOCiCQXZgVcmMBK7zZNqt9guaA6g127s9JyhEvImINqIf7Dwn69Q/XKpI4RtF0h7njlJPKAYyv+FxKV4Xj3pnfF4RHjh8uVu7UIytSAYVpY81rxUWSDvk= 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 1617803606667484.60141386031705; Wed, 7 Apr 2021 06:53:26 -0700 (PDT) Received: from localhost ([::1]:60146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8cX-0006FE-JV for importer@patchew.org; Wed, 07 Apr 2021 09:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zy-0003xD-9w for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zv-0005ur-K1 for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:45 -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-256-2E8Yv19uOOy1etJCwH9IjA-1; Wed, 07 Apr 2021 09:50:38 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AC93100806B; Wed, 7 Apr 2021 13:50:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id A96981964B; Wed, 7 Apr 2021 13:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803439; 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=rZb60AHYAxc2t644nFRKZffZboFDS8lZKfZBIUYO0sA=; b=SYfhLOKGyQtmgiyQY+CG8NqGAIlR2FMUsjbj+S6Davmt7tm2UZtAw9/zrVLH4om4lJvgAb ey50b174BxWlUJTW1Av+w6d80V0XlJA6uQRedCUmTV/38WZ6awNILgHhobIo+YeyEKbO3q 9e8o/0bEU7AtIDz9iXYt3UMSRgAxuoI= X-MC-Unique: 2E8Yv19uOOy1etJCwH9IjA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 02/11] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine Date: Wed, 7 Apr 2021 15:50:12 +0200 Message-Id: <20210407135021.48330-3-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=170.10.133.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 , Paolo Bonzini , 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" Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 2 +- python/qemu/qtest.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index c721e07d63..18d32ebe45 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -109,7 +109,7 @@ def __init__(self, =20 self._binary =3D binary self._args =3D list(args) - self._wrapper =3D wrapper + self._wrapper =3D list(wrapper) =20 self._name =3D name or "qemu-%d" % os.getpid() self._test_dir =3D test_dir 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 --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617804244; cv=none; d=zohomail.com; s=zohoarc; b=H87yiH0X13ytiMg1gQrzDyzx6qRai+tUecxJHmAnRnfhuEehs9MqcJMxvHLx8760HmsSk2xVtks504BZVMeZYplKPahmkx3htwfXfUS3yMf6KFKXYda/U9mnwsGvogh6jKPvG1Ttny9kpguGPzT1XgCpQtE4xCaqqZCWLcBXvfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617804244; 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=5S5DhzLgPGbm54SWrZqD1VlfyYf6LCjxyu1q4hHByYg=; b=IyDtPteZQ/aWStRnBqiciKjiSJzoUXG+h6I6IAIFOXSwIxUfwv65JN3OYK4IoTsT24rklKccV0WkjNmMGSlsGSA96TE3qHt8F52Dz6FTrsEUAPshei7FKzJ95kxsYi5RKck3aXrBoYcxaeLUEVWBTvexFcE283ABkWOeUvZIb00= 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 1617804243998831.9619733267324; Wed, 7 Apr 2021 07:04:03 -0700 (PDT) Received: from localhost ([::1]:60878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8mo-0001ge-Dk for importer@patchew.org; Wed, 07 Apr 2021 10:04:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8a0-00041q-0H for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zw-0005vC-LQ for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50: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-586-X5Uw1FkiNOaf9W3trLe09w-1; Wed, 07 Apr 2021 09:50:40 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16E6E802B5B; Wed, 7 Apr 2021 13:50:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id B87BE59464; Wed, 7 Apr 2021 13:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803443; 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=5S5DhzLgPGbm54SWrZqD1VlfyYf6LCjxyu1q4hHByYg=; b=Y7xpp8vk+tr9CDAFNgHMdDu8UkBaq3mcBQRvWeFGCoQrS9EblXde9NOaBZpUvyTtSe9m7e LxALot1vqEFKOgDUqw/MNTabm4hX4riJJ1sP/3BYR2IkAzccBSX7LqtZfrRpF8rPJye9IF mROve0kThY/qYn+zrgt2LMZO4KHCVxs= X-MC-Unique: X5Uw1FkiNOaf9W3trLe09w-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 03/11] qemu-iotests: add option to attach gdbserver Date: Wed, 7 Apr 2021 15:50:13 +0200 Message-Id: <20210407135021.48330-4-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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 instance. if -gdb is not provided but $GDB_QEMU is set, ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 6 +++++- tests/qemu-iotests/iotests.py | 4 ++++ tests/qemu-iotests/testenv.py | 18 +++++++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index d1c87ceaf1..6186495eee 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -33,6 +33,9 @@ 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 gdbserver with $GDB_QEMU options. \ + Default is localhost:12345") p.add_argument('-misalign', action=3D'store_true', help=3D'misalign memory allocations') p.add_argument('--color', choices=3D['on', 'off', 'auto'], @@ -112,7 +115,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 testfinder =3D TestFinder(test_dir=3Denv.source_iotests) =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 90d0b62523..05d0dc0751 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -75,6 +75,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', '.') diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 1fbec854c1..669eb6b925 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 get_env(self) -> Dict[str, str]: env =3D {} @@ -163,7 +164,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 @@ -171,6 +173,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 @@ -268,7 +278,9 @@ def print_env(self) -> None: PLATFORM -- {platform} TEST_DIR -- {TEST_DIR} SOCK_DIR -- {SOCK_DIR} -SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER}""" +SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} +GDB_QEMU -- "{GDB_QEMU}" +""" =20 args =3D collections.defaultdict(str, self.get_env()) =20 --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617803603; cv=none; d=zohomail.com; s=zohoarc; b=khz40bUPg83BaUpHinh5y4hCNeQe2T+o/mQd4KRPNL7Kt3egc+85HCRUJV+mqAxtIO3MafTfSqgtnFpGoY9EXdC9DGiTtd++RM0w9hyeDuWL87AtKYmjaskDDBu/OihwxfRjEdc8W1LmEhEfVnYWb556qAnX/tNv7OY5qka9MvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803603; 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=2c9PWoZBwanCg4kf5DFuJ5LneYnpo2h+kLaMIS52jQ8=; b=FpOfFCJh1KRf5G08H3caFDOA+TngeKfZCAVwOu1gPhyc47i8V0JEzLLnu1KvV5OUAhqLBzxLj7qbxJlfRsEqWLZ/XNkiUnlOFk06hgptkAmkGdyihw/tmaLsmmBV5c8ng9bWsbsJtE1ljemSJP3aTubcmM2rpNc9b2cow8bsQ1w= 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 1617803603586562.8739392891846; Wed, 7 Apr 2021 06:53:23 -0700 (PDT) Received: from localhost ([::1]:59858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8cU-000682-AO for importer@patchew.org; Wed, 07 Apr 2021 09:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8a0-00042U-7N for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8Zy-0005xM-3N for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50: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-399-3XCI6sjGN86o7kKuIR4OJA-1; Wed, 07 Apr 2021 09:50:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8EEC6D255; Wed, 7 Apr 2021 13:50:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72B5959443; Wed, 7 Apr 2021 13:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803445; 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=2c9PWoZBwanCg4kf5DFuJ5LneYnpo2h+kLaMIS52jQ8=; b=aMBdnk9bzbvXMP0iFsZ8JbEmz6YCwC5l5Xx8ma3cnl7CKLKCtKkJWRrzOuBREf0kc66G/k 2apAkf5FhNrlUpr9MHMl9mchw3F4otdjHNpHGl760NXm61k2vXLmheVjjIrPEGXyoxlqi+ czPoBmEzVrYu0GCkdm8oNwFjPae5190= X-MC-Unique: 3XCI6sjGN86o7kKuIR4OJA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers Date: Wed, 7 Apr 2021 15:50:14 +0200 Message-Id: <20210407135021.48330-5-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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" Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 +++- tests/qemu-iotests/iotests.py | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 18d32ebe45..284b73385f 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/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 05d0dc0751..17f07710db 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -686,7 +686,10 @@ def qmp_to_opts(self, obj): =20 def get_qmp_events_filtered(self, wait=3D60.0): result =3D [] - for ev in self.get_qmp_events(wait=3Dwait): + qmp_wait =3D wait + if qemu_gdb: + qmp_wait =3D 0.0 + for ev in self.get_qmp_events(wait=3Dqmp_wait): result.append(filter_qmp_event(ev)) return result =20 @@ -987,13 +990,17 @@ def cancel_and_wait(self, drive=3D'drive0', force=3DF= alse, result =3D self.vm.qmp('block-job-cancel', device=3Ddrive, force= =3Dforce) self.assert_qmp(result, 'return', {}) =20 + qmp_wait =3D wait + if qemu_gdb: + qmp_wait =3D 0.0 + if resume: self.vm.resume_drive(drive) =20 cancelled =3D False result =3D None while not cancelled: - for event in self.vm.get_qmp_events(wait=3Dwait): + for event in self.vm.get_qmp_events(wait=3Dqmp_wait): if event['event'] =3D=3D 'BLOCK_JOB_COMPLETED' or \ event['event'] =3D=3D 'BLOCK_JOB_CANCELLED': self.assert_qmp(event, 'data/device', drive) @@ -1009,8 +1016,11 @@ def cancel_and_wait(self, drive=3D'drive0', force=3D= False, def wait_until_completed(self, drive=3D'drive0', check_offset=3DTrue, wait=3D60.0, error=3DNone): '''Wait for a block job to finish, returning the event''' + qmp_wait =3D wait + if qemu_gdb: + qmp_wait =3D 0.0 while True: - for event in self.vm.get_qmp_events(wait=3Dwait): + for event in self.vm.get_qmp_events(wait=3Dqmp_wait): if event['event'] =3D=3D 'BLOCK_JOB_COMPLETED': self.assert_qmp(event, 'data/device', drive) if error is None: @@ -1054,7 +1064,10 @@ def complete_and_wait(self, drive=3D'drive0', wait_r= eady=3DTrue, self.assertTrue(event['data']['type'] in ['mirror', 'commit']) =20 def pause_wait(self, job_id=3D'job0'): - with Timeout(3, "Timeout waiting for job to pause"): + def_timeout =3D 3 + if qemu_gdb: + def_timeout =3D 3000 + with Timeout(def_timeout, "Timeout waiting for job to pause"): while True: result =3D self.vm.qmp('query-block-jobs') found =3D False --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617804410; cv=none; d=zohomail.com; s=zohoarc; b=DV0NnjgEvlENReJDCfzRWMwAvoyFW90N58m4bodMCKXRqvb5zY41v/AHsqNnDbgOY7r8STZMaZAlfqy0JIFFA+lM07FMMoB5FSHmyPjHn6EffVFF/xT9E3pWLD5ac5d+WZLuytc9b9+BMUzi35M0k0l0JqcK9ZXgM+o5n2EedEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617804410; 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=d5oa5e6sHp1WBNsO402wgqR6Z78G7dKLLzhnlUJ0IPY=; b=PqtXnNis9NB2bhlzGbvnbwduWjoYZc2Pcxr5zNjP4wdMTRFRNIwtQcrlIxtDZKN/yQxTXfha/+AXkbl/4SArOxi8pU8Ewug7PNBG5Dp7CgdyxsHPwaIeK4H1u3Dtw5H8+JAy1hgEw2/4IvPgdrmnW5e5SWLzS8Npo53C/SjcHmE= 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 1617804410966857.0008328558603; Wed, 7 Apr 2021 07:06:50 -0700 (PDT) Received: from localhost ([::1]:37762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8pW-0003vU-Bp for importer@patchew.org; Wed, 07 Apr 2021 10:06:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8a2-00048P-Og for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8a1-0005yw-1R for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:50:50 -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-442-H8VuaQwJNWaBpQOIkemnDg-1; Wed, 07 Apr 2021 09:50:46 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80AD81883530; Wed, 7 Apr 2021 13:50:45 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20DF319C81; Wed, 7 Apr 2021 13:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803448; 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=d5oa5e6sHp1WBNsO402wgqR6Z78G7dKLLzhnlUJ0IPY=; b=E0tPYF5/uS6UpjJ9aGhYWGlB2T2e8aFvZEcsDbNP4syaaQRmuUQZF/kljs23FfywW1db0c nAWv/quK1OFVuCwhwW5vJdH3yleRkkwOhNGZhVbbVdGNcKaODHXbRwpfkoyaZLZ3FlWPBg rjK+iWkjCqFKRZstwEfXRatr8dfJiF8= X-MC-Unique: H8VuaQwJNWaBpQOIkemnDg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 05/11] qemu_iotests: insert gdbserver command line as wrapper for qemu binary Date: Wed, 7 Apr 2021 15:50:15 +0200 Message-Id: <20210407135021.48330-6-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=170.10.133.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 , Paolo Bonzini , 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" Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 17f07710db..8f6bb20af5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -579,7 +579,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) --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617803784; cv=none; d=zohomail.com; s=zohoarc; b=k64nfPnD9La+U21sujnnRnG53CEc2UBE9H/0SrPJK/d/aZ3MkJXWkejRoYjCdEtF/tiKwamft3LeElZjXwnY3V6K7dDk8YM1CmIZ2ZCNoao6my4utkp8WJuIP8NCZX59pYJLac/Q7/IpMQEWXk6sVNj7TzJsysJutlPRhGSOeBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803784; 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=NKd6rDcyMgEqN1DZG8qUNDe79MLYNxChrOupq4UGwrmLz8xoFNEaUc32ikmvq3oD4bE51jX9DYH89iage0a6WOgz22k5OgBYPUP8ULPqBGyDA8IuKDM6vYv7WpK3kTJ/5tIf2qocNpNTN9GoGGP0HKuPrgFg1n12X4fswc1Q9bY= 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 1617803784618305.20609690600213; Wed, 7 Apr 2021 06:56:24 -0700 (PDT) Received: from localhost ([::1]:41990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8fP-00022F-4J for importer@patchew.org; Wed, 07 Apr 2021 09:56:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aC-0004F7-QJ for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8a3-000618-IC for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:00 -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-491-oFHqha7nNTiG9kAvZr7imw-1; Wed, 07 Apr 2021 09:50:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6695E107ACCA; Wed, 7 Apr 2021 13:50:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id F117019CB4; Wed, 7 Apr 2021 13:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803450; 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=R5GattIndcNbREr+zAltEqU3It8bDSKIVVLiRtP3f1I3mA21AigbgO1cn1xDUEpPxOi+Lt BD+vnZ4g1QaKCDecPqGL3COd8eMR3yDhRHoyTikim+LYCnWaFwcZhMCzf1q4UvhUB8wR+5 ayiFqP9qPClDCgRzTi71FpZgX3m5JK0= X-MC-Unique: oFHqha7nNTiG9kAvZr7imw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 06/11] qemu-iotests: add gdbserver option to script tests too Date: Wed, 7 Apr 2021 15:50:16 +0200 Message-Id: <20210407135021.48330-7-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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 From nobody Sat Apr 20 08:21:37 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=1617804492; cv=none; d=zohomail.com; s=zohoarc; b=g79RIDtEktqVRZCh9c6cycnQNUm9/GFrAzVQBU9lzSVkNVbt33zW8BeKILdMRAlElL+n2wuwQV0v/BG4Kth+7oO1ui2yl9NxzUTcW1sMTLTpAdcNcH6PXFWCxWWmb3zNUCea2gcUzkr3Pk/jqoi8QI6fALlVgFeXsDpxo5Jk4VI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617804492; 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=a9T7LOfjIs6cHUmga+kF7UG5mDoM0SUJOfRYb+rRwTU=; b=eM2gEEhHW6X1o8rjtnHJKxR/4W1oX4vwzthlnRGMnz2Dbd+cTBu0NYnfoTBq9fDkreZU12ylvDupkB2d8ctPgpLoHukkjKgOhR4UVW6QGwUk4Pm848em1YtedUPti3wDbjnk7Aqs9fn8MZk3IMZj12X9tzOq+t3uOVggS0yM2ko= 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 1617804492169316.9026238338805; Wed, 7 Apr 2021 07:08:12 -0700 (PDT) Received: from localhost ([::1]:40504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8qo-00053I-Tx for importer@patchew.org; Wed, 07 Apr 2021 10:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aH-0004Id-1i for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aC-00062o-EI for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:04 -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-585-pP0lf_bDOAWvVakS1fmF1w-1; Wed, 07 Apr 2021 09:50:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22F88107ACF3; Wed, 7 Apr 2021 13:50:51 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD3511964B; Wed, 7 Apr 2021 13:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803453; 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=a9T7LOfjIs6cHUmga+kF7UG5mDoM0SUJOfRYb+rRwTU=; b=ca2NeLQBgS6iK2wG1D+m8dXO8/r+v2RVWgdlGjzcr/K2vAUxPtpVD89P2PuX9+zrFxiq4+ 6vbxmQZE/41kLSSXdYlAEmQC0MGroGGu8F9Hp6mjm8EzP4VqoFylHlK4Y9LUlHyXOzl7fv TYiEX9jJg/vOZFgmh8VNoCO3itX8X84= X-MC-Unique: pP0lf_bDOAWvVakS1fmF1w-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 07/11] qemu_iotests: extend the check script to support valgrind for python tests Date: Wed, 7 Apr 2021 15:50:17 +0200 Message-Id: <20210407135021.48330-8-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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" Currently, the check script only parses the option and sets the VALGRIND_QEMU environmental variable to "y". Add another iotests python variable that prepares the command line, identical to the one provided in the test scripts. Because the python script does not know in advance the valgrind PID to assign to the log file name, use the "%p" flag in valgrind log file name that automatically puts the process PID at runtime. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 11 +++++++++++ tests/qemu-iotests/testenv.py | 1 + 2 files changed, 12 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 8f6bb20af5..7c28f0cb74 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -96,6 +96,17 @@ sys.stderr.write('Please run this test via the "check" script\n') sys.exit(os.EX_USAGE) =20 +qemu_valgrind =3D [] +if os.environ.get('VALGRIND_QEMU') =3D=3D "y" and \ + os.environ.get('NO_VALGRIND') !=3D "y": + valgrind_logfile =3D "--log-file=3D" + test_dir.strip() + # %p allows to put the valgrind process PID, since + # we don't know it a priori (subprocess.Peopen is + # not yet invoked) + valgrind_logfile +=3D "/%p.valgrind" + + qemu_valgrind =3D ['valgrind', valgrind_logfile, '--error-exitcode=3D9= 9'] + socket_scm_helper =3D os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_help= er') =20 luks_default_secret_object =3D 'secret,id=3Dkeysec0,data=3D' + \ diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 669eb6b925..86798bf752 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -280,6 +280,7 @@ def print_env(self) -> None: SOCK_DIR -- {SOCK_DIR} SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} GDB_QEMU -- "{GDB_QEMU}" +VALGRIND_QEMU -- "{VALGRIND_QEMU}" """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617804145; cv=none; d=zohomail.com; s=zohoarc; b=DAR++s1VWrNW76asONLSrG5MRuCjzwTAZEOd6It2o+0zIr0XRjqcv4TPLh7lXoQ2NrgTAusOdAb2ZVuwR2I8+rDFAyTwnXAhXiS8jo/hddlDFAX91/nxK5eRlPdpI4gPoz3U58l7DvrJcNM8w0FIo+12NjBStnF26qFNGqF+YNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617804145; 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=HahSciXYiof22qQ/TBDonNH7Bk4OfSRFAavMNfm1WSE=; b=gTXsUG/K2rn7cjhl3f/SlRiVdvWNBU2UlwdnCh9x7IO6YxdpsFHnp8U4YqGbmLM63ueLZTummb4qcMW9lnsCCTJ2LoSOa4yMaNKNTs7WYSSHkxsvxxP37hfUhjZdUUMZtfOxV1MUoXylIH5Nl39eMFUrq5N6zclOrBDOPdqStoQ= 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 1617804145159372.79084456407566; Wed, 7 Apr 2021 07:02:25 -0700 (PDT) Received: from localhost ([::1]:57276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8lC-00006B-CC for importer@patchew.org; Wed, 07 Apr 2021 10:02:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aR-0004Jx-Cv for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aC-00063Z-FI for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:10 -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-181-grAiltDrPTS4EzdpqS79eQ-1; Wed, 07 Apr 2021 09:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D15051883520; Wed, 7 Apr 2021 13:50:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87DE059443; Wed, 7 Apr 2021 13:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803457; 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=HahSciXYiof22qQ/TBDonNH7Bk4OfSRFAavMNfm1WSE=; b=hpzZCS40OFEfz9T8SpJb+4BExsyiXIGjVUfxRvYrlEcIM6yRZ9S8oguU4jkpbH4O7yP1xR t7VAXmyOjrETguH3XP6aWPE+TAUBkHUUz0mH4OQTNhAYSjnbAEah1ROG7cLvpbAvmF3Fho fl1iUVTuV7aEiUtV1A0QTHnl92Lo0vI= X-MC-Unique: grAiltDrPTS4EzdpqS79eQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 08/11] qemu_iotests: extent QMP socket timeout when using valgrind Date: Wed, 7 Apr 2021 15:50:18 +0200 Message-Id: <20210407135021.48330-9-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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" As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout expires too soon. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 +++- tests/qemu-iotests/iotests.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 284b73385f..4b6eb39856 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -409,7 +409,9 @@ def _launch(self) -> None: shell=3DFalse, close_fds=3DFalse) =20 - timer =3D None if 'gdbserver' in self._wrapper else 15.0 + delay_timer =3D 'gdbserver' in self._wrapper + delay_timer |=3D 'valgrind' in self._wrapper + timer =3D None if delay_timer else 15.0 self._post_launch(timer) =20 def _early_cleanup(self) -> None: diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 7c28f0cb74..56733954b2 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -699,7 +699,7 @@ def qmp_to_opts(self, obj): def get_qmp_events_filtered(self, wait=3D60.0): result =3D [] qmp_wait =3D wait - if qemu_gdb: + if qemu_gdb or qemu_valgrind: qmp_wait =3D 0.0 for ev in self.get_qmp_events(wait=3Dqmp_wait): result.append(filter_qmp_event(ev)) @@ -1003,7 +1003,7 @@ def cancel_and_wait(self, drive=3D'drive0', force=3DF= alse, self.assert_qmp(result, 'return', {}) =20 qmp_wait =3D wait - if qemu_gdb: + if qemu_gdb or qemu_valgrind: qmp_wait =3D 0.0 =20 if resume: @@ -1029,7 +1029,7 @@ def wait_until_completed(self, drive=3D'drive0', chec= k_offset=3DTrue, wait=3D60.0, error=3DNone): '''Wait for a block job to finish, returning the event''' qmp_wait =3D wait - if qemu_gdb: + if qemu_gdb or qemu_valgrind: qmp_wait =3D 0.0 while True: for event in self.vm.get_qmp_events(wait=3Dqmp_wait): @@ -1077,7 +1077,7 @@ def complete_and_wait(self, drive=3D'drive0', wait_re= ady=3DTrue, =20 def pause_wait(self, job_id=3D'job0'): def_timeout =3D 3 - if qemu_gdb: + if qemu_gdb or qemu_valgrind: def_timeout =3D 3000 with Timeout(def_timeout, "Timeout waiting for job to pause"): while True: --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617804600; cv=none; d=zohomail.com; s=zohoarc; b=hGJRmHhX5X1+EFxSTxZ7Ve8dZKmlVNENK/mpp+Za8fHMj3sAA0wTyov8gVsCY/bXERK9xkMvh1XSr8J/MZAMmJX7xt6CGuRLEoKtLI7OIce9NPtXXQ1ryktUV09m0Ps3o9I0rHEMKqZ0RyYsyMNIoie9V+lTNsYgTRjFut3gzBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617804600; 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=uxqLC6J1dFzu0Fdk8XGoctTfOUij5tQwR5NAj6F5ld0=; b=FNd13VEfrqEZ2urrBiQFrja0sgBK/QjvE2GTVOLLxUDSObopLj6pefTQ3Jcfa6/+mglhlZ/JV8TzUG4aTnxE3AjPgc2nIxyd67g3UcCwzRqcl0e67Njm9JTo2D9co4ZCVBLZ/+LKXWiSCjeM3N+P5TojUdMawxjxfuSNtKUTaHM= 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 1617804600220255.5135063745613; Wed, 7 Apr 2021 07:10:00 -0700 (PDT) Received: from localhost ([::1]:43196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8sZ-0006FP-6h for importer@patchew.org; Wed, 07 Apr 2021 10:09:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aa-0004QU-Vh for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aC-000655-GA for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:17 -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-36-VCK7H7fKO2aY3WKyoOyFcg-1; Wed, 07 Apr 2021 09:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 012E8801814; Wed, 7 Apr 2021 13:50:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34694690F1; Wed, 7 Apr 2021 13:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803459; 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=uxqLC6J1dFzu0Fdk8XGoctTfOUij5tQwR5NAj6F5ld0=; b=U3/ehtZOIqV4AdJqZ7HyoY7TlW9KRGPYER1YNqRh08VkaAP4910YorqxOn+TFs4FMvUKUL ws2TMNUYiCosaj9uBX5JtAazKyP2GHvmIGA74tG1YQE5gOWPuB5p9DzDCGie9qTjc/uQ6a EUMy5Vl0v3DpSCafF+xsb7YPuohpEOw= X-MC-Unique: VCK7H7fKO2aY3WKyoOyFcg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 09/11] qemu_iotests: allow valgrint to print/delete the generated log file Date: Wed, 7 Apr 2021 15:50:19 +0200 Message-Id: <20210407135021.48330-10-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=170.10.133.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 , Paolo Bonzini , 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" When using valgrind on the test scripts, it generates a log file in $TEST_DIR that is either print (if valgrind finds problems) or otherwise deleted. Provide the same exact behavior when using -valgrind on the python tests. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 56733954b2..b6166b6f7b 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -597,6 +597,26 @@ def __init__(self, path_suffix=3D''): sock_dir=3Dsock_dir) self._num_drives =3D 0 =20 + def subprocess_check_valgrind(self, valgrind) -> None: + + if not valgrind: + return + + valgrind_filename =3D test_dir + "/" + str(self._popen.pid) + ".v= algrind" + + if self.exitcode() =3D=3D 99: + with open(valgrind_filename) as f: + content =3D f.readlines() + for line in content: + print(line, end =3D"") + print("") + else: + os.remove(valgrind_filename) + + def _post_shutdown(self) -> None: + super()._post_shutdown() + self.subprocess_check_valgrind(qemu_valgrind) + def add_object(self, opts): self._args.append('-object') self._args.append(opts) --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617803972; cv=none; d=zohomail.com; s=zohoarc; b=aDwxZtnRTdli/NfvWuG/RmSDKwCf0NThuhmik49qQk35WaLMabegurtATX8+Kg37XxoHPoB4oHpRvBubvkBw0+V5ZzsxlQpEBM7R3OSDbpHgekwFzPl2LLNim/XPRr7TND+PmQO5Hummaw+KB72cTkQ3B4e7cHmB5YqWOL1MKp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803972; 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=Dr/Edrw3t7ZX6Ov/GKXZk/NBJ/+rVL5wqc9yNJeU/HI=; b=dsyCPCAI+yXC0/63QjwRoQmcyr4FCeb4SSqtlmGpiaueQpkqjkLRNTK9A9kgoS/uKx2A56npX5ei60F0koj/3+0PpklfhQOSUlrae4JxQBniJGsAdrXa8FvMInc/dKzvjabQjt6YqH/9Nsuc/rQpaQM3t9LMGtsmg39kTfqDqwA= 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 1617803972723420.0596385181427; Wed, 7 Apr 2021 06:59:32 -0700 (PDT) Received: from localhost ([::1]:50724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8iR-0005hU-C2 for importer@patchew.org; Wed, 07 Apr 2021 09:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aR-0004Jw-Bw for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32220) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aL-00068W-G3 for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:12 -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-169-V0iBgL0DP0OhAzUfV5KA2g-1; Wed, 07 Apr 2021 09:51:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D33406D249; Wed, 7 Apr 2021 13:50:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C1AE19CB4; Wed, 7 Apr 2021 13:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803464; 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=Dr/Edrw3t7ZX6Ov/GKXZk/NBJ/+rVL5wqc9yNJeU/HI=; b=QrpdXeuQvRLFKTWE05sgtuazSst99pivxDFML+NpqMjvug7aZrqCaphLCgJGLdnr+uatCP cXk1EapIEjBuA4rQya12LBuAMOukdWFBWuq1Bv48nWS/UezH4Hm/ELvPOrdTecahOZn4/U mPJzZ1MeuLjXfcFvz44NBgRHRbGxHrw= X-MC-Unique: V0iBgL0DP0OhAzUfV5KA2g-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 10/11] qemu_iotests: insert valgrind command line as wrapper for qemu binary Date: Wed, 7 Apr 2021 15:50:20 +0200 Message-Id: <20210407135021.48330-11-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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 priority will be given to gdb command line, meaning if -gdb and -valgrind parameters are given, only gdb will be wrapped around the qemu binary. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b6166b6f7b..b23bfdfdff 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -590,7 +590,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, wrapper=3Dqemu_gdb, + wrapper =3D qemu_gdb if qemu_gdb else qemu_valgrind + super().__init__(qemu_prog, qemu_opts, wrapper=3Dwrapper, name=3Dname, test_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, --=20 2.30.2 From nobody Sat Apr 20 08:21:37 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=1617803672; cv=none; d=zohomail.com; s=zohoarc; b=npGf4dZ/0NHNWoTxvJnzxTQmIDRXnkECWQIVWmESRChepowj7VLnxk2hiPlahUD8Lmgq/8mx+h0E1SLvr9GIuXBfCtYjyNqXjjlPRASQYJ63PHfZmvh8xCnAZK5tt9ycY2t7e12+Rm2uodqUntDST4iXU1sO+8yiPMNXmhYshOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617803672; 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=CFLD9XLnlHBVfcqnc6zU/UvOnyMs2jmm0RJGLWbvG68=; b=NyfjZUNJtogPi4L0k1kiICe8h5zrAe++38Bi3CQrjT21PQspZvQBIxQ5AhlDPeK++0jTb56gtPaEHCicHw/9Tl0UgUjgXoxJGhcyUopfRtqN+dooXN4hBu1KcwcgPGaYIldsVzuxCdhmzxeXnjraNjV/b1/9b45jDVx3/z56bZQ= 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 1617803672489991.2743702681762; Wed, 7 Apr 2021 06:54:32 -0700 (PDT) Received: from localhost ([::1]:35884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8db-0007sg-BK for importer@patchew.org; Wed, 07 Apr 2021 09:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aa-0004QQ-Vb for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8aL-0006BO-HY for qemu-devel@nongnu.org; Wed, 07 Apr 2021 09:51:24 -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-545-f-Kzx1QCMPmB1M5awGgKYQ-1; Wed, 07 Apr 2021 09:51:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D1CD107ACED; Wed, 7 Apr 2021 13:51:05 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-163.ams2.redhat.com [10.36.115.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EC6719CB4; Wed, 7 Apr 2021 13:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617803468; 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=CFLD9XLnlHBVfcqnc6zU/UvOnyMs2jmm0RJGLWbvG68=; b=T2Q86ITFYOhNGQSAeddLgT1X4xJ1z1AbKzXhX34rBI4vL9BPzvBRJVWUfUuuUS8gMz27hd jUn80tg2D2xZNDIdfD24W0M63hYZkly+3yYfvu4VliB40DZ54nDpbkLTfdKpMm1VuKqqM0 FbOqjbJwctaMKTd2oiJhRSr2hS0PaYk= X-MC-Unique: f-Kzx1QCMPmB1M5awGgKYQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [RFC PATCH v2 11/11] qemu_iotests: add option to show qemu binary logs on stdout Date: Wed, 7 Apr 2021 15:50:21 +0200 Message-Id: <20210407135021.48330-12-eesposit@redhat.com> In-Reply-To: <20210407135021.48330-1-eesposit@redhat.com> References: <20210407135021.48330-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 , Paolo Bonzini , 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" Using the flag -p, allow the qemu binary to print to stdout. This is helpful especially for print-debugging. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 3 ++- tests/qemu-iotests/iotests.py | 9 +++++++++ tests/qemu-iotests/testenv.py | 9 +++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 6186495eee..6c469c14ff 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -33,6 +33,7 @@ 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('-p', dest=3D'print', action=3D'store_true', help=3D'en= able prints') p.add_argument('-gdb', action=3D'store_true', help=3D"start gdbserver with $GDB_QEMU options. \ Default is localhost:12345") @@ -116,7 +117,7 @@ if __name__ =3D=3D '__main__': aiomode=3Dargs.aiomode, cachemode=3Dargs.cachemode, imgopts=3Dargs.imgopts, misalign=3Dargs.misalign, debug=3Dargs.debug, valgrind=3Dargs.valgrind, - gdb=3Dargs.gdb) + gdb=3Dargs.gdb, qprint=3Dargs.print) =20 testfinder =3D TestFinder(test_dir=3Denv.source_iotests) =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b23bfdfdff..bb29074b63 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -79,6 +79,8 @@ if os.environ.get('GDB_QEMU'): qemu_gdb =3D ['gdbserver'] + os.environ.get('GDB_QEMU').strip().split(= ' ') =20 +qemu_print =3D os.environ.get('PRINT_QEMU', False) + imgfmt =3D os.environ.get('IMGFMT', 'raw') imgproto =3D os.environ.get('IMGPROTO', 'file') output_dir =3D os.environ.get('OUTPUT_DIR', '.') @@ -618,6 +620,13 @@ def _post_shutdown(self) -> None: super()._post_shutdown() self.subprocess_check_valgrind(qemu_valgrind) =20 + def _pre_launch(self) -> None: + super()._pre_launch() + if qemu_print and self._qemu_log_file !=3D None: + # set QEMU binary output to stdout + self._qemu_log_file.close() + self._qemu_log_file =3D None + def add_object(self, opts): self._args.append('-object') self._args.append(opts) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 86798bf752..9192d7154b 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -73,7 +73,7 @@ class TestEnv(ContextManager['TestEnv']): 'AIOMODE', 'CACHEMODE', 'VALGRIND_QEMU', 'CACHEMODE_IS_DEFAULT', 'IMGFMT_GENERIC', 'IMGOPTSSYN= TAX', 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_', - 'GDB_QEMU'] + 'GDB_QEMU', 'PRINT_QEMU'] =20 def get_env(self) -> Dict[str, str]: env =3D {} @@ -165,7 +165,8 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, misalign: bool =3D False, debug: bool =3D False, valgrind: bool =3D False, - gdb: bool =3D False) -> None: + gdb: bool =3D False, + qprint: bool =3D False) -> None: self.imgfmt =3D imgfmt self.imgproto =3D imgproto self.aiomode =3D aiomode @@ -173,6 +174,9 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, self.misalign =3D misalign self.debug =3D debug =20 + if qprint: + self.print_qemu =3D 'y' + self.gdb_qemu =3D os.getenv('GDB_QEMU') =20 if gdb and not self.gdb_qemu: @@ -281,6 +285,7 @@ def print_env(self) -> None: SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} GDB_QEMU -- "{GDB_QEMU}" VALGRIND_QEMU -- "{VALGRIND_QEMU}" +PRINT_QEMU -- "{PRINT_QEMU}" """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.30.2