From patchwork Thu Sep 19 04:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 829570 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp154347wrn; Wed, 18 Sep 2024 21:50:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqc0glc+buLgPGW8mG/IbWRQFnVOHFNF3XxzX8ODVmXBpnMDe2X5b9rg5KEJb073ElGv5Wug==@linaro.org X-Google-Smtp-Source: AGHT+IGsMODPUe3er6BAa/fpVUl5J0e5EHBjqAU2O/lMi8LeZ1F/tNa+igWRI42IdPt6DqRco2S8 X-Received: by 2002:ac8:5fd3:0:b0:458:2479:b599 with SMTP id d75a77b69052e-4586035d1bdmr399509961cf.36.1726721401025; Wed, 18 Sep 2024 21:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726721401; cv=none; d=google.com; s=arc-20240605; b=HUHOofC5jAIBu3vc9AwB9MotGmZD3DXQkksS1NdtsSYlF5BTsYfCX6wWZJdBoRJLjO LLqGc0GdCI1HDZjB3Nn2t1tu7xEJHnEFVG07e6dQZqODRQJZT6TbA6asNMtCKHDqezh2 OhXjYMMtD6ECVn+fUyq+ZLdqwxfgKWiVC2PjUd+0gZcuJZTgVrBaN58uoPCV3/pD8d3j iksdlv++JMMGmlmcO+0nzJr+XNtDaFx9aI3YCbTds7MNw/u6zOQkGy9jDRqLyzyWbXFB Y8dV6mcfttM6/X4n6cyEUK1vsLS6U+7RCU6To+rTMRiSxAUH7TClwofxzREVw22oNB4B v3fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Azxsm+D4GnAmylef8kDOF8WcNEX0H+f5CVUHICifCkU=; fh=5sUwfmYRlCXWUAcYTQtsUKL3/h5U38RKAKIQYZIY6/E=; b=XVQJ323UtTR8JfHAD7WIliV0H6aUy8Edk5PZhsehJwdi/3/l2ME4TVGLfHWKNIWhxU HvbG4MyUkTBoOXdolfbO8c6k9hHCPghv/1UHtJuQ9JoB/mCW1ZC+jUdrhksuI1dD7+JR hdlrJ56wlMuSeCh8kK/3zxJzlJehAKK/ZOqc1bkY6NEM+yCf/eCPC/DXfnqoulpAE8fQ QH9Unl2BvJQydnHa81B+yEA9218h3znQ2LQpRJLi6qJQEyydtgAw2FFUCe3PI8/lSquH RunZXWV1lWgBnHrFp0SVmujw/rweWb97KgkU4HpMgRlt8TvuiJz+XywDueCz6HsGPP5c 4EUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nadLeWPH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45b1790f883si10202131cf.500.2024.09.18.21.50.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Sep 2024 21:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nadLeWPH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sr94K-0007sw-1P; Thu, 19 Sep 2024 00:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sr94I-0007kh-7E for qemu-devel@nongnu.org; Thu, 19 Sep 2024 00:47:02 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sr94D-00076s-5b for qemu-devel@nongnu.org; Thu, 19 Sep 2024 00:47:01 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7191df6b5f5so286670b3a.0 for ; Wed, 18 Sep 2024 21:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726721215; x=1727326015; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Azxsm+D4GnAmylef8kDOF8WcNEX0H+f5CVUHICifCkU=; b=nadLeWPHVxDJcL4zdEtuf3KZpHXIUpFvxnC8mzFqR7TYeP5MeCdR3H5LbpYoqbuOVT 950tmTOj8rUPPgKkajM2An06qwfbuWGd38/uhUxDx+yE3sa1spwRCC0lnhNwZWpyCCdU m7NldzmHGXA5nIYacpA03fC5jFIeVM/7RiseCUSELxxZxbh5HDKiAfeVnOy3lZzYmORs nz70Az3e2l3xGho0dNtZr2UTkz0FXn8zW70uZTq3pBAbZ+mASXlRUvcSY9jQfIgz2eVM BdgmVztlbyGh/BW4FMGQvtV4jFWqciOrhaj/FFy9BqPZL8/y08tydw/ojkijbK89FT0U 9iZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726721215; x=1727326015; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Azxsm+D4GnAmylef8kDOF8WcNEX0H+f5CVUHICifCkU=; b=Gc9ITnLsje5rAMh7Mo3/5Q2o/rHxoBomgvGd5vDSl2ogSdq1EsI5AWFP6y3RiK/BAZ BVlPlQQj/n5peA8oPhNA2wLC2vpSbNTzBrSN9p9YRu+imhXdn+xnDM2Gx6F+UFOm41kS E77zHoyDAhPSlACBu9sCK7sSMbUmuP+j4FcUjjWwNtTWdiPc1GfXnwtUzb3qSWaAlpnq BbTFlKjv7u+t690ufRxJ1VHkoy4M5/5/zVPNPXjOdURRnw3VtHRt5rmEJDyROLs/Lh8t Gkv6BSLcIypW6ZQTx3To/C3NGXhjtReIR2yg/gW16Py3gejug/P+lWnDCzh8TQHVQ2q1 KtZQ== X-Gm-Message-State: AOJu0YzXjnNBQzlVVTn/zHwt5VZGs2620CcCHR1iiZvAFcplBrVPfB1V +o02VTkbUQbPH00y/JYfZG1+2/mkWK+ikta8noMe1LiGDW/mpX6RWNaFQxyoFmyyeYc87J/q4bT m9Y22cA== X-Received: by 2002:a05:6a00:4f85:b0:717:81b3:4c7a with SMTP id d2e1a72fcca58-719262060abmr39788484b3a.24.1726721214659; Wed, 18 Sep 2024 21:46:54 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc279csm7478601b3a.188.2024.09.18.21.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 21:46:54 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Palmer Dabbelt , Alistair Francis , Hyman Huang , Halil Pasic , kvm@vger.kernel.org, Bin Meng , Peter Xu , Liu Zhiwei , David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Dmitry Fleytman , Hanna Reitz , Klaus Jensen , Corey Minyard , Laurent Vivier , WANG Xuerui , Thomas Huth , Rob Herring , Eduardo Habkost , Nicholas Piggin , "Michael S. Tsirkin" , Harsh Prateek Bora , "Maciej S. Szmigiero" , Ani Sinha , Stefan Berger , Fam Zheng , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Keith Busch , Jean-Christophe Dubois , qemu-riscv@nongnu.org, Igor Mammedov , Akihiko Odaki , Sriram Yagnaraman , Jason Wang , Eric Farman , "Richard W.M. Jones" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Nina Schoetterl-Glausch , Aurelien Jarno , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Marcel Apfelbaum , qemu-arm@nongnu.org, Christian Borntraeger , qemu-ppc@nongnu.org, Zhao Liu , Daniel Henrique Barboza , qemu-block@nongnu.org, Joel Stanley , Weiwei Li , Kevin Wolf , Helge Deller , Yanan Wang , Michael Rolnik , Jesper Devantier , Marcelo Tosatti , Peter Maydell , Pierrick Bouvier Subject: [PATCH v3 04/34] migration: replace assert(0) with g_assert_not_reached() Date: Wed, 18 Sep 2024 21:46:11 -0700 Message-Id: <20240919044641.386068-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240919044641.386068-1-pierrick.bouvier@linaro.org> References: <20240919044641.386068-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Reviewed-by: Peter Xu Signed-off-by: Pierrick Bouvier --- 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 28165cfc9ed..20d1a6e2194 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 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; } 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 67ca3d5d51a..0aa5d347439 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__) */