From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Julien Grall <julien.grall@citrix.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Igor Mammedov <imammedo@redhat.com>,
Frederic Konrad <fred.konrad@greensocs.com>
Subject: Re: [Qemu-devel] [RFC 00/34] QOM realize, device-only plus ISA conversion
Date: Tue, 04 Dec 2012 23:19:24 +0100 [thread overview]
Message-ID: <50BE76EC.9020006@suse.de> (raw)
In-Reply-To: <1353888766-6951-1-git-send-email-afaerber@suse.de>
Ping,
Am 26.11.2012 01:12, schrieb Andreas Färber:
> Hello Anthony and Paolo,
>
> As announced at KVM Forum, I have been preparing a new approach to incrementally
> get us Anthony's QOM realizefn concept. A previous attempt by Paolo and me had
> been turned down for making this available at Object-level and over questions
> whether BlockDriverState may need its own three-stage realization model.
>
> So here's an all-new patchset doing it at DeviceState-level only, adapting the
> signature to void realize(DeviceState *, Error **).
> CPUState is on a good way to get derived from DeviceState, so in the future
> will benefit from this approach as well.
>
> I've picked ISADevice as an example to showcase what semantic effects the
> switch to QOM realizefn has (in the hopes the number of devices would be small):
> As requested by Anthony for QOM CPUState reset and as seen with virtual methods
> in object-oriented programming languages, it becomes the derived method's
> responsibility to decide when and whether to call the parent class' method. In
> lack of real vtables this requires to save the parent's method in case we want
> to call it; classes and matching macros may need to be added for that.
> Another point to note is that we should carefully distinguish what goes into
> the qdev initfn / QOM realizefn and what can already go into a QOM initfn.
>
> This series is rebased onto Julien's ioport cleanups (touching on ISA devices).
>
> It starts by preparing the "realized" property, wrapping qdev's initfn (04).
> This means setting realized to true will not yet affect its children, as seen
> in Paolo's previous patches. That can be implemented later when the realizefns
> have been reviewed not to create new devices that would mess with recursive
> child realization. (In the previous series we had recursive realization but
> on my request dropped the hook-up of qdev due to the aforementioned quirks.)
>
> At that point there is a coexistence of QOM device realizefn and qdev initfn.
> For the first time now I have set out to actually eliminate some qdev initfns,
> that's what I chose ISA for. This consists of three parts, introducing
> realizefns for ISADevices (28) and recursively for PITs (31) and for PICs (34).
> As seen for the PCI host bridge series, I've extracted general QOM cleanups
> from the main conversion patch to arrive at a clean QOM'ish state while
> hopefully keeping the main patches readable.
>
> This series also highlights an interesting find: Beyond the to-be-solved
> CPUState, there is also a "realize" function for BusState (02), which is not
> derived from DeviceState. :-)
> With the device-centric approach taken here it would still be possible to add
> "realized" properties to other types using their own infrastructure (e.g., a
> hardcoded setter rather than a realizefn hook).
>
> Posted as an RFC to encourage bikeshedding, in particular about the type names
> and macros introduced. Adding new header files to move them out of the source
> files for, e.g., vl.c is left for a follow-up, but for instance I was unsure
> about TYPE_ISA_FDC (should this be TYPE_ISA_FLOPPY_DRIVE_CONTROLLER as with
> PCI_HOST_BRIDGE rather than PHB?), and naming of type names and functions is
> highly inconsistent (e.g., isa_vga vs. vga_isa, or pic vs. i8259).
So far I've heard no comments on the main QOM/ISA part of the series...
Anthony, did I understand you correctly wrt the method overriding?
(PIC/PIT) Or did you have this differently in mind?
Anyone any suggestions for improvement? If not, I'll send out a v2 this
week, with qdev_free() either rebased onto Paolo or removal dropped.
qbus was not further touched in the series, so I'd probably defer the
qbus_realize() change.
Branch below is rebased to match v1.3.0 + memory-ioport pull request.
Regards,
Andreas
>
> Available for viewing/testing at:
> https://github.com/afaerber/qemu-cpu/commits/realize-qdev
> git://github.com/afaerber/qemu-cpu.git realize-qdev
[...]
> Andreas Färber (34):
> qdev: Eliminate qdev_free() in favor of QOM
(depends on what we want to replace qdev_free() with)
> qbus: QOM'ify qbus_realize()
(unrelated since qbus did not get a "realized" property in this series)
> qdev: Fold state enum into bool realized
> qdev: Prepare "realized" property
> isa: Split off instance_init for ISADevice
> applesmc: QOM'ify
> cirrus_vga: QOM'ify ISA Cirrus VGA
> debugcon: QOM'ify ISA debug console
> fdc: QOM'ify ISA floppy controller
> i82374: QOM'ify
> i8259: Fix PIC_COMMON() macro
(applied already)
> i8259: QOM cleanups
> ide: QOM'ify ISA IDE
> m48t59: QOM'ify ISA M48T59 NVRAM
> mc146818rtc: QOM'ify
> ne2000-isa: QOM'ify
> parallel: QOM'ify
> pc: QOM'ify port 92
> pckbd: QOM'ify
> pcspk: QOM'ify
> sb16: QOM'ify
> serial: QOM'ify ISA serial
> sga: QOM'ify
> vga-isa: QOM'ify ISA VGA
> vmmouse: QOM'ify
> vmport: QOM'ify
> wdt_ib700: QOM'ify
> isa: Use realizefn for ISADevice
> i8254: QOM'ify
> kvm/i8254: QOM'ify some more
> i8254: Convert PITCommonState to QOM realizefn
> i8259: QOM'ify some more
> kvm/i8259: QOM'ify some more
> i8259: Convert PICCommonState to use QOM realizefn
[snip]
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-12-04 22:19 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 0:12 [Qemu-devel] [RFC 00/34] QOM realize, device-only plus ISA conversion Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [PATCH 01/34] qdev: Eliminate qdev_free() in favor of QOM Andreas Färber
2012-11-26 7:20 ` Paolo Bonzini
2012-11-26 11:52 ` Andreas Färber
2012-11-26 12:04 ` Paolo Bonzini
2012-11-26 0:12 ` [Qemu-devel] [RFC 02/34] qbus: QOM'ify qbus_realize() Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 03/34] qdev: Fold state enum into bool realized Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 04/34] qdev: Prepare "realized" property Andreas Färber
2012-12-12 14:29 ` Eduardo Habkost
2012-12-12 16:51 ` Andreas Färber
2012-12-12 18:16 ` Eduardo Habkost
2012-12-12 18:25 ` Andreas Färber
2012-12-12 18:44 ` Eduardo Habkost
2012-11-26 0:12 ` [Qemu-devel] [RFC 05/34] isa: Split off instance_init for ISADevice Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 06/34] applesmc: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 07/34] cirrus_vga: QOM'ify ISA Cirrus VGA Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 08/34] debugcon: QOM'ify ISA debug console Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 09/34] fdc: QOM'ify ISA floppy controller Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 10/34] i82374: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [PATCH 11/34] i8259: Fix PIC_COMMON() macro Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 12/34] i8259: QOM cleanups Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 13/34] ide: QOM'ify ISA IDE Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 14/34] m48t59: QOM'ify ISA M48T59 NVRAM Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 15/34] mc146818rtc: QOM'ify Andreas Färber
2013-04-22 15:42 ` Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 16/34] ne2000-isa: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 17/34] parallel: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 18/34] pc: QOM'ify port 92 Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 19/34] pckbd: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 20/34] pcspk: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 21/34] sb16: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 22/34] serial: QOM'ify ISA serial Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 23/34] sga: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 24/34] vga-isa: QOM'ify ISA VGA Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 25/34] vmmouse: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 26/34] vmport: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 27/34] wdt_ib700: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 28/34] isa: Use realizefn for ISADevice Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 29/34] i8254: QOM'ify Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 30/34] kvm/i8254: QOM'ify some more Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 31/34] i8254: Convert PITCommonState to QOM realizefn Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 32/34] i8259: QOM'ify some more Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 33/34] kvm/i8259: " Andreas Färber
2012-11-26 0:12 ` [Qemu-devel] [RFC 34/34] i8259: Convert PICCommonState to use QOM realizefn Andreas Färber
2012-12-04 22:19 ` Andreas Färber [this message]
2013-01-02 14:48 ` [Qemu-devel] [RFC 00/34] QOM realize, device-only plus ISA conversion Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50BE76EC.9020006@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=ehabkost@redhat.com \
--cc=fred.konrad@greensocs.com \
--cc=imammedo@redhat.com \
--cc=julien.grall@citrix.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).