]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
block/iscsi: Document why we use raw malloc()
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 27 Jul 2023 15:07:05 +0000 (16:07 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 8 Sep 2023 15:03:09 +0000 (17:03 +0200)
In block/iscsi.c we use a raw malloc() call, which is unusual
given the project standard is to use the glib memory allocation
functions. Document why we do so, to avoid it being converted
to g_malloc() by mistake.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20230727150705.2664464-1-peter.maydell@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/iscsi.c

index 34f97ab64605b7ea1090f118680071ff67801483..5640c8b5657782f4bf811ea471032ba32c04b357 100644 (file)
@@ -1058,6 +1058,7 @@ static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs,
         return NULL;
     }
 
+    /* Must use malloc(): this is freed via scsi_free_scsi_task() */
     acb->task = malloc(sizeof(struct scsi_task));
     if (acb->task == NULL) {
         error_report("iSCSI: Failed to allocate task for scsi command. %s",