From patchwork Mon Nov 20 21:32:59 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: 745400 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1535217wrt; Mon, 20 Nov 2023 13:41:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFT5ctnM/uivE5oEsV1nx6/YSyiL1L1Wb56LN5an7akGSlXnWseLxfT7HuZoUU3bBPTnfXg X-Received: by 2002:ad4:5f0a:0:b0:677:f200:a1b7 with SMTP id fo10-20020ad45f0a000000b00677f200a1b7mr11406838qvb.51.1700516510073; Mon, 20 Nov 2023 13:41:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516510; cv=none; d=google.com; s=arc-20160816; b=gvtEGu0Bnfsx0daIiqQwjbS5SSYAm5z/MW8ABTzJ3zdj1lsP/y63Z//wEluhBmuYtJ VKjtEdlO6sapxARoo9Sc1rjeJCX8MJj3ScdJq2dwyDDT+W3Suo2qk4AwtU0BS9JGxsYZ B+lCj+na7ejQ9UnhirolGAodqOqSb7JQV7EvZ1XCAPKwPuBenk92IO84ZRWyM9x2tKMN QMb6nnbhW1qE2Et4uaSmIvJkY70Njsi1BHBWWWSNHEty8IWb2XaQo/S0QKKMzdxwHQBf /VML724E7JDiKSBepiWo4f0bIRf0smfK3XqUFpddJlgqiBd4IiL41IhjfpccBr6GSSAC Oq/g== 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=Pno/XIMEfv6sc1E+e58IOA0UG1tXfCuf040vsihGJmc=; fh=Ljpz67KUguUCIBLeiOnmYlxWTfvg6mMKNzxYzt1oXKw=; b=zv08kl3qS0lG0HuCxHXaYilPWZWkKFR2a5GbFHsuRsbb9JQdFwx5sK9k/SMQ4ArgM/ QpFQ6syfHJA5rNXTDERXprT/beS40prARuTh8NY/1AQnyJcakKnq7QhnCF2zhRkk+U7n H2585wegEdriCmllExUR1RTkHw7hFOCdNCh8j5Wf3ZIn4Gfj2Nk6I1buTGPVr4vyazqw P4w/YkVG9MJGOywlD97tSvHy+4i6JT7kTp3M3CyYjLdpTCBMuynEIDpTMkMPa2I/eGAV UV401O8L8EFI+wfDI6PBG4qui2xUsT5KoafGfqkk7agWDQYAIBdYV0MvRDwjLjXbCEeH K/MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CF5RL0zU; 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 lw11-20020a05621457cb00b00679d93b2daasi2883305qvb.304.2023.11.20.13.41.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:41: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=CF5RL0zU; 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 1r5BzM-0004ak-GU; Mon, 20 Nov 2023 16:39:28 -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 1r5BzL-0004YS-2C for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:39:27 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5BzI-0004jw-Fp for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:39:26 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32d81864e3fso3100388f8f.2 for ; Mon, 20 Nov 2023 13:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516362; x=1701121162; 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=Pno/XIMEfv6sc1E+e58IOA0UG1tXfCuf040vsihGJmc=; b=CF5RL0zUzCIFvd25ju57WC06acxPFagk0euQB638guaostgYaiLpfOgwgmAJRGdFZV 0oR4IYmsELKTWdHuvUVeKMVhfYq6bpOom/TUGX3rRKKX/Jr1gbqz8BFcm/MjtCGHSneA URwaSPLB4K8ONTDvNImP4UZ2oE3ps9RK5fWeZVVLrKX9XQ/qcvoeKDxHz8u+3KGgX9SK qcyk2ipAMYF7VHyQmn39y3cISyR72kYPFQgJZQOi+1IkHMTic/vh1eKFEz1wqfsOkvOT tvtYysFZGzWlvJZaO+vvoyesgoftXzVcdRaBLfEzn5G+DU8ZIiQsV753M9sEjDVG9S7z X7Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516362; x=1701121162; 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=Pno/XIMEfv6sc1E+e58IOA0UG1tXfCuf040vsihGJmc=; b=Gr4oJsNRPNXnak3iPcY7dleugfFplQDJP54Ru/pdPMy6cFu0zCQePfCDDBamdH5c5V 3bPxcyOJzSZbqALewWU8mHvD3AejvxgTTNDemMdjD7GWpCdT1PP/t81o2/g/zswJOnSz 4i/hGUWDvyzEafxuKUMSAd871A1E1SpxUYV5YUfk7qQDnDCOgmDfV9i7Gkhxl+Q1B5aq awnE6/93pac+tQJJ4BialhMQZWo7f1PoDqIY/1VcyUzR6B3YL9Qai9SKkWXJlzN5WOhE tTKNB3uwwxB6uF+yTPb4qXTolbOD5b35Y19ytiDvkV47Pfm9I8+oc6GX2/f0DO2k3P3q lyKQ== X-Gm-Message-State: AOJu0YwI5sv8qwQ7dplgQTIJmK4g7cvwrM5r5BR+fv24dobGBvFbg3RO DZ0xNOGq3lva18YT2ESRuqcVHwONiA80Fp9OxIg= X-Received: by 2002:a5d:4012:0:b0:32d:8855:138d with SMTP id n18-20020a5d4012000000b0032d8855138dmr5261429wrp.66.1700516362036; Mon, 20 Nov 2023 13:39:22 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id f10-20020adfdb4a000000b0032da35baf7bsm12234102wrj.113.2023.11.20.13.39.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:39:21 -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 , =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH-for-9.0 25/25] hw/pci-host/raven: Propagate error in raven_realize() Date: Mon, 20 Nov 2023 22:32:59 +0100 Message-ID: <20231120213301.24349-26-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 When an Error** reference is available, it is better to propagate local errors, rather then using generic ones, which might terminate the whole QEMU process. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan --- hw/pci-host/raven.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 86c3a49087..e34ce47874 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -345,8 +345,10 @@ static void raven_realize(PCIDevice *d, Error **errp) d->config[PCI_LATENCY_TIMER] = 0x10; d->config[PCI_CAPABILITY_LIST] = 0x00; - memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", BIOS_SIZE, - &error_fatal); + if (!memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", + BIOS_SIZE, errp)) { + return; + } memory_region_add_subregion(get_system_memory(), (uint32_t)(-BIOS_SIZE), &s->bios); if (s->bios_name) {