From patchwork Fri Jan 29 17:37:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 8165321 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4897CBEEE5 for ; Fri, 29 Jan 2016 17:38:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C47B220389 for ; Fri, 29 Jan 2016 17:38:36 +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 09D7220383 for ; Fri, 29 Jan 2016 17:38:35 +0000 (UTC) Received: from localhost ([::1]:35606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPD0E-000595-CJ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Jan 2016 12:38:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPCzq-0004xj-AH for qemu-devel@nongnu.org; Fri, 29 Jan 2016 12:38:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPCzn-0006bk-L4 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 12:38:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPCzi-0006XH-Jh; Fri, 29 Jan 2016 12:38:02 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3D43C6E76E; Fri, 29 Jan 2016 17:38:02 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0THbumC012731; Fri, 29 Jan 2016 12:38:01 -0500 From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 29 Jan 2016 18:37:09 +0100 Message-Id: <1454089074-4819-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1454089074-4819-1-git-send-email-kwolf@redhat.com> References: <1454089074-4819-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 03/48] Revert "hw/block/fdc: Implement tray status" 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 From: Max Reitz This reverts the changes that commit 2e1280e8ff95b3145bc6262accc9d447718e5318 applied to hw/block/fdc.c. That commit changed tests/fdc-test.c, too, because after it, one less TRAY_MOVED event would be emitted when executing 'change' on an empty drive. However, now, no TRAY_MOVED events will be emitted at all, and the tray_open status returned by query-block will always be false, necessitating (different) changes to tests/fdc-test.c and iotest 118, which is why this patch is not a pure revert of said commit. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- hw/block/fdc.c | 20 ++------- tests/fdc-test.c | 2 - tests/qemu-iotests/118 | 117 +++++++++++++++---------------------------------- 3 files changed, 40 insertions(+), 99 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 6711c6a..d2df218 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -193,8 +193,6 @@ typedef struct FDrive { uint8_t ro; /* Is read-only */ uint8_t media_changed; /* Is media changed */ uint8_t media_rate; /* Data rate of medium */ - - bool media_inserted; /* Is there a medium in the tray */ } FDrive; static void fd_init(FDrive *drv) @@ -264,7 +262,7 @@ static int fd_seek(FDrive *drv, uint8_t head, uint8_t track, uint8_t sect, #endif drv->head = head; if (drv->track != track) { - if (drv->media_inserted) { + if (drv->blk != NULL && blk_is_inserted(drv->blk)) { drv->media_changed = 0; } ret = 1; @@ -273,7 +271,7 @@ static int fd_seek(FDrive *drv, uint8_t head, uint8_t track, uint8_t sect, drv->sect = sect; } - if (!drv->media_inserted) { + if (drv->blk == NULL || !blk_is_inserted(drv->blk)) { ret = 2; } @@ -299,7 +297,7 @@ static void fd_revalidate(FDrive *drv) ro = blk_is_read_only(drv->blk); pick_geometry(drv->blk, &nb_heads, &max_track, &last_sect, drv->drive, &drive, &rate); - if (!drv->media_inserted) { + if (!blk_is_inserted(drv->blk)) { FLOPPY_DPRINTF("No disk in drive\n"); } else { FLOPPY_DPRINTF("Floppy disk (%d h %d t %d s) %s\n", nb_heads, @@ -695,7 +693,7 @@ static bool fdrive_media_changed_needed(void *opaque) { FDrive *drive = opaque; - return (drive->media_inserted && drive->media_changed != 1); + return (drive->blk != NULL && drive->media_changed != 1); } static const VMStateDescription vmstate_fdrive_media_changed = { @@ -2187,21 +2185,12 @@ static void fdctrl_change_cb(void *opaque, bool load) { FDrive *drive = opaque; - drive->media_inserted = load && drive->blk && blk_is_inserted(drive->blk); - drive->media_changed = 1; fd_revalidate(drive); } -static bool fdctrl_is_tray_open(void *opaque) -{ - FDrive *drive = opaque; - return !drive->media_inserted; -} - static const BlockDevOps fdctrl_block_ops = { .change_media_cb = fdctrl_change_cb, - .is_tray_open = fdctrl_is_tray_open, }; /* Init functions */ @@ -2229,7 +2218,6 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, Error **errp) fdctrl_change_cb(drive, 0); if (drive->blk) { blk_set_dev_ops(drive->blk, &fdctrl_block_ops, drive); - drive->media_inserted = blk_is_inserted(drive->blk); } } } diff --git a/tests/fdc-test.c b/tests/fdc-test.c index b5a4696..7f0e215 100644 --- a/tests/fdc-test.c +++ b/tests/fdc-test.c @@ -304,7 +304,6 @@ static void test_media_insert(void) qmp_discard_response("{'execute':'change', 'arguments':{" " 'device':'floppy0', 'target': %s, 'arg': 'raw' }}", test_image); - qmp_discard_response(""); /* ignore event (open -> close) */ dir = inb(FLOPPY_BASE + reg_dir); assert_bit_set(dir, DSKCHG); @@ -335,7 +334,6 @@ static void test_media_change(void) * reset the bit. */ qmp_discard_response("{'execute':'eject', 'arguments':{" " 'device':'floppy0' }}"); - qmp_discard_response(""); /* ignore event */ dir = inb(FLOPPY_BASE + reg_dir); assert_bit_set(dir, DSKCHG); diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index 114d0e2..7caa38c 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -42,6 +42,9 @@ class ChangeBaseClass(iotests.QMPTestCase): self.has_opened = True def wait_for_open(self): + if not self.has_real_tray: + return + timeout = time.clock() + 3 while not self.has_opened and time.clock() < timeout: self.process_events() @@ -49,6 +52,9 @@ class ChangeBaseClass(iotests.QMPTestCase): self.fail('Timeout while waiting for the tray to open') def wait_for_close(self): + if not self.has_real_tray: + return + timeout = time.clock() + 3 while not self.has_closed and time.clock() < timeout: self.process_events() @@ -65,7 +71,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) def test_blockdev_change_medium(self): @@ -78,7 +85,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) def test_eject(self): @@ -88,7 +96,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') def test_tray_eject_change(self): @@ -98,7 +107,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') result = self.vm.qmp('blockdev-change-medium', device='drive0', @@ -109,7 +119,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) def test_tray_open_close(self): @@ -119,7 +130,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) if self.was_empty == True: self.assert_qmp_absent(result, 'return[0]/inserted') else: @@ -132,10 +144,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - if self.has_real_tray or not self.was_empty: + if self.has_real_tray: self.assert_qmp(result, 'return[0]/tray_open', False) - else: - self.assert_qmp(result, 'return[0]/tray_open', True) if self.was_empty == True: self.assert_qmp_absent(result, 'return[0]/inserted') else: @@ -148,20 +158,18 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') result = self.vm.qmp('blockdev-close-tray', device='drive0') self.assert_qmp(result, 'return', {}) - if self.has_real_tray: - self.wait_for_close() + self.wait_for_close() result = self.vm.qmp('query-block') if self.has_real_tray: self.assert_qmp(result, 'return[0]/tray_open', False) - else: - self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') def test_tray_open_change(self): @@ -171,7 +179,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) if self.was_empty == True: self.assert_qmp_absent(result, 'return[0]/inserted') else: @@ -185,7 +194,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) def test_cycle(self): @@ -202,7 +212,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_open() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) if self.was_empty == True: self.assert_qmp_absent(result, 'return[0]/inserted') else: @@ -212,7 +223,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') result = self.vm.qmp('x-blockdev-insert-medium', device='drive0', @@ -220,7 +232,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) result = self.vm.qmp('blockdev-close-tray', device='drive0') @@ -229,7 +242,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.wait_for_close() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) + if self.has_real_tray: + self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) def test_close_on_closed(self): @@ -239,16 +253,14 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assertEquals(self.vm.get_qmp_events(wait=False), []) def test_remove_on_closed(self): - if self.has_opened: - # Empty floppy drive + if not self.has_real_tray: return result = self.vm.qmp('x-blockdev-remove-medium', device='drive0') self.assert_qmp(result, 'error/class', 'GenericError') def test_insert_on_closed(self): - if self.has_opened: - # Empty floppy drive + if not self.has_real_tray: return result = self.vm.qmp('blockdev-add', @@ -366,7 +378,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -376,11 +387,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='retain') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -390,7 +397,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -400,11 +406,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='retain') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -414,7 +416,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -427,7 +428,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.assertEquals(self.vm.get_qmp_events(wait=False), []) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -437,7 +437,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -448,11 +447,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='read-write') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -462,7 +457,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -473,11 +467,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='read-only') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -486,7 +476,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -497,11 +486,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='read-only') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -511,7 +496,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -522,10 +506,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='read-write') self.assert_qmp(result, 'error/class', 'GenericError') - self.assertEquals(self.vm.get_qmp_events(wait=False), []) - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -535,7 +516,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -545,11 +525,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='retain') self.assert_qmp(result, 'return', {}) - self.wait_for_open() - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -559,7 +535,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -569,10 +544,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode='retain') self.assert_qmp(result, 'error/class', 'GenericError') - self.assertEquals(self.vm.get_qmp_events(wait=False), []) - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -582,7 +554,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.vm.launch() result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -594,13 +565,7 @@ class TestChangeReadOnly(ChangeBaseClass): 'driver': 'file'}}) self.assert_qmp(result, 'return', {}) - result = self.vm.qmp('blockdev-open-tray', device='drive0', force=True) - self.assert_qmp(result, 'return', {}) - - self.wait_for_open() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) @@ -608,7 +573,6 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') result = self.vm.qmp('x-blockdev-insert-medium', device='drive0', @@ -616,17 +580,10 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) - result = self.vm.qmp('blockdev-close-tray', device='drive0') - self.assert_qmp(result, 'return', {}) - - self.wait_for_close() - result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img) @@ -648,7 +605,6 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/format', 'null-co') # For device-less BBs, calling blockdev-open-tray or blockdev-close-tray @@ -671,7 +627,6 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/tray_open', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img) def tearDown(self):