From patchwork Tue Jan 12 15:47:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 566614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 89CD11402A1 for ; Wed, 13 Jan 2016 02:50:32 +1100 (AEDT) Received: from localhost ([::1]:32776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ1DK-0001pW-Fb for incoming@patchwork.ozlabs.org; Tue, 12 Jan 2016 10:50:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ1BD-0006Pt-VD for qemu-devel@nongnu.org; Tue, 12 Jan 2016 10:48:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ1BC-0006qk-UH for qemu-devel@nongnu.org; Tue, 12 Jan 2016 10:48:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ1BA-0006nk-SP; Tue, 12 Jan 2016 10:48:16 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 73C631416; Tue, 12 Jan 2016 15:48:16 +0000 (UTC) Received: from localhost (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0CFmEcT031687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 12 Jan 2016 10:48:16 -0500 From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 12 Jan 2016 16:47:54 +0100 Message-Id: <1452613674-12248-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1452613674-12248-1-git-send-email-mreitz@redhat.com> References: <1452613674-12248-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Peter Maydell , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , John Snow Subject: [Qemu-devel] [PATCH 4/4] block/qapi: Emit tray_open only if there is a tray X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qapi.c | 2 +- tests/qemu-iotests/067.out | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 58d3975..12a0f25 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -299,7 +299,7 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info, info->locked = blk_dev_is_medium_locked(blk); info->removable = blk_dev_has_removable_media(blk); - if (blk_dev_has_removable_media(blk)) { + if (blk_dev_has_tray(blk)) { info->has_tray_open = true; info->tray_open = blk_dev_is_tray_open(blk); } diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out index 27ad56f..ae3fccb 100644 --- a/tests/qemu-iotests/067.out +++ b/tests/qemu-iotests/067.out @@ -169,7 +169,6 @@ Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false }, - "tray_open": false, "type": "unknown" } ] @@ -289,7 +288,6 @@ Testing: "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false }, - "tray_open": false, "type": "unknown" } ] @@ -410,7 +408,6 @@ Testing: "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false }, - "tray_open": false, "type": "unknown" } ] @@ -501,7 +498,6 @@ Testing: "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false }, - "tray_open": false, "type": "unknown" } ]