All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] block: replace TABs with space
@ 2023-03-25  8:52 Yeqi Fu
  0 siblings, 0 replies; only message in thread
From: Yeqi Fu @ 2023-03-25  8:52 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Kevin Wolf, qemu-block, qemu-devel, Yeqi Fu

Bring the block files in line with the QEMU coding style, with spaces
for indentation. This patch partially resolves the issue 371.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/371
Signed-off-by: Yeqi Fu <fufuyqqqqqq@gmail.com>
---
 block/bochs.c       |  18 +++----
 block/file-posix.c  | 126 ++++++++++++++++++++++----------------------
 block/file-win32.c  |  66 +++++++++++------------
 block/parallels.c   |  34 ++++++------
 block/qcow.c        |  44 ++++++++--------
 include/block/nbd.h |   2 +-
 6 files changed, 145 insertions(+), 145 deletions(-)

diff --git a/block/bochs.c b/block/bochs.c
index 2f5ae52c90..18f48d2f89 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -293,15 +293,15 @@ static void bochs_close(BlockDriverState *bs)
 }
 
 static BlockDriver bdrv_bochs = {
-    .format_name	= "bochs",
-    .instance_size	= sizeof(BDRVBochsState),
-    .bdrv_probe		= bochs_probe,
-    .bdrv_open		= bochs_open,
-    .bdrv_child_perm     = bdrv_default_perms,
-    .bdrv_refresh_limits = bochs_refresh_limits,
-    .bdrv_co_preadv = bochs_co_preadv,
-    .bdrv_close		= bochs_close,
-    .is_format          = true,
+    .format_name            = "bochs",
+    .instance_size          = sizeof(BDRVBochsState),
+    .bdrv_probe             = bochs_probe,
+    .bdrv_open              = bochs_open,
+    .bdrv_child_perm        = bdrv_default_perms,
+    .bdrv_refresh_limits    = bochs_refresh_limits,
+    .bdrv_co_preadv         = bochs_co_preadv,
+    .bdrv_close             = bochs_close,
+    .is_format              = true,
 };
 
 static void bdrv_bochs_init(void)
diff --git a/block/file-posix.c b/block/file-posix.c
index 5760cf22d1..bdebe0c9a6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -124,7 +124,7 @@
 #define FTYPE_FILE   0
 #define FTYPE_CD     1
 
-#define MAX_BLOCKSIZE	4096
+#define MAX_BLOCKSIZE 4096
 
 /* Posix file locking bytes. Libvirt takes byte 0, we start from higher bytes,
  * leaving a few more bytes for its future use. */
