[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] block: remove separate bdrv_file_open callback
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2 3/3] block: remove separate bdrv_file_open callback |
Date: |
Wed, 28 Jun 2023 09:40:45 +0200 |
Am 01.06.2023 um 13:51 hat Paolo Bonzini geschrieben:
> bdrv_file_open and bdrv_open are completely equivalent, they are
> never checked except to see which one to invoke. So merge them
> into a single one.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> diff --git a/block/blkio.c b/block/blkio.c
> index 72117fa0059b..202cf20ca4bb 100644
> --- a/block/blkio.c
> +++ b/block/blkio.c
> @@ -992,7 +992,7 @@ static void blkio_refresh_limits(BlockDriverState *bs,
> Error **errp)
> .format_name = name, \
> .protocol_name = name, \
> .instance_size = sizeof(BDRVBlkioState), \
> - .bdrv_file_open = blkio_file_open, \
> + .bdrv_open = blkio_open, \
> .bdrv_close = blkio_close, \
> .bdrv_co_getlength = blkio_co_getlength, \
> .bdrv_co_truncate = blkio_truncate, \
You changed the function name here, but didn't actually rename the
function. I don't think this can build.
> diff --git a/block/null.c b/block/null.c
> index 4808704ffd3a..6fa64d20d865 100644
> --- a/block/null.c
> +++ b/block/null.c
> @@ -283,7 +283,7 @@ static BlockDriver bdrv_null_co = {
> .protocol_name = "null-co",
> .instance_size = sizeof(BDRVNullState),
>
> - .bdrv_file_open = null_file_open,
> + .bdrv_open = null_file_open,
> .bdrv_parse_filename = null_co_parse_filename,
> .bdrv_co_getlength = null_co_getlength,
> .bdrv_co_get_allocated_file_size = null_co_get_allocated_file_size,
If we do want to rename, then we should do it in all block drivers. As
far as I can tell, this would be null, nvme and ssh. Not nfs, because
all related function start with nfs_file_* there.
Kevin