From nobody Sun Dec 22 07:10:20 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 1734622888463286.2272741467359; Thu, 19 Dec 2024 07:41:28 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9126417B2; Thu, 19 Dec 2024 10:41:13 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5769D1788; Thu, 19 Dec 2024 10:39:49 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 64747176D; Thu, 19 Dec 2024 10:39:45 -0500 (EST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 77742176F for ; Thu, 19 Dec 2024 10:39:31 -0500 (EST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-436281c8a38so6995395e9.3 for ; Thu, 19 Dec 2024 07:39:31 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e2f9sm1844006f8f.81.2024.12.19.07.39.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Dec 2024 07:39:28 -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=1734622770; x=1735227570; 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=JH+rg8jdfzKs8XOz5Rmt45E6mRet+pe4gCab1lfs0FM=; b=erD1qmK3Vk8r5ACYthfOCIUmbFGynkV7talqA3qIb52MGlhhKDK9ePU9NpHosR+AH9 oveHWPpeBqV1wMuug1Z/lg0fdXAohqvreeEOdTLSOYAZQiX+M8Sj+tlGkDBxwpkYW5qP SxjrZMZCqJXsHkxsZ5aOSOkdhCB0/Q6FgDiI3GxKE1YQgIa3A2OoAS1avbFmZlx0A94V 5g8XKYyI0wCwVaErAtUGuT5eY2XJg1z5S5QO+lOcKK1GkA4CprrPAIdwE3HyLIRUJgvR nbqkAAIvXHZqaV1TNpR/Gjl/92d36reJcuPq8hMxhA9FNzIVxBOKU+nyZgHAFguNxA9e s+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734622770; x=1735227570; 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=JH+rg8jdfzKs8XOz5Rmt45E6mRet+pe4gCab1lfs0FM=; b=kSjPEm58kJ5XBb4iTeuTTc4mHgeRG8dXDO5l2BePawibS7xhc+imyt5sOyiSnObIJX 1RxCNRJHgzGA1HOm2DNhT22lLPA9ecTJiNNNI78LgnhfWA0Wtp5kKnEt89wddm/LY6E/ M0QvdVLjVotokDFCmeM8w7eH40FBKZJ2e/wlWnrsjpVm7lOh05ubyxUyxYQAZTnPbe2f j0iXRZ25Cjctezx17CaieQX6aTC1cvzkwSWvhFX9Cuw//TS9FCUzQnrpIM1v3hSFEuWK SJQ5HaWocnVOIDxv78lXpHf3f8L4xbLFKdFWBWBJhggnCGyBMaxgA1DEzjgp51CBKxni SezA== X-Forwarded-Encrypted: i=1; AJvYcCUYRoWtAew8aywon02BVQqAhQOJQkdepB5PFU14jYGTPUR4A9O93ZazsIqIcDIa8dZOT+YKPA==@lists.libvirt.org X-Gm-Message-State: AOJu0YyShSuOAc1+TKh3tyLOPgeqGve96dl9j91iGts+a2oTVkR9qR/a ot4vxumD+v+pfuRGzacZMzeiuvSCxFpdHC8t/TgweEmozLp6/bkU07F69YVcybE= X-Gm-Gg: ASbGncv4q/HINGmhKyG+dJuesCE9fG1TIV9vnVsr4W0PJhDbfBXfgLlgX4aRlbLwzlH s7BI+sNySS3mokDIcmoeEJqSgq6OllKiZ6A9arl15HIljC41T7BhnoSLIhGgd4G9eEYcnE8gwmj qR4Cq2Do5rQMi5i/5jq1ig4rIHp28O1guHK/jA9ziDX7Zo5e23W9EsvPrARUEgZTNXtr5FvsNIn 3qjyrafMM9nQWJ/dqLnjK/OeH8gZR8tmBRyyOxtVfbgAsd8oeknGiVRSodzimKlZlkRNCL8vARD 2J9N X-Google-Smtp-Source: AGHT+IG1cGibHjPdP6W9bW+3KhIZBCePkeSAzYBfsPOjgibfVlHnS9VHv0awtKPj3xaf0XpdaTrpng== X-Received: by 2002:a05:600c:468c:b0:433:c76d:d57e with SMTP id 5b1f17b1804b1-436553433ebmr67075135e9.5.1734622768851; Thu, 19 Dec 2024 07:39:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 05/10] hw/misc/vmcoreinfo: Convert to three-phase reset interface Date: Thu, 19 Dec 2024 16:38:52 +0100 Message-ID: <20241219153857.57450-6-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: KMGM2PL2T6F7EXXWPCJKZKQK4A3TU3AA X-Message-ID-Hash: KMGM2PL2T6F7EXXWPCJKZKQK4A3TU3AA 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: 1734622889465116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 --- hw/misc/vmcoreinfo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index 9822615cfed..093bede655e 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -26,9 +26,9 @@ static void fw_cfg_vmci_write(void *opaque, off_t offset,= size_t len) && s->vmcoreinfo.guest_format !=3D FW_CFG_VMCOREINFO_FORMAT_NONE; } =20 -static void vmcoreinfo_reset(void *opaque) +static void vmcoreinfo_reset_hold(Object *obj, ResetType type) { - VMCoreInfoState *s =3D opaque; + VMCoreInfoState *s =3D (VMCoreInfoState *)obj; =20 s->has_vmcoreinfo =3D false; memset(&s->vmcoreinfo, 0, sizeof(s->vmcoreinfo)); @@ -66,7 +66,7 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **= errp) * This device requires to register a global reset because it is * not plugged to a bus (which, as its QOM parent, would reset it). */ - qemu_register_reset(vmcoreinfo_reset, s); + qemu_register_resettable(OBJECT(s)); vmcoreinfo_state =3D s; } =20 @@ -87,11 +87,13 @@ static const VMStateDescription vmstate_vmcoreinfo =3D { 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->hotpluggable =3D false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + rc->phases.hold =3D vmcoreinfo_reset_hold; } =20 static const TypeInfo vmcoreinfo_types[] =3D { --=20 2.47.1