@@ -3819,42 +3819,42 @@ static void coroutine_fn cdrom_co_lock_medium(BlockDriverState *bs, bool locked)
 }
 
 static BlockDriver bdrv_host_cdrom = {
-    .format_name        = "host_cdrom",
-    .protocol_name      = "host_cdrom",
-    .instance_size      = sizeof(BDRVRawState),
-    .bdrv_needs_filename = true,
-    .bdrv_probe_device	= cdrom_probe_device,
-    .bdrv_parse_filename = cdrom_parse_filename,
-    .bdrv_file_open     = cdrom_open,
-    .bdrv_close         = raw_close,
-    .bdrv_reopen_prepare = raw_reopen_prepare,
-    .bdrv_reopen_commit  = raw_reopen_commit,
-    .bdrv_reopen_abort   = raw_reopen_abort,
-    .bdrv_co_create_opts = bdrv_co_create_opts_simple,
-    .create_opts         = &bdrv_create_opts_simple,
-    .mutable_opts        = mutable_opts,
-    .bdrv_co_invalidate_cache = raw_co_invalidate_cache,
-
-    .bdrv_co_preadv         = raw_co_preadv,
-    .bdrv_co_pwritev        = raw_co_pwritev,
-    .bdrv_co_flush_to_disk  = raw_co_flush_to_disk,
-    .bdrv_refresh_limits = raw_refresh_limits,
-    .bdrv_co_io_plug        = raw_co_io_plug,
-    .bdrv_co_io_unplug      = raw_co_io_unplug,
-    .bdrv_attach_aio_context = raw_aio_attach_aio_context,
-
-    .bdrv_co_truncate                   = raw_co_truncate,
-    .bdrv_co_getlength                  = raw_co_getlength,
-    .has_variable_length                = true,
-    .bdrv_co_get_allocated_file_size    = raw_co_get_allocated_file_size,
+    .format_name                     = "host_cdrom",
+    .protocol_name                   = "host_cdrom",
+    .instance_size                   = sizeof(BDRVRawState),
+    .bdrv_needs_filename             = true,
+    .bdrv_probe_device               = cdrom_probe_device,
+    .bdrv_parse_filename             = cdrom_parse_filename,
+    .bdrv_file_open                  = cdrom_open,
+    .bdrv_close                      = raw_close,
+    .bdrv_reopen_prepare             = raw_reopen_prepare,
+    .bdrv_reopen_commit              = raw_reopen_commit,
+    .bdrv_reopen_abort               = raw_reopen_abort,
+    .bdrv_co_create_opts             = bdrv_co_create_opts_simple,
+    .create_opts                     = &bdrv_create_opts_simple,
+    .mutable_opts                    = mutable_opts,
+    .bdrv_co_invalidate_cache        = raw_co_invalidate_cache,
+
+    .bdrv_co_preadv                  = raw_co_preadv,
+    .bdrv_co_pwritev                 = raw_co_pwritev,
+    .bdrv_co_flush_to_disk           = raw_co_flush_to_disk,
+    .bdrv_refresh_limits             = raw_refresh_limits,
+    .bdrv_co_io_plug                 = raw_co_io_plug,
+    .bdrv_co_io_unplug               = raw_co_io_unplug,
+    .bdrv_attach_aio_context         = raw_aio_attach_aio_context,
+
+    .bdrv_co_truncate                = raw_co_truncate,
+    .bdrv_co_getlength               = raw_co_getlength,
+    .has_variable_length             = true,
+    .bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
 
     /* removable device support */
-    .bdrv_co_is_inserted    = cdrom_co_is_inserted,
-    .bdrv_co_eject          = cdrom_co_eject,
-    .bdrv_co_lock_medium    = cdrom_co_lock_medium,
+    .bdrv_co_is_inserted             = cdrom_co_is_inserted,
+    .bdrv_co_eject                   = cdrom_co_eject,
+    .bdrv_co_lock_medium             = cdrom_co_lock_medium,
 
     /* generic scsi device */
-    .bdrv_co_ioctl      = hdev_co_ioctl,
+    .bdrv_co_ioctl                   = hdev_co_ioctl,
 };
 #endif /* __linux__ */
 
