* [PATCH 0/2] block: Minor cleanups
@ 2023-09-05 13:06 Kevin Wolf
2023-09-05 13:06 ` [PATCH 1/2] block/meson.build: Restore alphabetical order of files Kevin Wolf
2023-09-05 13:06 ` [PATCH 2/2] block: Make more BlockDriver definitions static Kevin Wolf
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Wolf @ 2023-09-05 13:06 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
I had to go through all block drivers and noticed some details that
aren't as expected, so I thought I might as well fix them...
Kevin Wolf (2):
block/meson.build: Restore alphabetical order of files
block: Make more BlockDriver definitions static
block/copy-before-write.c | 2 +-
block/preallocate.c | 2 +-
block/snapshot-access.c | 2 +-
block/meson.build | 12 ++++++------
4 files changed, 9 insertions(+), 9 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] block/meson.build: Restore alphabetical order of files
2023-09-05 13:06 [PATCH 0/2] block: Minor cleanups Kevin Wolf
@ 2023-09-05 13:06 ` Kevin Wolf
2023-09-05 13:28 ` Philippe Mathieu-Daudé
2023-09-05 13:06 ` [PATCH 2/2] block: Make more BlockDriver definitions static Kevin Wolf
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2023-09-05 13:06 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
When commit 5e5733e5999 created block/meson.build, the list of
unconditionally added files was in alphabetical order. Later commits
added new files in random places. Reorder the list to be alphabetical
again. (As for ordering foo.c against foo-*.c, there are both ways used
currently; standardise on having foo.c first, even though this is
different from the original commit 5e5733e5999.)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/meson.build | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/meson.build b/block/meson.build
index 529fc172c6..f351b9d0d3 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -4,41 +4,41 @@ block_ss.add(files(
'aio_task.c',
'amend.c',
'backup.c',
- 'copy-before-write.c',
'blkdebug.c',
'blklogwrites.c',
'blkverify.c',
'block-backend.c',
'block-copy.c',
- 'graph-lock.c',
'commit.c',
+ 'copy-before-write.c',
'copy-on-read.c',
- 'preallocate.c',
- 'progress_meter.c',
'create.c',
'crypto.c',
'dirty-bitmap.c',
'filter-compress.c',
+ 'graph-lock.c',
'io.c',
'mirror.c',
'nbd.c',
'null.c',
'plug.c',
+ 'preallocate.c',
+ 'progress_meter.c',
'qapi.c',
+ 'qcow2.c',
'qcow2-bitmap.c',
'qcow2-cache.c',
'qcow2-cluster.c',
'qcow2-refcount.c',
'qcow2-snapshot.c',
'qcow2-threads.c',
- 'qcow2.c',
'quorum.c',
'raw-format.c',
'reqlist.c',
'snapshot.c',
'snapshot-access.c',
- 'throttle-groups.c',
'throttle.c',
+ 'throttle-groups.c',
'write-threshold.c',
), zstd, zlib, gnutls)
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] block: Make more BlockDriver definitions static
2023-09-05 13:06 [PATCH 0/2] block: Minor cleanups Kevin Wolf
2023-09-05 13:06 ` [PATCH 1/2] block/meson.build: Restore alphabetical order of files Kevin Wolf
@ 2023-09-05 13:06 ` Kevin Wolf
2023-09-05 13:33 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2023-09-05 13:06 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
Most block driver implementations don't have any reason for their
BlockDriver to be public. The only exceptions are bdrv_file, bdrv_raw
and bdrv_qcow2, which are actually used in other source files.
Make all other BlockDriver definitions static if they aren't yet.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/copy-before-write.c | 2 +-
block/preallocate.c | 2 +-
block/snapshot-access.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index b866e42271..9a0e2b69d9 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -503,7 +503,7 @@ static void cbw_close(BlockDriverState *bs)
s->bcs = NULL;
}
-BlockDriver bdrv_cbw_filter = {
+static BlockDriver bdrv_cbw_filter = {
.format_name = "copy-before-write",
.instance_size = sizeof(BDRVCopyBeforeWriteState),
diff --git a/block/preallocate.c b/block/preallocate.c
index 4d82125036..3d0f621003 100644
--- a/block/preallocate.c
+++ b/block/preallocate.c
@@ -535,7 +535,7 @@ static void preallocate_child_perm(BlockDriverState *bs, BdrvChild *c,
}
}
-BlockDriver bdrv_preallocate_filter = {
+static BlockDriver bdrv_preallocate_filter = {
.format_name = "preallocate",
.instance_size = sizeof(BDRVPreallocateState),
diff --git a/block/snapshot-access.c b/block/snapshot-access.c
index 67ea339da9..8d4e8932b8 100644
--- a/block/snapshot-access.c
+++ b/block/snapshot-access.c
@@ -108,7 +108,7 @@ static void snapshot_access_child_perm(BlockDriverState *bs, BdrvChild *c,
*nshared = BLK_PERM_ALL;
}
-BlockDriver bdrv_snapshot_access_drv = {
+static BlockDriver bdrv_snapshot_access_drv = {
.format_name = "snapshot-access",
.bdrv_open = snapshot_access_open,
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] block/meson.build: Restore alphabetical order of files
2023-09-05 13:06 ` [PATCH 1/2] block/meson.build: Restore alphabetical order of files Kevin Wolf
@ 2023-09-05 13:28 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-05 13:28 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: qemu-devel
On 5/9/23 15:06, Kevin Wolf wrote:
> When commit 5e5733e5999 created block/meson.build, the list of
> unconditionally added files was in alphabetical order. Later commits
> added new files in random places. Reorder the list to be alphabetical
> again. (As for ordering foo.c against foo-*.c, there are both ways used
> currently; standardise on having foo.c first, even though this is
> different from the original commit 5e5733e5999.)
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/meson.build | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] block: Make more BlockDriver definitions static
2023-09-05 13:06 ` [PATCH 2/2] block: Make more BlockDriver definitions static Kevin Wolf
@ 2023-09-05 13:33 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-05 13:33 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: qemu-devel
On 5/9/23 15:06, Kevin Wolf wrote:
> Most block driver implementations don't have any reason for their
> BlockDriver to be public. The only exceptions are bdrv_file, bdrv_raw
> and bdrv_qcow2, which are actually used in other source files.
>
> Make all other BlockDriver definitions static if they aren't yet.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/copy-before-write.c | 2 +-
> block/preallocate.c | 2 +-
> block/snapshot-access.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-05 13:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 13:06 [PATCH 0/2] block: Minor cleanups Kevin Wolf
2023-09-05 13:06 ` [PATCH 1/2] block/meson.build: Restore alphabetical order of files Kevin Wolf
2023-09-05 13:28 ` Philippe Mathieu-Daudé
2023-09-05 13:06 ` [PATCH 2/2] block: Make more BlockDriver definitions static Kevin Wolf
2023-09-05 13:33 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).