From patchwork Fri Jan 22 22:50:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 8093781 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F0BE9F859 for ; Fri, 22 Jan 2016 22:51:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BEAB205C7 for ; Fri, 22 Jan 2016 22:51:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E39EF20595 for ; Fri, 22 Jan 2016 22:51:22 +0000 (UTC) Received: from localhost ([::1]:55827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMkY6-0006GN-CT for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 17:51:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMkXt-0006Bp-D8 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 17:51:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMkXs-0004Kx-FI for qemu-devel@nongnu.org; Fri, 22 Jan 2016 17:51:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMkXo-0004Gl-Hj; Fri, 22 Jan 2016 17:51:04 -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 20116BBF45; Fri, 22 Jan 2016 22:51:04 +0000 (UTC) Received: from localhost (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MMp2j2032195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Jan 2016 17:51:03 -0500 From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 22 Jan 2016 23:50:50 +0100 Message-Id: <1453503050-20187-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1453503050-20187-1-git-send-email-mreitz@redhat.com> References: <1453503050-20187-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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , John Snow , Markus Armbruster Subject: [Qemu-devel] [PATCH v3 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- block/qapi.c | 2 +- qapi/block-core.json | 4 ++-- tests/qemu-iotests/067.out | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index a49c118..bbe0c9d 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -300,7 +300,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/qapi/block-core.json b/qapi/block-core.json index 40239bf..628a41d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -382,8 +382,8 @@ # @locked: True if the guest has locked this device from having its media # removed # -# @tray_open: #optional True if the device has a tray and it is open -# (only present if removable is true) +# @tray_open: #optional True if the device's tray is open +# (only present if it has a tray) # # @dirty-bitmaps: #optional dirty bitmaps information (only present if the # driver has one or more dirty bitmaps) (Since 2.0) 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" } ]