[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/22] i8259.c: move parent_realize from PICClass to I8259CommonClass


  • To: Mark Cave-Ayland <mark.caveayland@xxxxxxxxxxx>
  • From: Peter Maydell <peter.maydell@xxxxxxxxxx>
  • Date: Wed, 14 Oct 2026 17:40:30 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=HsE4A9PIDoSy53wyR5EU6kLVeX4AGREiYkgrJG6uiU8=; fh=UIbfyH6QNm5she87CVPUpSvCylEkXLj7ha4U0bSspuQ=; b=rIUQl6l86NSvzP37UYg1kd1VdmgNXfUhvGhw3FXQ9vu8slWx5aJxTK+Nr7PL8FlhNI 6FXkTssVvUeFqCAXRuGMtoeeTOWSgF/4+92a9RWeSYt1n9s/1C/7dSvM0hEGCF2G1G0K jEuIIIg/6uWR42LgJ9wlfYvgeqKciPmU1yK7F7pIm8VpGwzutbK7VjYLzKgtfzYJ8z45 LJU/iNLahaGapEWPQF6PTzTZANY47k2CKy8SPmbvdz82UkzjcPXpb/TrleaS3T6uQaWq HrIr0apDyxauPJLimvFTr+uEjORL6yH8ObnnDI9KQVTcbvE6vcc4C8l6y5ZbWmV/IZfC gfxw==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1791996042; cv=none; d=google.com; s=arc-20260327; b=brApiVNi2GM/ej6m9e5vu1Y4fgwUIJzBuNSK33HC0SBmHTwIAtycJENnxGycuHMGxo UwFLD/YU8PZU1jijQr+n0RCWPCxHKc05Z9SZtcGvoNFbZ7bxWrI1MrtMOlJwODp3wfD5 koGY8KDa3THVnibNIVvL+MglWF6HNzu2D1fZlFA3ZlMS+ujGmN0U5cpTZK75Fj1gUy22 SwmBokjP7i4+XCvfoFGJFOPkxYMPt/Fg8PFsATJpowL5IzUXhXXlZD9i/TO232Zm+AeD N8FMK63TgN/a9223skuuv4FcP4/S/ugzFGsdJtyg8UqPkr3zCUcaj/MXqTgmIMqXWzjk D4bQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=linaro.org header.i="@linaro.org" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: pbonzini@xxxxxxxxxx, richard.henderson@xxxxxxxxxx, mst@xxxxxxxxxx, sstabellini@xxxxxxxxxx, anthony@xxxxxxxxxxxxxx, edgar.iglesias@xxxxxxxxx, qemu-devel@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 14 Oct 2026 16:40:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, 14 Oct 2026 at 14:58, Mark Cave-Ayland
<mark.caveayland@xxxxxxxxxxx> wrote:
>
> On 14/10/2026 12:00, Mark Cave-Ayland wrote:
>
> > On 13/10/2026 16:54, Peter Maydell wrote:
> >
> >> On Wed, 16 Sept 2026 at 11:49, Mark Cave-Ayland
> >> <mark.caveayland@xxxxxxxxxxx> wrote:
> >>>
> >>> Both the emulated and KVM i8259 implementations store a reference to the
> >>> parent_realize function in their respective classes. Start by moving
> >>> parent_realize from PICClass to I8259CommonClass and removing
> >>> PICClass since
> >>> it is no longer required.
> >>>
> >>> Signed-off-by: Mark Cave-Ayland <mark.caveayland@xxxxxxxxxxx>
> >>
> >> This is one of those things where I think we're not 100% consistent
> >> about whether we think the parent_realize field should go in the
> >> child class struct or the parent class struct. The name "parent_realize"
> >> implies it ought to be in the child struct, though, and I think we
> >> do that more often than we put it in the parent class. This also
> >> makes some kind of separation-of-concerns sense too: it's the child
> >> that knows (a) that it exists at all and that (b) it wants to have a
> >> realize method that will mean it needs to chain back to the parent.
> >>
> >> The docs for device_class_set_parent_realize() claim the parent
> >> realize ptr is stored "usually in the instance structure" which
> >> I think is just completely wrong.
> >>
> >> I could be persuaded otherwise. As usual with QOM/qdev, I'm
> >> mostly interested in (a) consistency and (b) documenting what the
> >> "right thing" is. Realize, reset and unrealize are the three
> >> methods where QOM's lack of convenient support for "child
> >> implementation of method will need to chain to parent impl"
> >> is most awkward.
> > Yeah it's a tricky one. This patch was really just refactoring what was
> > already there, but I'm open to moving it into the instance if you think
> > that is better. I agree with your point about the child instance being
> > the one that knows it needs to chain back to the parent.
> >
> > I'll have an experiment and if it looks good, I'll move it to the
> > instance in v2.
> I did a search over the codebase and checked all references to
> DeviceRealize, and they are all stored in QOM classes and make use of
> device_class_set_parent_realize(). So for now I think we can say it is
> the documentation for device_class_set_parent_realize() that is wrong,
> and I will leave it this way in v2 of the series.

Yes, the *instance* part is definitely wrong. But there's still
"parent class struct" vs "child class struct". This patch puts
it in the parent class struct, and as I say above I kind of
prefer child class struct and think we do that the most often.

-- PMM



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.