From nobody Mon Feb 9 12:15:11 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1557241588; cv=none; d=zoho.com; s=zohoarc; b=GboMfwhqNIf9w9Qa4EKZHifOHTY6p0xGQnj+GueEYt8lZPOQwZe4l7BroQ7Ln+HB48WCMVaYjiTA7LpFxjkviPnM1HxG0pbI9yjyjy/cG6yUgLF4lPV7fpF5GIt7CNU58lhcj4+nF9HbA9F33HUMksZd7spcXGcCVT80GoiGQog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241588; h=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:ARC-Authentication-Results; bh=ucY4ClbqOMsBiqKMxrr7kXl9l/PFYJUyfBS77j8wzig=; b=CVUu830qkjv30obk7OKRSGeaL0Rx8s1fU4NSplGctZeHmTaXHLQdR+h0g4TWG1soo+rnWiasg2pByAa4Ji5O1VVPWlfOIEmIQGbk5/BKeXbWbrr2zl8IdK3xMdIz633BF+tGEZ3978bN+3cJBJaWEsjuXux9jJQeme9ZRapCLag= ARC-Authentication-Results: i=1; mx.zoho.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 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 1557241588513745.7563630124429; Tue, 7 May 2019 08:06:28 -0700 (PDT) Received: from localhost ([127.0.0.1]:48260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1fb-0007qZ-Fm for importer@patchew.org; Tue, 07 May 2019 11:06:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1bZ-0004zX-FW for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bY-0002Sx-AX for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38326) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bV-0002RV-R5; Tue, 07 May 2019 11:02:01 -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 mx1.redhat.com (Postfix) with ESMTPS id 22E8F30832C3; Tue, 7 May 2019 15:02:01 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 786E25C2E1; Tue, 7 May 2019 15:01:59 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:53 -0500 Message-Id: <20190507150153.26859-6-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 07 May 2019 15:02:01 +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 5/5] iotests: Make 182 do without device_add 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 , Alberto Garcia , "open list:Block layer core" , "Danilo C . L . de Paula" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz 182 fails if qemu has no support for hotplugging of a virtio-blk device. Using an NBD server instead works just as well for the test, even on qemus without hotplugging support. Fixes: 6d0a4a0fb5c8f10c8eb68b52cfda0082b00ae963 Reported-by: Danilo C. L. de Paula Signed-off-by: Max Reitz Message-Id: <20190417153005.30096-1-mreitz@redhat.com> Tested-by: Eric Blake Reviewed-by: Eric Blake Acked-by: Alberto Garcia Signed-off-by: Eric Blake --- tests/qemu-iotests/182 | 22 +++++++++++++++++----- tests/qemu-iotests/182.out | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182 index ff3d7e7ec1b..38959bf276a 100755 --- a/tests/qemu-iotests/182 +++ b/tests/qemu-iotests/182 @@ -31,6 +31,7 @@ _cleanup() { _cleanup_test_img rm -f "$TEST_IMG.overlay" + rm -f "$TEST_DIR/nbd.socket" } trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -126,15 +127,26 @@ success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ 'return' \ 'error' -# Now we attach the image to a virtio-blk device. This device does -# require some permissions (at least WRITE and READ_CONSISTENT), so if +# Start an NBD server to which we can attach node1 +success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ + "{'execute': 'nbd-server-start', + 'arguments': { + 'addr': { + 'type': 'unix', + 'data': { + 'path': '$TEST_DIR/nbd.socket' + } } } }" \ + 'return' \ + 'error' + +# Now we attach the image to the NBD server. This server does require +# some permissions (at least WRITE and READ_CONSISTENT), so if # reopening node0 unshared any (which it should not have), this will # fail (but it should not). success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ - "{'execute': 'device_add', + "{'execute': 'nbd-server-add', 'arguments': { - 'driver': 'virtio-blk', - 'drive': 'node1' + 'device': 'node1' } }" \ 'return' \ 'error' diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out index af501ca3f3c..33d41eea915 100644 --- a/tests/qemu-iotests/182.out +++ b/tests/qemu-iotests/182.out @@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=3Dqcow2 size= =3D197120 backing_file=3DTEST_D {"return": {}} {"return": {}} {"return": {}} +{"return": {}} *** done --=20 2.20.1