From nobody Tue Dec 24 13:06:55 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 1734622913415442.3998418461448; Thu, 19 Dec 2024 07:41:53 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6C76C1744; Thu, 19 Dec 2024 10:41:52 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D6489172B; Thu, 19 Dec 2024 10:39:59 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id A50A3176C; Thu, 19 Dec 2024 10:39:55 -0500 (EST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 E1EC01796 for ; Thu, 19 Dec 2024 10:39:40 -0500 (EST) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so10776435e9.0 for ; Thu, 19 Dec 2024 07:39:40 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b4274csm55636845e9.38.2024.12.19.07.39.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Dec 2024 07:39:39 -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=1734622780; x=1735227580; 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=W5xIB6Q3xpywMwriwl34zxXU4p+OU3fl2Ms6nSvvP3g=; b=fuquWfbGiA0gaJV7n/8wcNzNatwCCwJtAne8DvB68zGWk1SqUu8rqpQJwK2qulE+pU 08zhLoCZ/cs4/8xXMhI14vaZlJygA9fti5fh30o8bHlrdrdCCoeHRAZDo6vD82h/MK6T yQbvuf7qH5PbWZI+7z9a4uHkCC4EG1BFXaD7NXnZ3Z1xCmoR3QAkGGXCN0iEO3CHaefV sT8f04vLtbAUeqOf4PAw7ZFwmEJtWlW8DHb+ZS3E8qbgPwSdsKC5NdVOUEckl8X2woBh LXaTUrHbpewGJAy2urlajZv+xeExGPwj3WaxWIPWxHdI/ONLhcNesPmuq8TWiOOWPdWv amBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734622780; x=1735227580; 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=W5xIB6Q3xpywMwriwl34zxXU4p+OU3fl2Ms6nSvvP3g=; b=jA8BIAG2ax/NYTxj917nII5dKamukEO6/CH4cf16yfv16Uw56Z4z+/DijqStYekgo6 ReW1wJ3FWRZQFKRhFarUphFMbCT7pZEbHzUINLnvLXQ93T1JvABEnT7LuTS+yOyg7aRb c31cPyJwLgemMswrXXKTSHNETzZDxO232vVCv2LHlbSgG7CxaY7VeYA3jvriS0I6N1N2 DztDb98lq6Iw3NZAYd/DIU6tIZVqs+pWcrYc+ugYdgVa9Y3kMemg7Y0ncEdLeQOFeBB0 lb1Cdg/vdOHVeTkuehJuD/RBC849VHDpkvtuRgkXw8kCOLoixs8wYnyN7nhv8maDMNPl 8ckg== X-Forwarded-Encrypted: i=1; AJvYcCWVE0AhQeXbx+uQI9QYMvsWqmbB1MwrEbzTf+Yd2vwR0CkVsQMkT+q/QrGa1w3iQ7/InlAX1w==@lists.libvirt.org X-Gm-Message-State: AOJu0YzrxXfW6d/WZEN5VgKVvh27nrrQLRtxOJNZPLTUSzG/vJUfDepw /V9AIMGU/giz9IAQpsj9W2w8887HTnVXoLLSe6HcyBZBdYCiPTW1VGxV254mbeBDR4lmnKj6UuX a X-Gm-Gg: ASbGnctU4d8qaOTQKEFfpyvHevnWVtMUK8yKIgp2z4UXACN1klwMlrZOreH/Nj8fCxD c1dG01l6hpZY5JxcQpy7bqOurjqaqqdByOOQiECeyhrgGBKRc1vgx17nQoCi9SlSXD1hNvh8SaB iD4zbzol1TuCfu7Mqe/JF89KK3t61yiETnd+YLxZj0IwNl3jM6TtPgfjQC7HKH/hPk7FoIXfPRq OoPC37I4QnUypffAhYrqn5q6AqxyJdbwaMNsVrPKlsbon+N47Wk47H1J466/cN1QIukRTsPzxAr Mt87 X-Google-Smtp-Source: AGHT+IGv5rd7ZLJrA7Ng7P1DhJdT3DlR3L1JZzaGzslknhJylDOfRM57TjnrYcXF/hgefogMGL1mfw== X-Received: by 2002:a5d:47cf:0:b0:385:d852:29ed with SMTP id ffacd0b85a97d-388e4d8e083mr6933410f8f.36.1734622779863; Thu, 19 Dec 2024 07:39:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 07/10] hw/misc/vmcoreinfo: Factor vmcoreinfo_device_realize() out Date: Thu, 19 Dec 2024 16:38:54 +0100 Message-ID: <20241219153857.57450-8-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: IRP3XTVKBKGDVDBZV3GDHF27JFAFHAQK X-Message-ID-Hash: IRP3XTVKBKGDVDBZV3GDHF27JFAFHAQK 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: 1734622915461116600 Content-Type: text/plain; charset="utf-8" In preparation of implementing a UserCreatable callback in the next commit, factor vmcoreinfo_device_realize() out. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/vmcoreinfo.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index 55f9d437a94..a0511ea0da4 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -49,9 +49,8 @@ static void vmcoreinfo_reset_hold(Object *obj, ResetType = type) s->vmcoreinfo.host_format =3D cpu_to_le16(FW_CFG_VMCOREINFO_FORMAT_ELF= ); } =20 -static void vmcoreinfo_realize(DeviceState *dev, Error **errp) +static void vmcoreinfo_realize(VMCoreInfoState *s, Error **errp) { - VMCoreInfoState *s =3D VMCOREINFO_DEVICE(dev); FWCfgState *fw_cfg =3D fw_cfg_find(); /* for gdb script dump-guest-memory.py */ static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED; @@ -84,13 +83,18 @@ static void vmcoreinfo_realize(DeviceState *dev, Error = **errp) vmcoreinfo_state =3D s; } =20 +static void vmcoreinfo_device_realize(DeviceState *dev, Error **errp) +{ + vmcoreinfo_realize(VMCOREINFO_DEVICE(dev), errp); +} + static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->vmsd =3D &vmstate_vmcoreinfo; - dc->realize =3D vmcoreinfo_realize; + dc->realize =3D vmcoreinfo_device_realize; dc->hotpluggable =3D false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); rc->phases.hold =3D vmcoreinfo_reset_hold; --=20 2.47.1