From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:33505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGmVt-0006fn-QV for qemu-devel@nongnu.org; Wed, 17 Apr 2019 11:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGmVs-0002Rs-Q3 for qemu-devel@nongnu.org; Wed, 17 Apr 2019 11:30:17 -0400 From: Max Reitz Date: Wed, 17 Apr 2019 17:30:05 +0200 Message-Id: <20190417153005.30096-1-mreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] iotests: Make 182 do without device_add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Kevin Wolf , Alberto Garcia 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 --- To reintroduce the bug for which this test was written, revert the following commits: $ git revert -n \ 23dece19da41724349809873923e20a48b619cb7 \ 6ceabe6f77e4ae5ac2fa3d2ac1be11dc95021941 \ a6aeca0ca530f104b5a5dd6704fca22b2c5edefa \ 577a133988c76e4ebf01d050d0d758d207a1baf7 --- 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 ff3d7e7ec1..38959bf276 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 =20 @@ -126,15 +127,26 @@ success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE = \ 'return' \ 'error' =20 -# 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 af501ca3f3..33d41eea91 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01B6EC282DA for ; Wed, 17 Apr 2019 15:31:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7FDC20674 for ; Wed, 17 Apr 2019 15:31:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7FDC20674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:55382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGmXC-0007OQ-OP for qemu-devel@archiver.kernel.org; Wed, 17 Apr 2019 11:31:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGmVt-0006fn-QV for qemu-devel@nongnu.org; Wed, 17 Apr 2019 11:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGmVs-0002Rs-Q3 for qemu-devel@nongnu.org; Wed, 17 Apr 2019 11:30:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54222) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGmVq-0002Oo-Ci; Wed, 17 Apr 2019 11:30:14 -0400 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 6E58A88ABE; Wed, 17 Apr 2019 15:30:10 +0000 (UTC) Received: from localhost (ovpn-204-140.brq.redhat.com [10.40.204.140]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5220B5C207; Wed, 17 Apr 2019 15:30:07 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 17 Apr 2019 17:30:05 +0200 Message-Id: <20190417153005.30096-1-mreitz@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.26]); Wed, 17 Apr 2019 15:30:11 +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] [PATCH] 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 , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190417153005.QnnRm_7IIK0B5wPOvCnQ9ICwBFCRCWaB7mWp0jso3d0@z> 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 --- To reintroduce the bug for which this test was written, revert the following commits: $ git revert -n \ 23dece19da41724349809873923e20a48b619cb7 \ 6ceabe6f77e4ae5ac2fa3d2ac1be11dc95021941 \ a6aeca0ca530f104b5a5dd6704fca22b2c5edefa \ 577a133988c76e4ebf01d050d0d758d207a1baf7 --- 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 ff3d7e7ec1..38959bf276 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 =20 @@ -126,15 +127,26 @@ success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE = \ 'return' \ 'error' =20 -# 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 af501ca3f3..33d41eea91 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