[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/14] block/iscsi: Document why we use raw malloc()
From: |
Kevin Wolf |
Subject: |
[PULL 06/14] block/iscsi: Document why we use raw malloc() |
Date: |
Mon, 4 Sep 2023 16:36:35 +0200 |
From: Peter Maydell <peter.maydell@linaro.org>
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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 34f97ab646..5640c8b565 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -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",
--
2.41.0
- [PULL 00/14] Block layer patches, Kevin Wolf, 2023/09/04
- [PULL 02/14] iotests: adapt test output for new qemu_cleanup() behavior, Kevin Wolf, 2023/09/04
- [PULL 01/14] block/vpc: Avoid dynamic stack allocation, Kevin Wolf, 2023/09/04
- [PULL 04/14] block: change reqs_lock to QemuMutex, Kevin Wolf, 2023/09/04
- [PULL 05/14] qemu-img: omit errno value in error message, Kevin Wolf, 2023/09/04
- [PULL 08/14] qemu-img: Update documentation for compressed images, Kevin Wolf, 2023/09/04
- [PULL 06/14] block/iscsi: Document why we use raw malloc(),
Kevin Wolf <=
- [PULL 03/14] block: minimize bs->reqs_lock section in tracked_request_end(), Kevin Wolf, 2023/09/04
- [PULL 07/14] block: Be more verbose in create fallback, Kevin Wolf, 2023/09/04
- [PULL 11/14] block-backend: process I/O in the current AioContext, Kevin Wolf, 2023/09/04
- [PULL 10/14] block: remove AIOCBInfo->get_aio_context(), Kevin Wolf, 2023/09/04
- [PULL 12/14] block-backend: process zoned requests in the current AioContext, Kevin Wolf, 2023/09/04
- [PULL 14/14] block: Remove unnecessary variable in bdrv_block_device_info, Kevin Wolf, 2023/09/04
- [PULL 09/14] vmdk: Clean up bdrv_open_child() return value check, Kevin Wolf, 2023/09/04
- [PULL 13/14] block: Remove bdrv_query_block_node_info, Kevin Wolf, 2023/09/04
- Re: [PULL 00/14] Block layer patches, Stefan Hajnoczi, 2023/09/06