From patchwork Mon Nov 20 21:32:45 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: 745394 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1534823wrt; Mon, 20 Nov 2023 13:40:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFujPJhzQkvQiahLszUvbQ2LslEvmDEmCMAJ/KfseFRR+PVUtRWFIryMspdjfSbjcT8zKe9 X-Received: by 2002:a05:622a:1707:b0:41b:7773:ee56 with SMTP id h7-20020a05622a170700b0041b7773ee56mr10678146qtk.50.1700516445686; Mon, 20 Nov 2023 13:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516445; cv=none; d=google.com; s=arc-20160816; b=aCFG1TG08qr2xAbsgbHRJbbahhyj6eppdKsoFr2vVwnvcs104Vj8lQLTH8d+oOBoFu PS5n/8nCCdQRpSprLwx8qyFW7R7YfTdwwk/Q5vIKIqXIASb5rZEgYbu9yOI+CGSwYEC4 mzZ0uAivlE98XJINHNOVrLmbNQGDLpE3RFTm9X39DgBdHBXgGreItoKEU+aI5mzz2W/l DpyQi7+/l1tLLHPavjqgDaSINBXkelL1nVQHD0wGrFQC9qQUxed8dU55XugKQtl45VEq ChFHXfta4RIIoZxYdy0glWWFALjsNOUnwuuFfj5GocWegJucgTCisRVRyXsjOTeTFFNC z9Mw== 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=srROQw79PZz9736kD+JTLPR9CRLssrTQx2X8yf5dBJc=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=j5JgZJDKMYg8zcd+vwxn7du6+8dw0+zumIVeic7w5cGBfXKsL+H15AN1MXcGA143Wl xuCTLGy8w1OZG2G2Vn7rbNisPeL1EK29yveFwnuKI+D2AMGtJktbRe+eB4x+n5PUgy4m ABpphqBq7+Jw6jF2DqaKHlL4pTgSOKIPw7X+9BYMrfhyexBIS/2A1cTl9MvYRzrpWVWw hZgimC5ZnfzY63Xkd5SP2MgFNj9iRiDaDqSk8c7SD3Dk6A9cmXEaEk3BPL0ded+jb7D0 Pa3Kd9nBsRDu8S1qsp9ElRyEJxHe9U31jFlGjcNIwpfXtXJcL48yGGwAn2oa9TD3S8OI JzpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mr7IOdsd; 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 s8-20020a05620a254800b0077573396927si8422257qko.260.2023.11.20.13.40.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:40:45 -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=mr7IOdsd; 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 1r5Bvh-0004UF-9I; Mon, 20 Nov 2023 16:35:41 -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 1r5BvG-0002zn-1O for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:35:18 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5Bv8-0003qi-NB for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:35:08 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40b23aeb9d9so10477815e9.3 for ; Mon, 20 Nov 2023 13:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516104; x=1701120904; 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=srROQw79PZz9736kD+JTLPR9CRLssrTQx2X8yf5dBJc=; b=mr7IOdsdVySBB/BP4JNC+BDBPVNVCm23iLT1u1qfvgHWPg8cSpqhAo4cEbdwC5BrYc QUAJuxAoIysb4Seu1JyuRZNK3JrDQ1viRpyqmae1gnXM2eAOgerkoNfq6JZ8iX7Z4ZTP R9tAdKzHX48PYM6ctr705yceQzsTrBHXWe864V98FOOzfTDhB+stUj3rjW0k5+m3v8pc L6mJ9XIc9lHHlzZXoxzoKCROjBFMXDSnnV7tdmJYS2pAFPsGxWVOEG8tX30z8vKCZVPT vRVIrZ5eujv6eMfPrjAa0QHUgMrfnuKrGfMZKenLCve/rg0ZpUUS+t26CIer9z5c3BNJ t6XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516104; x=1701120904; 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=srROQw79PZz9736kD+JTLPR9CRLssrTQx2X8yf5dBJc=; b=nMRAB2VdaWyIGvlCzNXQFbbPEmrcTYLxS9q2LKHJh61bDBBHG5QS3r9lHgp4tg6kb3 AFpxoqjIzUWcX0nj74Ctso5oCvmIVYb6Uj/VveUW2jOBxGi4UCWQMEGAJ7THD6k4Lxro X8YIZYaeyB3ulgjYpaW4tEH9AheNn8XkcJeFUKB+V0X+bqvpLPIxWszs6+uFkhb+uI/l pITCW7hxowObiqQnHhTXMd3u1nmvdYj+bmKZP0Ui2IuGmktUCsdcMJ2AG48udaZGWvml LIZz1CWkkH72sEFnvMC/RNtpTasAaGfsew+6QeRKLF2qnBudGC+KXDOxJndeJREpBqQ5 j2WQ== X-Gm-Message-State: AOJu0YxLCgHx5lG/na09rq0ngWSdI/fUZj/EczzJDIzmid1c3RKKpLFu CQ8MjtLnnhec/H5TOhZVMoVYQvf6K7VAXV+9Mdc= X-Received: by 2002:a05:600c:548c:b0:409:325:e499 with SMTP id iv12-20020a05600c548c00b004090325e499mr7267468wmb.32.1700516104774; Mon, 20 Nov 2023 13:35:04 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id k39-20020a05600c082700b004083729fc14sm18726935wmp.20.2023.11.20.13.34.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:35:04 -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 11/25] memory: Have memory_region_init_resizeable_ram() return a boolean Date: Mon, 20 Nov 2023 22:32:45 +0100 Message-ID: <20231120213301.24349-12-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 92b0c0aa46..218b35a849 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1342,8 +1342,10 @@ bool memory_region_init_ram_flags_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_resizeable_ram(MemoryRegion *mr, +bool memory_region_init_resizeable_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 1b10e177f5..f424282526 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1606,7 +1606,7 @@ bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, return true; } -void memory_region_init_resizeable_ram(MemoryRegion *mr, +bool memory_region_init_resizeable_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1627,7 +1627,9 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr, mr->size = int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } #ifdef CONFIG_POSIX