]> 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)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 Sep 2016 10:25:13 +0000 (12:25 +0200)
commitcd723b85601baa7a0eeffbac83421357a70d81ee
treeb320189c315a9f6fd067650de1df76a45d5641e4
parent083d012a388e7e2a8bfd9144c2c9bcceb29a78fc
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>
hw/scsi/scsi-disk.c