From patchwork Fri Oct 20 10:54:43 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: 1852472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=QtUtQN/G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SBhN10N6Bz23jM for ; Fri, 20 Oct 2023 21:56:17 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtn9n-0006Mp-Cz; Fri, 20 Oct 2023 06:55:08 -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 1qtn9l-0006M9-EK for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:05 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtn9j-00057F-UD for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406609df1a6so5266155e9.3 for ; Fri, 20 Oct 2023 03:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799302; x=1698404102; 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=jj0YHZoSu3dkacuU/y9YufW6rMNDzfwPVB4J+L/F+h4=; b=QtUtQN/GvfvoatgimD+m1jB2SjMBnNrqAgyJ1P85qZdxQxBpySUOUjx8gvZZDmD704 5hKvLs1hnDvMojhg4MOKWzqsIiErWRpL/TJKkhjLmz+xqPbPwxA+3miBk0Dz3Q25/fYP 9aB6kKs4AjM0f7D12R8A7gy90IGsRfg1MalFXaIHN2OzjTMLnjfr7P/8RwXrfov+iQoA 0nKNdDALudV1WGHmF+np+TVvsL9suaHsu9IxQzYZWAqH5IPPA+kS1vuwyjDB8wm1Hvpk 20M9VM4bnAsjCj0e3C91aoH53EoyVNzeWwXb2PExrAuqzfem5fexYuj8X0Zc4WqGK7d4 pHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799302; x=1698404102; 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=jj0YHZoSu3dkacuU/y9YufW6rMNDzfwPVB4J+L/F+h4=; b=MJNI6ZmgVgQPI+U/HFC+Ytpri8blvkLydd3VNrWdbLpwYpFji1E7IxEkV0omXFm8is F+jEJxqyp5t/Ed2G1+BVthKcSpyoJ2x6th1N7DVOxPoZLF9DE97aMsBDQKfPdvyJbkuw 5zSRXPOq4qvyTWlPwtXgkpSxK3yh5ilE1H8aKfa6xayw/xqlh9iV2v7KfH0D0/r6wCyS ZfsMUFVOV74qyHZu1zRgiHMfEPnrrdRHZHsYZIcQJ0kDkZXpmTN5x8XcCo/yTtSI9dC4 xwBnGdWBWWTaFM78fAxDKIER9dPuq/wOL0cU4Uwn2UNbsAva6NCc0MwsNz5CtAnFa+eb r4kw== X-Gm-Message-State: AOJu0YxPSyHkjueRvU1XN8vupQ+TqvaZwhgxrBJdbwFrDmO+mo9kHRPa voYKMZ57kqTaQdnzXeKhlp9dvQJxxgXfx72ZD30= X-Google-Smtp-Source: AGHT+IFEn5/UONrqx8dbjo3XDMG1vy/IZeNOvP3NetoeVi0i9ViNOTHRCL5fGoOI9ujxO/qdBy9wYQ== X-Received: by 2002:a05:600c:45cb:b0:406:5359:769f with SMTP id s11-20020a05600c45cb00b004065359769fmr1202132wmo.0.1697799301988; Fri, 20 Oct 2023 03:55:01 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id l3-20020a5d5603000000b0032ddf2804ccsm1415684wrv.83.2023.10.20.03.55.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:55:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v3 2/5] hw/i386/pc: Propagate error if HPET device creation failed Date: Fri, 20 Oct 2023 12:54:43 +0200 Message-ID: <20231020105447.43482-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reported-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c0477f0141..c58a15182e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1235,7 +1235,9 @@ bool pc_basic_device_init(struct PCMachineState *pcms, if (!compat) { qdev_prop_set_uint32(hpet, HPET_INTCAP, hpet_irqs); } - sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), &error_fatal); + if (!sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), errp)) { + return false; + } sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE); for (i = 0; i < IOAPIC_NUM_PINS; i++) {