From: Paul Brook <paul@codesourcery.com>
To: Zachary Amsden <zamsden@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] New device API
Date: Fri, 8 May 2009 12:28:52 +0100 [thread overview]
Message-ID: <200905081228.53028.paul@codesourcery.com> (raw)
In-Reply-To: <4A0390DC.2010908@redhat.com>
> > The attached patch is my attempt at a new internal API for device
> > creation in qemu.
>...
> I think the general direction is good, and this is sorely needed, but I
> think having a fixed / static device struct isn't flexible enough to
> handle the complexities of multiple device / bus types - for example,
> MSI-X could add tons of IRQ vectors to a device, or complex devices
> could have tons of MMIO regions.
>
> I think a more flexible scheme would be to have a common device header,
> and fixed substructures which are added as needed to a device.
I'm not sure how much benefit this gives in practice, or how much it's worth
catering for the "same" device that can be attached to different busses.
While e.g. both PCI and non-PCI devices have MMIO regions and IRQ sources,
I'm not sure how much can be shared between the two. I suspect the common
infrastructure extended as far as cpu_register_io_memory/qemu_irq (or
equivalent), but using the same API for the bus/device interaction is more
trouble then it's worth.
While a fancy multiple inheritance system like you describe is in interesting
idea, It feels over-engineered for this particular problem.
> The config issue is certainly a very important problem to address. I
> think it should be noted there are three types of configuration data,
> all of which are ontologically different. There are:
>
> 1) Static per-device configuration choices, such as feature enable /
> disable, framebuffer size, PCI vs. ISA bus representation.
>
> 2) Dynamic per-device data.
I think these two largely fall out together. Once you've determined that
you're dealing with a PCI device, all the associated dynamic PCI data follows
directly from that.
> 3) Implementation specific data. Pieces of data which are required for
> a particular realization of a device on the host, such as file
> descriptors, call back functions, authentication data, network routing.
We already have things like CharDevice and BlockDriverState to isolate devices
from the host implementation. In the past this is the distinction I've made
between user-level config and machine config.
Paul
next prev parent reply other threads:[~2009-05-08 11:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 11:31 [Qemu-devel] [RFC] New device API Paul Brook
2009-05-05 15:56 ` Blue Swirl
2009-05-05 16:17 ` Paul Brook
2009-05-05 16:26 ` Blue Swirl
2009-05-05 16:35 ` Paul Brook
2009-05-05 18:22 ` Anthony Liguori
2009-05-05 22:42 ` Edgar E. Iglesias
2009-05-06 0:52 ` Paul Brook
2009-05-06 1:04 ` Paul Brook
2009-05-06 13:35 ` Anthony Liguori
2009-05-09 20:55 ` Anthony Liguori
2009-05-09 21:06 ` Paul Brook
2009-05-10 1:34 ` Anthony Liguori
2009-05-09 22:52 ` malc
2009-05-10 1:35 ` Anthony Liguori
2009-05-10 6:50 ` Andreas Färber
2009-05-10 18:38 ` malc
2009-05-10 1:37 ` Anthony Liguori
2009-05-05 22:25 ` Edgar E. Iglesias
2009-05-08 1:54 ` Zachary Amsden
2009-05-08 11:28 ` Paul Brook [this message]
2009-05-08 13:47 ` Anthony Liguori
2009-05-09 1:21 ` Zachary Amsden
2009-05-09 13:36 ` Anthony Liguori
2009-05-08 5:27 ` Marcelo Tosatti
2009-05-08 10:44 ` Paul Brook
2009-05-28 13:53 ` Markus Armbruster
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=200905081228.53028.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=zamsden@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).