qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [QEMU] [PATCH v5 4/8] scsi: Propagate unrealize() callb


From: Max Reitz
Subject: Re: [Qemu-devel] [QEMU] [PATCH v5 4/8] scsi: Propagate unrealize() callback to scsi-hd
Date: Tue, 13 Aug 2019 21:06:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 26.06.19 14:39, Sam Eiderman wrote:
> We will need to add LCHS removal logic to scsi-hd's unrealize() in the
> next commit.
> 
> Reviewed-by: Karl Heubaum <address@hidden>
> Reviewed-by: Arbel Moshe <address@hidden>
> Signed-off-by: Sam Eiderman <address@hidden>
> ---
>  hw/scsi/scsi-bus.c     | 15 +++++++++++++++
>  include/hw/scsi/scsi.h |  1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
> index c480553083..f6fe497a1a 100644
> --- a/hw/scsi/scsi-bus.c
> +++ b/hw/scsi/scsi-bus.c

[...]

> @@ -213,11 +221,18 @@ static void scsi_qdev_realize(DeviceState *qdev, Error 
> **errp)
>  static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp)
>  {
>      SCSIDevice *dev = SCSI_DEVICE(qdev);
> +    Error *local_err = NULL;
>  
>      if (dev->vmsentry) {
>          qemu_del_vm_change_state_handler(dev->vmsentry);
>      }
>  
> +    scsi_device_unrealize(dev, &local_err);
> +    if (local_err) {
> +        error_propagate(errp, local_err);
> +        return;
> +    }
> +
>      scsi_device_purge_requests(dev, SENSE_CODE(NO_SENSE));

(I see this code for the first time, but) I suppose I’d put the
scsi_device_unrealize() after scsi_device_purge_requests().

Max

>      blockdev_mark_auto_del(dev->conf.blk);
>  }

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]