[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] scsi: Introduce scsi_req_cancel_async
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] scsi: Introduce scsi_req_cancel_async |
Date: |
Thu, 18 Sep 2014 11:18:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
Il 18/09/2014 04:36, Fam Zheng ha scritto:
> @@ -552,7 +552,7 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops,
> SCSIDevice *d,
> SCSIBus *bus = scsi_bus_from_device(d);
> BusState *qbus = BUS(bus);
>
> - req = g_malloc0(reqops->size);
> + req = g_malloc0(reqops ? reqops->size : sizeof(SCSIRequest));
Let's just add a NotifierList to SCSIRequest instead, and pass a
Notifier to scsi_req_cancel_async. There can be multiple aborts for the
same SCSIRequest, we can leave it to the HBA to create a Notifier for
each TMF.
The notifier can be embedded in a struct to track the request count, as
mentioned in the other message I just sent.
Paolo