]> 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>
Wed, 2 Nov 2016 21:41:35 +0000 (16:41 -0500)
commit3550eeafcd0882846edceb95ab3b5be828f89684
tree7abd9b4c5d68650d26a156b10e78d7104cf0dd46
parent316c2c9448a7666d29bb36651cd9b2a8a16c6ef7
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