[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 34/43] migration: Make all functions check have the same format
From: |
Juan Quintela |
Subject: |
[PATCH 34/43] migration: Make all functions check have the same format |
Date: |
Thu, 2 Mar 2023 17:34:01 +0100 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/options.c | 153 +++++++++++---------------------------------
1 file changed, 39 insertions(+), 114 deletions(-)
diff --git a/migration/options.c b/migration/options.c
index 15ee1aa922..350cd24e28 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -35,27 +35,21 @@
bool migrate_auto_converge(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE];
}
bool migrate_background_snapshot(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT];
}
bool migrate_block(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_BLOCK];
}
@@ -63,95 +57,76 @@ bool migrate_block(void)
bool migrate_colo(void)
{
MigrationState *s = migrate_get_current();
+
return s->capabilities[MIGRATION_CAPABILITY_X_COLO];
}
bool migrate_compress(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_COMPRESS];
}
bool migrate_dirty_bitmaps(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS];
}
bool migrate_events(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_EVENTS];
}
bool migrate_ignore_shared(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED];
}
bool migrate_late_block_activate(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE];
}
bool migrate_multifd(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_MULTIFD];
}
bool migrate_pause_before_switchover(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER];
}
bool migrate_postcopy_blocktime(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME];
}
bool migrate_postcopy_preempt(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT];
}
bool migrate_postcopy_ram(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM];
}
@@ -165,54 +140,42 @@ bool migrate_rdma_pin_all(void)
bool migrate_release_ram(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM];
}
bool migrate_return_path(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH];
}
bool migrate_validate_uuid(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID];
}
bool migrate_xbzrle(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_XBZRLE];
}
bool migrate_zero_blocks(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
}
bool migrate_zero_copy_send(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND];
}
@@ -226,9 +189,7 @@ bool migrate_postcopy(void)
bool migrate_tls(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.tls_creds && *s->parameters.tls_creds;
}
@@ -497,126 +458,98 @@ void
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
bool migrate_block_incremental(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.block_incremental;
}
uint32_t migrate_checkpoint_delay(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.x_checkpoint_delay;
}
int migrate_compress_level(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.compress_level;
}
int migrate_compress_threads(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.compress_threads;
}
int migrate_compress_wait_thread(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.compress_wait_thread;
}
uint8_t migrate_cpu_throttle_increment(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.cpu_throttle_increment;
}
uint8_t migrate_cpu_throttle_initial(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.cpu_throttle_initial;
}
bool migrate_cpu_throttle_tailslow(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.cpu_throttle_tailslow;
}
int migrate_decompress_threads(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.decompress_threads;
}
uint8_t migrate_max_cpu_throttle(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.max_cpu_throttle;
}
uint64_t migrate_max_bandwidth(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.max_bandwidth;
}
int64_t migrate_max_postcopy_bandwidth(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.max_postcopy_bandwidth;
}
int migrate_multifd_channels(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.multifd_channels;
}
MultiFDCompression migrate_multifd_compression(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
assert(s->parameters.multifd_compression < MULTIFD_COMPRESSION__MAX);
return s->parameters.multifd_compression;
@@ -624,36 +557,28 @@ MultiFDCompression migrate_multifd_compression(void)
int migrate_multifd_zlib_level(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.multifd_zlib_level;
}
int migrate_multifd_zstd_level(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.multifd_zstd_level;
}
uint8_t migrate_throttle_trigger_threshold(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.throttle_trigger_threshold;
}
uint64_t migrate_xbzrle_cache_size(void)
{
- MigrationState *s;
-
- s = migrate_get_current();
+ MigrationState *s = migrate_get_current();
return s->parameters.xbzrle_cache_size;
}
--
2.39.2
- [PATCH 27/43] migration: Create migrate_cpu_throttle_tailslow() function, (continued)
- [PATCH 27/43] migration: Create migrate_cpu_throttle_tailslow() function, Juan Quintela, 2023/03/02
- [PATCH 35/43] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/03/02
- [PATCH 29/43] migration: Move migrate_postcopy() to options.c, Juan Quintela, 2023/03/02
- [PATCH 26/43] migration: Create migrate_cpu_throttle_increment() function, Juan Quintela, 2023/03/02
- [PATCH 28/43] migration: Move migrate_use_tls() to options.c, Juan Quintela, 2023/03/02
- [PATCH 24/43] migration: Move migrate_announce_params() to option.c, Juan Quintela, 2023/03/02
- [PATCH 33/43] migration: Create migrate_params_init() function, Juan Quintela, 2023/03/02
- [PATCH 25/43] migration: Create migrate_cpu_throttle_initial() to option.c, Juan Quintela, 2023/03/02
- [PATCH 30/43] migration: Create migrate_max_bandwidth() function, Juan Quintela, 2023/03/02
- [PATCH 32/43] migration: Move qmp_migrate_set_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 34/43] migration: Make all functions check have the same format,
Juan Quintela <=
- [PATCH 23/43] migration: Create migrate_max_cpu_throttle(), Juan Quintela, 2023/03/02
- [PATCH 31/43] migration: Move qmp_query_migrate_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 37/43] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 39/43] migration: Create migrate_tls_creds() function, Juan Quintela, 2023/03/02
- [PATCH 41/43] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/03/02
- [PATCH 38/43] migration: Remove MigrationState from block_cleanup_parameters(), Juan Quintela, 2023/03/02
- [PATCH 40/43] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/03/02
- [PATCH 42/43] migration: Create migrate_block_bitmap_mapping() function, Juan Quintela, 2023/03/02
- [PATCH 43/43] migration: Move migration_properties to options.c, Juan Quintela, 2023/03/02
- [PATCH 36/43] migration: Move migrate_set_block_incremental() to options.c, Juan Quintela, 2023/03/02