[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RESEND 04/50] hw/usb-storage: Check whether BB is in
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH RESEND 04/50] hw/usb-storage: Check whether BB is inserted |
Date: |
Tue, 27 Jan 2015 14:45:37 -0500 |
Only call bdrv_key_required() on the BlockDriverState if the
BlockBackend has an inserted medium.
Signed-off-by: Max Reitz <address@hidden>
---
hw/usb/dev-storage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 4539733..3123baf 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -638,7 +638,7 @@ static void usb_msd_realize_storage(USBDevice *dev, Error
**errp)
usb_msd_handle_reset(dev);
s->scsi_dev = scsi_dev;
- if (bdrv_key_required(blk_bs(blk))) {
+ if (blk_is_inserted(blk) && bdrv_key_required(blk_bs(blk))) {
if (cur_mon) {
monitor_read_bdrv_key_start(cur_mon, blk_bs(blk),
usb_msd_password_cb, s);
--
2.1.0
- [Qemu-devel] [PATCH RESEND 00/50] blockdev: BlockBackend and media, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 04/50] hw/usb-storage: Check whether BB is inserted,
Max Reitz <=
- [Qemu-devel] [PATCH RESEND 05/50] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 06/50] block: Add blk_is_available(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 07/50] block: Make bdrv_is_inserted() recursive, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 02/50] iotests: Only create BB if necessary, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 08/50] block/quorum: Implement bdrv_is_inserted(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 11/50] block: Move BlockAcctStats into BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 12/50] block: Move I/O status and error actions into BB, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 09/50] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/01/27