From nobody Sun Dec 22 07:46:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17346228229793.886002251446712; Thu, 19 Dec 2024 07:40:22 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id EE042177A; Thu, 19 Dec 2024 10:40:21 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 0535B179C; Thu, 19 Dec 2024 10:39:30 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4EAE016E8; Thu, 19 Dec 2024 10:39:22 -0500 (EST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 2D0B61646 for ; Thu, 19 Dec 2024 10:39:19 -0500 (EST) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso9578375e9.2 for ; Thu, 19 Dec 2024 07:39:19 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8471dcsm1822152f8f.48.2024.12.19.07.39.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Dec 2024 07:39:17 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734622758; x=1735227558; darn=lists.libvirt.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=fSUrXqY3vKb6Y+xc3NUnoWjHDPec55tB8oXd/H8ApGI=; b=gRybOoE4hYLn8tALJ/muEM6wGsOmGROvYFJkFCMMZD8n5yw4JwEmrkS8DLl09Z6EHH j4FTFYxmHnWeC94+R/ogctBwYru8fO+waThjDCttt2E9WMxhXlbINNawfJiAEVBq6diX Sf50EdRo8OcY0VFtHWUK7cw5yYz5y/ivwLcV9hYWlYNINLYs5xWSFv51wcI9qAQYMyAh 1zLNdy/Tpf22/jz82cVwcgpn8kqVAOeN3AX1j8BIpUEpz5euxpZERL9Qn/hHJQY8vLeA 67Hftwj7V5sF6sVLigVy2Fajy2wNM5pfS3PcdG0FgT9VuauYtzkAnlX1TZ3VWNmdyxxi mD9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734622758; x=1735227558; 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=fSUrXqY3vKb6Y+xc3NUnoWjHDPec55tB8oXd/H8ApGI=; b=ih4xfgOmLDrQuog+7bC1JxXtiVObo4+0Bws/Kh2iZdia8XycS0msGhogZdm/MjrAY6 b0/WRXUyCpkq/6S1qdrlSkLfu+eJppHn/XTbcy70moPuHoQortUbJXq2/uUaqzz3Lp/e rlyOFg3v2Epr2Wxr6UKCmxvX9j9+pE5S+u20PMpY0aLlBJja2qo9tpNeJcwH6OUtDYPD 0fthCclI7GGMaZAejPmdNuIG2RMsOIEbsocIeP7R05jmv5UC160nhzmUwWqbHdMLSmbn sTRysws/gqLKd/zBBdT5xkPRSWmOnaJudLnNcKlxMAoxvhZFaat+2LxPvl2dayJAA4m4 HWKA== X-Forwarded-Encrypted: i=1; AJvYcCWr/4Wk8/qVdRDKM7SD7Nk4anHGzCRiRqrdDOINLdW1qvPtuKmxhcIvqhWw1RrtAQpD/qU4EQ==@lists.libvirt.org X-Gm-Message-State: AOJu0YygfjC9RQnSRepNZlYawyASEDUQKOYZhj1qBKFlnKa/pvJKehEo T7X+GblrQcGTZr4gqk6UIiNaqekcGqp8XZ6jxKjmaeA37WkgLZVv0QQHR0UxSNU= X-Gm-Gg: ASbGncs/GJ1Tn4VceRUJpC2qv2T8CS1cIB25zCRipE5S0geePSSd0RxJVcnIgD1Jk6G CbR3tb3n1Wc5GUSaNPrlYjn2dEXnKIIceQyQe8ap6UPuzHmn0ipgrdelEUw8y/9hUB+aJXRUW8y J172bTEEz4VJJnc6a0J0d2mC+Qb7rATZ/EwsDKxka+7fKKjcLAddXbR55wfHWrkd2ZxH7nCRtg6 /GXFbDK6dyiuALG/cvckSV7JoBCLTSz97ZljReTwPdogrqP6HXekKCLftExTOrLoPIhGl5rOS9L M99n X-Google-Smtp-Source: AGHT+IGvWED1Jq74g7NcAbgkQDk9YzBZGMpsFWZ3LtiDorAumzm0I2si7sK1vs6So0DMLBM16lnmYw== X-Received: by 2002:a05:600c:524f:b0:434:fddf:5c0a with SMTP id 5b1f17b1804b1-436553452d7mr74615505e9.3.1734622758007; Thu, 19 Dec 2024 07:39:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find() Date: Thu, 19 Dec 2024 16:38:50 +0100 Message-ID: <20241219153857.57450-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241219153857.57450-1-philmd@linaro.org> References: <20241219153857.57450-1-philmd@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NZXUYWIZVSUUJ5P2ZCI2FAK77PWKL6CK X-Message-ID-Hash: NZXUYWIZVSUUJ5P2ZCI2FAK77PWKL6CK X-MailFrom: philmd@linaro.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: Ani Sinha , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1734622823523116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 --- include/hw/misc/vmcoreinfo.h | 13 ++++++------- hw/misc/vmcoreinfo.c | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h index 0b7b55d400a..da1066d540c 100644 --- a/include/hw/misc/vmcoreinfo.h +++ b/include/hw/misc/vmcoreinfo.h @@ -30,12 +30,11 @@ struct VMCoreInfoState { FWCfgVMCoreInfo vmcoreinfo; }; =20 -/* returns NULL unless there is exactly one device */ -static inline VMCoreInfoState *vmcoreinfo_find(void) -{ - Object *o =3D object_resolve_path_type("", VMCOREINFO_DEVICE, NULL); - - return o ? VMCOREINFO(o) : NULL; -} +/** + * vmcoreinfo_find: + * + * Returns NULL unless there is exactly one instance. + */ +VMCoreInfoState *vmcoreinfo_find(void); =20 #endif diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index ad5a4dec596..c5bb5c9fa52 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -42,11 +42,12 @@ static void vmcoreinfo_realize(DeviceState *dev, Error = **errp) /* for gdb script dump-guest-memory.py */ static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED; =20 - /* Given that this function is executing, there is at least one VMCORE= INFO - * device. Check if there are several. + /* + * Given that this function is executing, there is at least one + * VMCOREINFO instance. Check if there are several. */ if (!vmcoreinfo_find()) { - error_setg(errp, "at most one %s device is permitted", + error_setg(errp, "at most one %s instance is permitted", VMCOREINFO_DEVICE); return; } @@ -103,3 +104,12 @@ static const TypeInfo vmcoreinfo_types[] =3D { }; =20 DEFINE_TYPES(vmcoreinfo_types) + +VMCoreInfoState *vmcoreinfo_find(void) +{ + Object *obj; + + obj =3D object_resolve_path_type("", TYPE_VMCOREINFO_DEVICE, NULL); + + return obj ? (VMCoreInfoState *)obj : NULL; +} --=20 2.47.1