qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/39] migration: replace assert(0) with g_assert_not_reached


From: Pierrick Bouvier
Subject: Re: [PATCH 08/39] migration: replace assert(0) with g_assert_not_reached()
Date: Tue, 10 Sep 2024 19:37:37 -0700
User-agent: Mozilla Thunderbird

On 9/10/24 19:17, Richard Henderson wrote:
On 9/10/24 15:15, Pierrick Bouvier wrote:
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
   migration/migration-hmp-cmds.c |  2 +-
   migration/postcopy-ram.c       | 14 +++++++-------
   migration/ram.c                |  6 +++---
   3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index 7d608d26e19..e6e96aa6288 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -636,7 +636,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 1c374b7ea1e..f431bbc0d4f 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;
   }


You've got patches removing extra breaks, but these returns are dead too.


I'll take a look to cleanup this in v2 as well.

Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]