From: Yeqi Fu <[email protected]> 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 <[email protected]> Message-ID: <[email protected]> [thuth: Rebased the patch to the current master branch] Signed-off-by: Thomas Huth <[email protected]> Message-ID: <[email protected]> [kwolf: Fixed up vertical alignemnt] Signed-off-by: Kevin Wolf <[email protected]> --- include/block/nbd.h | 2 +- block/bochs.c | 14 +++++------ block/file-posix.c | 58 ++++++++++++++++++++++----------------------- block/file-win32.c | 38 ++++++++++++++--------------- block/qcow.c | 10 ++++---- 5 files changed, 61 insertions(+), 61 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index 92987c76fd..ab40842da9 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -296,7 +296,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) diff --git a/block/bochs.c b/block/bochs.c index b099fb52fe..bfda88017d 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -300,15 +300,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, + .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, + .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 8b7c02d19a..12d12970fa 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -133,7 +133,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. */ @@ -4562,20 +4562,20 @@ 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_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, + .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_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, @@ -4688,20 +4688,20 @@ 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_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, + .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_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, diff --git a/block/file-win32.c b/block/file-win32.c index af9aea631c..0efb609e1d 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -741,16 +741,16 @@ static QemuOptsList raw_create_opts = { }; BlockDriver bdrv_file = { - .format_name = "file", - .protocol_name = "file", - .instance_size = sizeof(BDRVRawState), - .bdrv_needs_filename = true, - .bdrv_parse_filename = raw_parse_filename, - .bdrv_open = raw_open, - .bdrv_refresh_limits = raw_probe_alignment, - .bdrv_close = raw_close, - .bdrv_co_create_opts = raw_co_create_opts, - .bdrv_has_zero_init = bdrv_has_zero_init_1, + .format_name = "file", + .protocol_name = "file", + .instance_size = sizeof(BDRVRawState), + .bdrv_needs_filename = true, + .bdrv_parse_filename = raw_parse_filename, + .bdrv_open = raw_open, + .bdrv_refresh_limits = raw_probe_alignment, + .bdrv_close = raw_close, + .bdrv_co_create_opts = raw_co_create_opts, + .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_commit = raw_reopen_commit, @@ -914,15 +914,15 @@ 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_open = hdev_open, - .bdrv_close = raw_close, - .bdrv_refresh_limits = hdev_refresh_limits, + .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_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, diff --git a/block/qcow.c b/block/qcow.c index 8a3e7591a9..b442bfe835 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -1184,11 +1184,11 @@ 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, + .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, -- 2.51.1