@@ -3949,38 +3949,38 @@ static void coroutine_fn cdrom_co_lock_medium(BlockDriverState *bs, bool locked)
 }
 
 static BlockDriver bdrv_host_cdrom = {
-    .format_name        = "host_cdrom",
-    .protocol_name      = "host_cdrom",
-    .instance_size      = sizeof(BDRVRawState),
-    .bdrv_needs_filename = true,
-    .bdrv_probe_device	= cdrom_probe_device,
-    .bdrv_parse_filename = cdrom_parse_filename,
-    .bdrv_file_open     = cdrom_open,
-    .bdrv_close         = raw_close,
-    .bdrv_reopen_prepare = raw_reopen_prepare,
-    .bdrv_reopen_commit  = raw_reopen_commit,
-    .bdrv_reopen_abort   = raw_reopen_abort,
-    .bdrv_co_create_opts = bdrv_co_create_opts_simple,
-    .create_opts         = &bdrv_create_opts_simple,
-    .mutable_opts       = mutable_opts,
-
-    .bdrv_co_preadv         = raw_co_preadv,
-    .bdrv_co_pwritev        = raw_co_pwritev,
-    .bdrv_co_flush_to_disk  = raw_co_flush_to_disk,
-    .bdrv_refresh_limits = raw_refresh_limits,
-    .bdrv_co_io_plug        = raw_co_io_plug,
-    .bdrv_co_io_unplug      = raw_co_io_unplug,
-    .bdrv_attach_aio_context = raw_aio_attach_aio_context,
-
-    .bdrv_co_truncate                   = raw_co_truncate,
-    .bdrv_co_getlength                  = raw_co_getlength,
-    .has_variable_length                = true,
-    .bdrv_co_get_allocated_file_size    = raw_co_get_allocated_file_size,
+    .format_name                     = "host_cdrom",
+    .protocol_name                   = "host_cdrom",
+    .instance_size                   = sizeof(BDRVRawState),
+    .bdrv_needs_filename             = true,
+    .bdrv_probe_device               = cdrom_probe_device,
+    .bdrv_parse_filename             = cdrom_parse_filename,
+    .bdrv_file_open                  = cdrom_open,
+    .bdrv_close                      = raw_close,
+    .bdrv_reopen_prepare             = raw_reopen_prepare,
+    .bdrv_reopen_commit              = raw_reopen_commit,
+    .bdrv_reopen_abort               = raw_reopen_abort,
+    .bdrv_co_create_opts             = bdrv_co_create_opts_simple,
+    .create_opts                     = &bdrv_create_opts_simple,
+    .mutable_opts                    = mutable_opts,
+
+    .bdrv_co_preadv                  = raw_co_preadv,
+    .bdrv_co_pwritev                 = raw_co_pwritev,
+    .bdrv_co_flush_to_disk           = raw_co_flush_to_disk,
+    .bdrv_refresh_limits             = raw_refresh_limits,
+    .bdrv_co_io_plug                 = raw_co_io_plug,
+    .bdrv_co_io_unplug               = raw_co_io_unplug,
+    .bdrv_attach_aio_context         = raw_aio_attach_aio_context,
+
+    .bdrv_co_truncate                = raw_co_truncate,
+    .bdrv_co_getlength               = raw_co_getlength,
+    .has_variable_length             = true,
+    .bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
 
     /* removable device support */
-    .bdrv_co_is_inserted     = cdrom_co_is_inserted,
-    .bdrv_co_eject           = cdrom_co_eject,
-    .bdrv_co_lock_medium     = cdrom_co_lock_medium,
+    .bdrv_co_is_inserted             = cdrom_co_is_inserted,
+    .bdrv_co_eject                   = cdrom_co_eject,
+    .bdrv_co_lock_medium             = cdrom_co_lock_medium,
 };
 #endif /* __FreeBSD__ */
 
diff --git a/block/file-win32.c b/block/file-win32.c
index c7d0b85306..cb32ac77c0 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -743,31 +743,31 @@ static QemuOptsList raw_create_opts = {
 };
 
 BlockDriver bdrv_file = {
-    .format_name	= "file",
-    .protocol_name	= "file",
-    .instance_size	= sizeof(BDRVRawState),
+    .format_name         = "file",
+    .protocol_name       = "file",
+    .instance_size       = sizeof(BDRVRawState),
     .bdrv_needs_filename = true,
     .bdrv_parse_filename = raw_parse_filename,
-    .bdrv_file_open     = raw_open,
+    .bdrv_file_open      = raw_open,
     .bdrv_refresh_limits = raw_probe_alignment,
-    .bdrv_close         = raw_close,
+    .bdrv_close          = raw_close,
     .bdrv_co_create_opts = raw_co_create_opts,
-    .bdrv_has_zero_init = bdrv_has_zero_init_1,
+    .bdrv_has_zero_init  = bdrv_has_zero_init_1,
 
     .bdrv_reopen_prepare = raw_reopen_prepare,
     .bdrv_reopen_commit  = raw_reopen_commit,
     .bdrv_reopen_abort   = raw_reopen_abort,
 
-    .bdrv_aio_preadv    = raw_aio_preadv,
-    .bdrv_aio_pwritev   = raw_aio_pwritev,
-    .bdrv_aio_flush     = raw_aio_flush,
+    .bdrv_aio_preadv     = raw_aio_preadv,
+    .bdrv_aio_pwritev    = raw_aio_pwritev,
+    .bdrv_aio_flush      = raw_aio_flush,
 
-    .bdrv_co_truncate   = raw_co_truncate,
-    .bdrv_co_getlength  = raw_co_getlength,
+    .bdrv_co_truncate    = raw_co_truncate,
+    .bdrv_co_getlength   = raw_co_getlength,
     .bdrv_co_get_allocated_file_size
-                        = raw_co_get_allocated_file_size,
+                         = raw_co_get_allocated_file_size,
 
-    .create_opts        = &raw_create_opts,
+    .create_opts         = &raw_create_opts,
 };
 
 /***********************************************/
