[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 10/38] hw/usb-storage: Check whether BB is in
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 10/38] hw/usb-storage: Check whether BB is inserted |
Date: |
Wed, 03 Jun 2015 14:37:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 06/03/2015 01:43 PM, Max Reitz wrote:
> Only call bdrv_add_key() on the BlockDriverState if it is not NULL.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> hw/usb/dev-storage.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
> index abe0e1d..5b1dc90 100644
> --- a/hw/usb/dev-storage.c
> +++ b/hw/usb/dev-storage.c
> @@ -612,20 +612,22 @@ static void usb_msd_realize_storage(USBDevice *dev,
> Error **errp)
> return;
> }
>
> - bdrv_add_key(blk_bs(blk), NULL, &err);
> - if (err) {
> - if (monitor_cur_is_qmp()) {
> - error_propagate(errp, err);
> - return;
> - }
> - error_free(err);
> - err = NULL;
> - if (cur_mon) {
> - monitor_read_bdrv_key_start(cur_mon, blk_bs(blk),
> - usb_msd_password_cb, s);
> - s->dev.auto_attach = 0;
> - } else {
> - autostart = 0;
> + if (blk_bs(blk)) {
> + bdrv_add_key(blk_bs(blk), NULL, &err);
> + if (err) {
> + if (monitor_cur_is_qmp()) {
Hopefully doesn't conflict with Markus' work to refactor error handling
here (https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg00431.html)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 06/38] block: Make bdrv_is_inserted() recursive, (continued)
- [Qemu-devel] [PATCH v3 06/38] block: Make bdrv_is_inserted() recursive, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 08/38] block: Invoke change media CB before NULLing drv, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted(), Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 10/38] hw/usb-storage: Check whether BB is inserted, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 09/38] hw/block/fdc: Implement tray status, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 11/38] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 12/38] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 13/38] block: Remove wr_highest_sector from BlockAcctStats, Max Reitz, 2015/06/03