From patchwork Mon Nov 20 21:32:42 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: 745403 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1535264wrt; Mon, 20 Nov 2023 13:41:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcCXUsfpmsHzFmuDpxYYx3/srWIcgT6YWVF5fxt57SwwqyPrCWU/fN4KDTDC1uzxuvVsnG X-Received: by 2002:a05:6214:27eb:b0:66d:6526:d605 with SMTP id jt11-20020a05621427eb00b0066d6526d605mr10197873qvb.63.1700516519678; Mon, 20 Nov 2023 13:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516519; cv=none; d=google.com; s=arc-20160816; b=w1jkFQLTmkQxl6JQpeU+Bt21jK1iY35KjT6DtAVWxE52Ush3aT1KirVQAmh7KRipji 9fpnVMvQ3oRNMo/722Lknkyz2PiGCGSQaaq+tRwizNnatdtEJeLdS0eC/iqPRRAMpLDc 6w6gE4M+7E+II3ICxaWgDqz+YUFwdSEVmhJ6xSyk6e/ofERcs5Mh8NNgYEEyUE1B+dVp eBXtd4owCIGnQp3TW6ZO4n+knC4NOyq8WL749uNvmI21l4lKLQtax/9zPhXK04sSDs/N Cpm8WexvTPqSBK3hQJq/5vQDftOrcczBQIaPCJEz3C87cXetv55LTNtzMJ/TM40qnzot FRPQ== 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=7Db5rVC7IYaMSjFIzhw37gGhb/kt8tXVyhffbU+sslQ=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=z3A75SUduywgKkgV15yRE5N42XjkQcnfFAWh4sylUmYQvabPpojENuHfCGBsFKrGZJ 1tK79vehPPHYhrHV+jzv7DhU2zi66OiQHCdLAN+T0tp/H2PWqhHdK/OLd/rFs2q/6Agb p6QMWNGFHS9p1DhtYcbg84i7/NO8QfmRSFMNrg8OvqMCuKF7T22Qr4PRMYsfQDXFgB2g 8xTuSYchvYkHyh5NGcIrJ3udqgqPOn9ob1nudS9qbMl9XeHqwthBz+EjRualZ0bNC9L7 rS4l5h+qIygVQrIwHuszLa1IOwDLYmPfk01zKznURMaQXE7gAY0gqx5XKA8MWlqs7UNg 7B0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqWZvHHq; 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 a13-20020ad45c4d000000b00679d94cded2si3131946qva.166.2023.11.20.13.41.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:41:59 -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=eqWZvHHq; 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 1r5BvV-0003Gu-M4; Mon, 20 Nov 2023 16:35:29 -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 1r5Bub-0001vm-Ke for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:34:36 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5BuZ-0003Xx-13 for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:34:33 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-332cb136335so701285f8f.0 for ; Mon, 20 Nov 2023 13:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516060; x=1701120860; 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=7Db5rVC7IYaMSjFIzhw37gGhb/kt8tXVyhffbU+sslQ=; b=eqWZvHHqCa+ofTZ70YtFMAOY0fivaadnc9qLJjDhm3HkjFL5+MlNTSvtwFqp96aNaK Qq8rryfyVDyjXvBO0D+eVYZJzefV5lcUcaN9DC1YFh96BdXWTkIUF4tk6hFg8cDlja8o ZogAmQfa9BD3FbQqwCsUqQUmOYhTsqO+3ofWpUYlMIJoc6CZsr+sqnW1LcFP8+VVHMNQ xXGDPPgAseDn3wZ/nOWSmJrELLEwSxBcaFbWlh8/a+gVBN4e00cxRULX7cdqnBurmnWv VtmxQSU05l5LJorhE7IMgw0IZ/CW9xf57yhIF3E8CLDmxK/9JuiyItcMEmMl/Wy6Wfmo 140g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516060; x=1701120860; 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=7Db5rVC7IYaMSjFIzhw37gGhb/kt8tXVyhffbU+sslQ=; b=ciu9q+6DmBnu6VCpDfLHy9HEc3x8qXm+mMYG9lOX46h0bRioJrdRgZftkm8GEeFTe0 b+DU+sKMUBZpgRpEh0kthAIfKV76aXiEU+NpX0zKZkwwiJd4nL+khui73Kfjz0axBlO2 ky0a2rWlv+QuHmKCoUG6jwKrj4FaYDKkqJtj42KTlDY20YvoBfsbXQIGFqcpvvvWKUFt aPu+kidoK8mFZZdoLOFpkrkwwn3rO4YgAxKH5SPjTeInu8kqCev9FSYzzK5vHJ8AMUEQ uNZSXDSpbRHZ66RxLnb3ICWVokuT5FASBoBDGy6xuE6YLx8p7nJHlP5y+ufco9yglvO7 kTUw== X-Gm-Message-State: AOJu0YwEKF1sc/xMabZnMerP/ntikbCOwUgU42IALFnjLvNNXVeEGwnJ 6M475+BXC8L/YSXFhcNj8LqRruLcoUF7pzrqRao= X-Received: by 2002:a05:6000:1acd:b0:332:c2ae:ca4f with SMTP id i13-20020a0560001acd00b00332c2aeca4fmr4041008wry.46.1700516059836; Mon, 20 Nov 2023 13:34:19 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id d1-20020a5d5381000000b0032f7f4d008dsm12298763wrv.20.2023.11.20.13.34.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:34:19 -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 08/25] memory: Have memory_region_init_rom_device_nomigrate() return a boolean Date: Mon, 20 Nov 2023 22:32:42 +0100 Message-ID: <20231120213301.24349-9-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 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 9d9798a527..e2cf3e58de 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1523,8 +1523,10 @@ bool memory_region_init_rom_nomigrate(MemoryRegion *mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_device_nomigrate(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, diff --git a/system/memory.c b/system/memory.c index 2c764947fa..1cccc4b755 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1743,7 +1743,7 @@ bool memory_region_init_rom_nomigrate(MemoryRegion *mr, return rv; } -void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_device_nomigrate(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, @@ -1764,7 +1764,9 @@ void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, mr->size = int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } void memory_region_init_iommu(void *_iommu_mr,