[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infra
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse |
Date: |
Tue, 20 Dec 2011 00:32:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
[ Please strip your replies a bit. I always worry to miss a comment when
scrolling down dozens of pages. ]
On 2011-12-19 23:14, Anthony Liguori wrote:
>> +
>> +struct APICBackend {
>> + const char *name;
>> + void (*init)(APICState *s);
>> + void (*set_base)(APICState *s, uint64_t val);
>> + void (*set_tpr)(APICState *s, uint8_t val);
>> + void (*external_nmi)(APICState *s);
>> +
>> + QSIMPLEQ_ENTRY(APICBackend) entry;
>> +};
>
>
> Wouldn't this be more naturally modeled by making APICBackend be a base
> class?
>
> In qdev today, this would look like:
>
> struct APICCommon {
> SysBusDevice qdev;
> ...
> };
>
> struct APICCommonInfo {
> DeviceInfo qdev;
> void (*init)(APICState *s);
> void (*set_base)(APICState *s, uint64_t val);
> void (*set_tpr)(APICState *s, uint8_t val);
> void (*external_nmi)(APICState *s);
> };
>
> Take a look at SCSIDevice for an example of this in practice. This is
> nicer because as we move save/load into devices methods, it becomes
> natural to define the state and save/load function in the base class.
> Provided it only uses base class state, it lets save/load be compatible
> between both in-kernel and in-qemu device model.
The difference is (unless I completely miss your point) that a common
SCSI base class is used by different derived classes. Here we have a
common frontend class but different base classes, so to say. And we have
a mechanism to chose where to inherit from on instantiation. Precisely
this allows to keep the compatibility between in-kernel and user space
model in this series.
Jan
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v5 07/16] apic: Open-code timer save/restore, (continued)
[Qemu-devel] [PATCH v5 10/16] memory: Introduce memory_region_init_reservation, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 16/16] kvm: Arm in-kernel irqchip support, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 08/16] i8259: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 12/16] kvm: x86: Establish IRQ0 override control, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 01/16] msi: Generalize msix_supported to msi_supported, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 14/16] kvm: x86: Add user space part for in-kernel i8259, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/15
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse,
Jan Kiszka <=
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Avi Kivity, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Paolo Bonzini, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Paolo Bonzini, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/20