]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi-disk: Cleaning up around tray open state
authorFam Zheng <famz@redhat.com>
Wed, 14 Sep 2016 10:17:03 +0000 (18:17 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 20 Sep 2016 16:39:32 +0000 (11:39 -0500)
commit469513b38a7ffabea941b607b44f1d9b3d4da3ef
tree387b34ada573c3beabfa03f07658dd0948203853
parent12664c5a1c1d9e75c36db2bde258c69c25d6c1ff
scsi-disk: Cleaning up around tray open state

Even if tray is not open, it can be empty (blk_is_inserted() == false).
Handle both cases correctly by replacing the s->tray_open checks with
blk_is_available(), which is an AND of the two.

Also simplify successive checks of them into blk_is_available(), in a
couple cases.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1473848224-24809-2-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit cd723b85601baa7a0eeffbac83421357a70d81ee)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/scsi-disk.c