qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges
Date: Mon, 13 Aug 2012 19:57:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5

On 13/08/12 15:16, Anthony Liguori wrote:

I understand what your objection is but it's unreasonable IMHO.  The
purpose of QOM is to bring consistency across large swaths of code in
QEMU that have historically done things there own way.

This means expressing concepts like inheritence and casting in the same
way across the board.  The common way (the QOM way) is to make the
parent type the first member of the struct (typically named parent or
parent_obj) and then to use cast macros to upcast and downcast.

This patch is 100% correct in that regard and I'm going to apply it once
Andreas makes the change I requested.

For my part, I'm long over due in writing up a device authoring style
guide that I promised a few weeks ago.  I'll write that up this
afternoon and send it out today.

We can debate the merits of this sort of thing in the style guide.

Yes please! I've spent quite a fair bit of time over the past couple of weeks in this area, and have found the lack of documentation related to trying to create a new hardware device fairly frustrating. The hardest part is not the coding, but figuring which of the following I should be using out of:

qom
qdev
qmp
hmp
sysbus
VMState

(I think that half of these are now obsolete interfaces, but a general document which explains how these things are related and which ones I should be using would be very welcome)


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]