From patchwork Mon Nov 20 21:32:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 745383 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1533247wrt; Mon, 20 Nov 2023 13:35:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFu//ykRJ6aZNPCdGvN6UHc2Pt5n9PAUknWyQKKKfqN44gmfIzY8uGXHonx1lKLQSPdW5hB X-Received: by 2002:ad4:5bcf:0:b0:672:20c0:ac08 with SMTP id t15-20020ad45bcf000000b0067220c0ac08mr10775170qvt.48.1700516150230; Mon, 20 Nov 2023 13:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516150; cv=none; d=google.com; s=arc-20160816; b=lFdp5FXgc0O3QjgzObZs+ZXFjnOxAQm9foWXcARsqG6tdhMu7wbdnCXY7bAktLtG3A j+ktmtdTRUAj/VffM1cYhSTpmGM78+p7O3ByaEYUVpS3RbItFF/EmZmab1Y7/1wBFvJu avlhB4MxGc6LqHmhMr3tGKUSb/ezsa2etTyKiX6Txxa1Ey2gChjYGDLbA120AlxIbtyp bnDBhKAUJ6VcXRQ3v/9p+cqTPk0f/W6fgY4KIMilk6MStdsnfvyTtJFsULe//8qzkXwr OILCMD9I90vys9f9pxF+tw0U12jNqcbxeU4Y8tbpOeuO77KcXYEAk5IKSWsyTVRO9QHn 3PXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=yy1snK9B+SCgWiCxmQTHuCxjH+9ISs/0CoWZHoMFEnQ=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=QBuiMkBfp8AvTXJoB3iakgXFDLfD/EHKX4eYmN+Ew2bIW/3D/hOYAqpe9JgPLSpL81 VRkXxYW4we6WSUkXJYluFmNLrDEDY8AjyNmSqUv8Pt/yR+ujTHzbiXgD2UboLfHFlw0t ovg/q/zCm5gISz3EdRf19IHISosctnGhR9WAgsvMFoA4nKkgCHNrNylveHly7n+b61ui 1pgmSFzX2QiY/D4uRs2po7bWX3EO7HmhXWeWEh2b751SZv/ua70ZBCm/zww3I1uRgOs+ eMc6Llx1C67AxTWZgXzisbpWs/arkC7R/rZE1q+ctdFuxyxJyoGwVvIkX9eqtqzYXFFp 7E2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nBb/tg7v"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g11-20020a0562140acb00b00679da424d47si2921580qvi.211.2023.11.20.13.35.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:35:50 -0800 (PST) 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="nBb/tg7v"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5Bta-0000su-8S; Mon, 20 Nov 2023 16:33:30 -0500 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 1r5BtX-0000sA-Gm for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:27 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5BtV-00038C-0R for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:27 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40839652b97so18294705e9.3 for ; Mon, 20 Nov 2023 13:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516003; x=1701120803; 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=yy1snK9B+SCgWiCxmQTHuCxjH+9ISs/0CoWZHoMFEnQ=; b=nBb/tg7vnqbGh4qi0HIlSVpJFdSijMscvVO5AeDmwK9EtEwD1XMFB2FHFA8C0msjNz QMUXEDuqMQs6de49qxwMW6sH/+Y3/wqm95tMX8dKKSYtg2Q0mj5wOPU/dWM9vxl0TJMz dDIHvxplGtKyyXBvEV+X7eUxdTjRa7UxwRczhAii9OpXfUpLiga1tyvmBMfdNQB8UD+B nJdy8Ty9b5UIAJArKxC84DiQUq5fLsN4G6hwCx8r2zJO0ijcZs9IJcwvMqEZrp11+a8d QnFvC50goDhyyybdecjtSMmop3UkE6t3STiZ1WZTP7gu3UrFtFkm2KBRaYY+wnXwZbo/ zY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516003; x=1701120803; 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=yy1snK9B+SCgWiCxmQTHuCxjH+9ISs/0CoWZHoMFEnQ=; b=YhlGm+c00NCKAym/thZDOC2t+/Oluz46r8p+9g7r5NAqD7Oo4qVKmYvO+glZpc6H9S queSdrSBLWGOZrbkpq0thS93qZiAYEOspRETD9XuOwLOvcA3xFwY/8W6q9vBTHr+xVnu WAwy01Nj+M+ATmj99eQvJAfgCDJAuLoBQDgbc7ZBPYolEwY4WuKuOc2oLtKuP0JHBHGt JGZdq00h6XyqTUBWfaX4chtFPXYaJubd37YBb2CPUo8oziBWbnsPX7EMhQVSOeqJCjz+ 1RQsuzUIcQMVEgvNsGyYQYYxXhDDJ2qOSCoInC0KDGiT5hvRw4eLLyBFODr3U+b4jBWm 7mgw== X-Gm-Message-State: AOJu0Yzjuj5Y3Z/9lh+KEkWelyWKS43Lccor0fZQYS2Gi1Bj691FVkNP D2151NYnQUD6cVEzXTFqx7Ew508VOz4jvozY8sE= X-Received: by 2002:a05:6000:18a2:b0:32f:a3fb:835b with SMTP id b2-20020a05600018a200b0032fa3fb835bmr7271877wri.44.1700516003375; Mon, 20 Nov 2023 13:33:23 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id k15-20020a5d518f000000b00332cba50ac3sm1859981wrv.45.2023.11.20.13.33.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:33:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Peter Maydell , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Mark Cave-Ayland , Markus Armbruster , Paolo Bonzini , Igor Mammedov , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Xu Subject: [PATCH-for-9.0 01/25] memory: Have memory_region_init_ram_flags_nomigrate() return a boolean Date: Mon, 20 Nov 2023 22:32:35 +0100 Message-ID: <20231120213301.24349-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231120213301.24349-1-philmd@linaro.org> References: <20231120213301.24349-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Peter Xu Reviewed-by: Gavin Shan --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 831f7c996d..f038a7e5cf 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1310,8 +1310,10 @@ void memory_region_init_ram_nomigrate(MemoryRegion *mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the caller. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 4d9cb0a7ff..313dbb2544 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1583,7 +1583,7 @@ void memory_region_init_ram_nomigrate(MemoryRegion *mr, memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); } -void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1600,7 +1600,9 @@ void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, mr->size = int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } void memory_region_init_resizeable_ram(MemoryRegion *mr,