From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLxVm-0007nK-Ji for qemu-devel@nongnu.org; Wed, 20 Jan 2016 13:29:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLxVl-0001s6-Gl for qemu-devel@nongnu.org; Wed, 20 Jan 2016 13:29:42 -0500 From: Max Reitz Date: Wed, 20 Jan 2016 19:29:21 +0100 Message-Id: <1453314561-10486-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1453314561-10486-1-git-send-email-mreitz@redhat.com> References: <1453314561-10486-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 4/4] block/qapi: Emit tray_open only if there is a tray List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Peter Maydell , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , John Snow , Markus Armbruster Signed-off-by: Max Reitz --- 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 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/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" } ] -- 2.7.0