On 12/20/2011 07:51 AM, Paolo Bonzini wrote:
On 12/20/2011 02:41 PM, Anthony Liguori wrote:
On 12/20/2011 03:56 AM, Avi Kivity wrote:
On 12/20/2011 02:38 AM, Anthony Liguori wrote:
That was v1 of my patches. Avi didn't like it, I tried it like this,
and
in the end I had to agree. So, no, I don't think we want such a model.


Yes, we do :-)

The in-kernel APIC is a different implementation of the APIC device.
It's not an "accelerator" for the userspace APIC.

A different implementation but not a different device. Device == spec.

If it was hardware, it'd be a fully compatible clone. The way we would
model this is via inheritance.

I see your fully compatible clone, and I raise my bridge with a different
implementation underneath. It's the same old debate on is-a vs has-a.

In QOM parlance Jan implemented this:

abstract class Object
abstract class Device
class APIC: { backend: link<APICBackend> }
abstract class APICBackend
class QEMU_APICBackend
class KVM_APICBackend

I don't fundamentally object to modeling it like this provided that it's modeled (and visible) through qdev and not done through a one-off infrastructure.

But yes, you are exactly correct in your observation (and that both can be 
right).

Regards,

Anthony Liguori


and you're proposing this:

abstract class Object
abstract class Device
abstract class APIC
class QEMU_APIC
class KVM_APIC

Both can be right, both can be wrong.

Paolo




Reply via email to