@@ -915,26 +915,26 @@ done:
 }
 
 static BlockDriver bdrv_host_device = {
-    .format_name	= "host_device",
-    .protocol_name	= "host_device",
-    .instance_size	= sizeof(BDRVRawState),
-    .bdrv_needs_filename = true,
-    .bdrv_parse_filename = hdev_parse_filename,
-    .bdrv_probe_device	= hdev_probe_device,
-    .bdrv_file_open	= hdev_open,
-    .bdrv_close		= raw_close,
-    .bdrv_refresh_limits = hdev_refresh_limits,
-
-    .bdrv_aio_preadv    = raw_aio_preadv,
-    .bdrv_aio_pwritev   = raw_aio_pwritev,
-    .bdrv_aio_flush     = raw_aio_flush,
-
-    .bdrv_detach_aio_context = raw_detach_aio_context,
-    .bdrv_attach_aio_context = raw_attach_aio_context,
-
-    .bdrv_co_getlength                = raw_co_getlength,
-    .has_variable_length              = true,
-    .bdrv_co_get_allocated_file_size  = raw_co_get_allocated_file_size,
+    .format_name                     = "host_device",
+    .protocol_name                   = "host_device",
+    .instance_size                   = sizeof(BDRVRawState),
+    .bdrv_needs_filename             = true,
+    .bdrv_parse_filename             = hdev_parse_filename,
+    .bdrv_probe_device               = hdev_probe_device,
+    .bdrv_file_open                  = hdev_open,
+    .bdrv_close                      = raw_close,
+    .bdrv_refresh_limits             = hdev_refresh_limits,
+
+    .bdrv_aio_preadv                 = raw_aio_preadv,
+    .bdrv_aio_pwritev                = raw_aio_pwritev,
+    .bdrv_aio_flush                  = raw_aio_flush,
+
+    .bdrv_detach_aio_context         = raw_detach_aio_context,
+    .bdrv_attach_aio_context         = raw_attach_aio_context,
+
+    .bdrv_co_getlength               = raw_co_getlength,
+    .has_variable_length             = true,
+    .bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
 };
 
 static void bdrv_file_init(void)
diff --git a/block/parallels.c b/block/parallels.c
index 013684801a..62bbaf6887 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -917,23 +917,23 @@ static void parallels_close(BlockDriverState *bs)
 }
 
 static BlockDriver bdrv_parallels = {
-    .format_name	= "parallels",
-    .instance_size	= sizeof(BDRVParallelsState),
-    .bdrv_probe		= parallels_probe,
-    .bdrv_open		= parallels_open,
-    .bdrv_close		= parallels_close,
-    .bdrv_child_perm          = bdrv_default_perms,
-    .bdrv_co_block_status     = parallels_co_block_status,
-    .bdrv_has_zero_init       = bdrv_has_zero_init_1,
-    .bdrv_co_flush_to_os      = parallels_co_flush_to_os,
-    .bdrv_co_readv  = parallels_co_readv,
-    .bdrv_co_writev = parallels_co_writev,
-    .is_format      = true,
-    .supports_backing = true,
-    .bdrv_co_create      = parallels_co_create,
-    .bdrv_co_create_opts = parallels_co_create_opts,
-    .bdrv_co_check  = parallels_co_check,
-    .create_opts    = &parallels_create_opts,
+    .format_name          = "parallels",
+    .instance_size        = sizeof(BDRVParallelsState),
+    .bdrv_probe           = parallels_probe,
+    .bdrv_open            = parallels_open,
+    .bdrv_close           = parallels_close,
+    .bdrv_child_perm      = bdrv_default_perms,
+    .bdrv_co_block_status = parallels_co_block_status,
+    .bdrv_has_zero_init   = bdrv_has_zero_init_1,
+    .bdrv_co_flush_to_os  = parallels_co_flush_to_os,
+    .bdrv_co_readv        = parallels_co_readv,
+    .bdrv_co_writev       = parallels_co_writev,
+    .is_format            = true,
+    .supports_backing     = true,
+    .bdrv_co_create       = parallels_co_create,
+    .bdrv_co_create_opts  = parallels_co_create_opts,
+    .bdrv_co_check        = parallels_co_check,
+    .create_opts          = &parallels_create_opts,
 };
 
 static void bdrv_parallels_init(void)
