aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2024-09-18 21:46:11 -0700
committerThomas Huth <thuth@redhat.com>2024-09-24 13:53:35 +0200
commit0c79effdc7a839cff1e2af564cc145584271038d (patch)
treea70d085091038f2ad4c0410ad6c8c0ec3ab6607a
parentb5df2514082905720849b945d1f999392eaf027f (diff)
downloadqemu-0c79effdc7a839cff1e2af564cc145584271038d.zip
qemu-0c79effdc7a839cff1e2af564cc145584271038d.tar.gz
qemu-0c79effdc7a839cff1e2af564cc145584271038d.tar.bz2
migration: replace assert(0) with g_assert_not_reached()
This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20240919044641.386068-5-pierrick.bouvier@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--migration/migration-hmp-cmds.c2
-rw-r--r--migration/postcopy-ram.c14
-rw-r--r--migration/ram.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index 28165cf..20d1a6e 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -640,7 +640,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
visit_type_bool(v, param, &p->direct_io, &err);
break;
default:
- assert(0);
+ g_assert_not_reached();
}
if (err) {
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 1c374b7..f431bbc 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1411,40 +1411,40 @@ int postcopy_ram_incoming_init(MigrationIncomingState *mis)
int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
int postcopy_ram_prepare_discard(MigrationIncomingState *mis)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb,
uint64_t client_addr, uint64_t rb_offset)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from,
RAMBlock *rb)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
int postcopy_place_page_zero(MigrationIncomingState *mis, void *host,
RAMBlock *rb)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
@@ -1452,7 +1452,7 @@ int postcopy_wake_shared(struct PostCopyFD *pcfd,
uint64_t client_addr,
RAMBlock *rb)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
#endif
diff --git a/migration/ram.c b/migration/ram.c
index 67ca3d5..0aa5d34 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1765,19 +1765,19 @@ bool ram_write_tracking_available(void)
bool ram_write_tracking_compatible(void)
{
- assert(0);
+ g_assert_not_reached();
return false;
}
int ram_write_tracking_start(void)
{
- assert(0);
+ g_assert_not_reached();
return -1;
}
void ram_write_tracking_stop(void)
{
- assert(0);
+ g_assert_not_reached();
}
#endif /* defined(__linux__) */