From nobody Tue Apr 15 14:49:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.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 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537890063291563.2104364775579; Tue, 25 Sep 2018 08:41:03 -0700 (PDT) Received: from localhost ([::1]:53794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4pSG-0005va-50 for importer@patchew.org; Tue, 25 Sep 2018 11:40:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4p4t-0001GH-KQ for qemu-devel@nongnu.org; Tue, 25 Sep 2018 11:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4p4s-0005UC-5Q for qemu-devel@nongnu.org; Tue, 25 Sep 2018 11:16:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58284) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4p4m-0005Kh-NM; Tue, 25 Sep 2018 11:16:36 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C783C308FB86; Tue, 25 Sep 2018 15:16:35 +0000 (UTC) Received: from localhost (unknown [10.40.205.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B10B861E0; Tue, 25 Sep 2018 15:16:33 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 25 Sep 2018 17:15:20 +0200 Message-Id: <20180925151541.18932-22-mreitz@redhat.com> In-Reply-To: <20180925151541.18932-1-mreitz@redhat.com> References: <20180925151541.18932-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 25 Sep 2018 15:16:35 +0000 (UTC) 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 21/42] qemu-iotests: Test snapshot=on with nonexistent TMPDIR 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia We just fixed a bug that was causing a use-after-free when QEMU was unable to create a temporary snapshot. This is a test case for this scenario. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- tests/qemu-iotests/051 | 3 +++ tests/qemu-iotests/051.out | 3 +++ tests/qemu-iotests/051.pc.out | 3 +++ 3 files changed, 9 insertions(+) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index ee9c820d0f..25d3b2d478 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -354,6 +354,9 @@ printf %b "qemu-io $device_id \"write -P 0x33 0 4k\"\nc= ommit $device_id\n" | =20 $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io =20 +# Using snapshot=3Don with a non-existent TMPDIR +TMPDIR=3D/nonexistent run_qemu -drive driver=3Dnull-co,snapshot=3Don + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index b7273505c7..793af2ab96 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -455,4 +455,7 @@ wrote 4096/4096 bytes at offset 0 =20 read 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Testing: -drive driver=3Dnull-co,snapshot=3Don +QEMU_PROG: -drive driver=3Dnull-co,snapshot=3Don: Could not get temporary = filename: No such file or directory + *** done diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index e9257fe318..ca64edae6a 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -527,4 +527,7 @@ wrote 4096/4096 bytes at offset 0 =20 read 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Testing: -drive driver=3Dnull-co,snapshot=3Don +QEMU_PROG: -drive driver=3Dnull-co,snapshot=3Don: Could not get temporary = filename: No such file or directory + *** done --=20 2.17.1