|
From: | Anthony Liguori |
Subject: | [Qemu-devel] Re: [PATCH 0/4][RFC] Add module infrastructure to QEMU |
Date: | Mon, 11 May 2009 11:20:16 -0500 |
User-agent: | Thunderbird 2.0.0.21 (X11/20090320) |
Paul Brook wrote:
On Monday 11 May 2009, Anthony Liguori wrote:The numeric priorities are an implementation detail. No one should ever consume module_init() directly and I should add appropriately scary comments to that affect.Having looked a bit deeper, you're not actually implementing priorities. You're implementing different categories of init function. So this should be an enum, and be renames to something less confusing.
Good point, will do.
We do have dependencies. I'd like virtio to be a module, and I'd like virtio-net, virtio-blk, etc. to be modules. This gets exposed as virtio.c being a bus_init() and virtio-*.c being virtio_init(). We use the integer priorities in module.h to express this.I'm not convinced virtio is as much of a separate entity as you think it is. It's certainly not a bus. It's an implementation detail that happens to be shared by several devices.
It is once you abstract out the transport API from the transport implementation. We fall short here in QEMU today mainly for better integration with how machines are created today. I'd like to refactor the QEMU virtio code though to be closer to the Linux side of things. I see a module mechanism like this as a prereq for doing such a refactoring.
s390 uses a different transport implementation (there is no PCI on s390)for virtio so if QEMU ever were to support KVM with s390, we would need a way to support this.
Paul
-- Regards, Anthony Liguori
[Prev in Thread] | Current Thread | [Next in Thread] |