diff --git a/block/qcow.c b/block/qcow.c
index 490e4f819e..62b916db6d 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -1177,30 +1177,30 @@ static const char *const qcow_strong_runtime_opts[] = {
 };
 
 static BlockDriver bdrv_qcow = {
-    .format_name	= "qcow",
-    .instance_size	= sizeof(BDRVQcowState),
-    .bdrv_probe		= qcow_probe,
-    .bdrv_open		= qcow_open,
-    .bdrv_close		= qcow_close,
-    .bdrv_child_perm        = bdrv_default_perms,
-    .bdrv_reopen_prepare    = qcow_reopen_prepare,
-    .bdrv_co_create         = qcow_co_create,
-    .bdrv_co_create_opts    = qcow_co_create_opts,
-    .bdrv_has_zero_init     = bdrv_has_zero_init_1,
-    .is_format              = true,
-    .supports_backing       = true,
-    .bdrv_refresh_limits    = qcow_refresh_limits,
-
-    .bdrv_co_preadv         = qcow_co_preadv,
-    .bdrv_co_pwritev        = qcow_co_pwritev,
-    .bdrv_co_block_status   = qcow_co_block_status,
-
-    .bdrv_make_empty        = qcow_make_empty,
+    .format_name                = "qcow",
+    .instance_size              = sizeof(BDRVQcowState),
+    .bdrv_probe                 = qcow_probe,
+    .bdrv_open                  = qcow_open,
+    .bdrv_close                 = qcow_close,
+    .bdrv_child_perm            = bdrv_default_perms,
+    .bdrv_reopen_prepare        = qcow_reopen_prepare,
+    .bdrv_co_create             = qcow_co_create,
+    .bdrv_co_create_opts        = qcow_co_create_opts,
+    .bdrv_has_zero_init         = bdrv_has_zero_init_1,
+    .is_format                  = true,
+    .supports_backing           = true,
+    .bdrv_refresh_limits        = qcow_refresh_limits,
+
+    .bdrv_co_preadv             = qcow_co_preadv,
+    .bdrv_co_pwritev            = qcow_co_pwritev,
+    .bdrv_co_block_status       = qcow_co_block_status,
+
+    .bdrv_make_empty            = qcow_make_empty,
     .bdrv_co_pwritev_compressed = qcow_co_pwritev_compressed,
-    .bdrv_co_get_info       = qcow_co_get_info,
+    .bdrv_co_get_info           = qcow_co_get_info,
 
-    .create_opts            = &qcow_create_opts,
-    .strong_runtime_opts    = qcow_strong_runtime_opts,
+    .create_opts                = &qcow_create_opts,
+    .strong_runtime_opts        = qcow_strong_runtime_opts,
 };
 
 static void bdrv_qcow_init(void)
diff --git a/include/block/nbd.h b/include/block/nbd.h
index a4c98169c3..4f5803fd9b 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -224,7 +224,7 @@ enum {
     NBD_CMD_BLOCK_STATUS = 7,
 };
 
-#define NBD_DEFAULT_PORT	10809
+#define NBD_DEFAULT_PORT    10809
 
 /* Maximum size of a single READ/WRITE data buffer */
 #define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024)
-- 
2.32.0 (Apple Git-132)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-25 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25  8:52 [PATCH v3] block: replace TABs with space Yeqi Fu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.