From nobody Wed Dec 17 05:42:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551111596741412.28089760160935; Mon, 25 Feb 2019 08:19:56 -0800 (PST) Received: from localhost ([127.0.0.1]:39937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyIyw-00066g-GT for importer@patchew.org; Mon, 25 Feb 2019 11:19:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyI6Z-00023P-Ip for qemu-devel@nongnu.org; Mon, 25 Feb 2019 10:23:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyI6W-0002I8-8t for qemu-devel@nongnu.org; Mon, 25 Feb 2019 10:23:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyI6I-000270-Cx; Mon, 25 Feb 2019 10:23:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD1993091D52; Mon, 25 Feb 2019 15:23:23 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-243.ams2.redhat.com [10.36.117.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE60F5C22B; Mon, 25 Feb 2019 15:23:22 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Mon, 25 Feb 2019 16:20:53 +0100 Message-Id: <20190225152053.15976-72-kwolf@redhat.com> In-Reply-To: <20190225152053.15976-1-kwolf@redhat.com> References: <20190225152053.15976-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 25 Feb 2019 15:23:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 71/71] iotests: Skip 211 on insufficient memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz VDI keeps the whole bitmap in memory, and the maximum size (which is tested here) is 2 GB. This may not be available on all machines, and it rarely is available when running a 32 bit build. Fix this by making VM.run_job() return the error string if an error occurred, and checking whether that contains "Could not allocate bmap" in 211. If so, the test is skipped. Signed-off-by: Max Reitz Message-id: 20190218180646.30282-1-mreitz@redhat.com Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Max Reitz --- tests/qemu-iotests/211 | 4 +++- tests/qemu-iotests/iotests.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211 index 5d285450b5..6afc894f76 100755 --- a/tests/qemu-iotests/211 +++ b/tests/qemu-iotests/211 @@ -32,7 +32,9 @@ def blockdev_create(vm, options): =20 if 'return' in result: assert result['return'] =3D=3D {} - vm.run_job('job0') + error =3D vm.run_job('job0') + if error and 'Could not allocate bmap' in error: + iotests.notrun('Insufficient memory') iotests.log("") =20 with iotests.FilePath('t.vdi') as disk_path, \ diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 387e026556..4910fb2005 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -532,7 +532,9 @@ class VM(qtest.QEMUQtestMachine): log(result, filters, indent=3Dindent) return result =20 + # Returns None on success, and an error string on failure def run_job(self, job, auto_finalize=3DTrue, auto_dismiss=3DFalse): + error =3D None while True: for ev in self.get_qmp_events_filtered(wait=3DTrue): if ev['event'] =3D=3D 'JOB_STATUS_CHANGE': @@ -541,13 +543,14 @@ class VM(qtest.QEMUQtestMachine): result =3D self.qmp('query-jobs') for j in result['return']: if j['id'] =3D=3D job: + error =3D j['error'] log('Job failed: %s' % (j['error'])) elif status =3D=3D 'pending' and not auto_finalize: self.qmp_log('job-finalize', id=3Djob) elif status =3D=3D 'concluded' and not auto_dismiss: self.qmp_log('job-dismiss', id=3Djob) elif status =3D=3D 'null': - return + return error else: iotests.log(ev) =20 --=20 2.20.1