diff mbox

[v4,1/3] kvmclock: Always register type

Message ID 1330893156-26569-2-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber March 4, 2012, 8:32 p.m. UTC
Currently, the "kvmclock" type is only registered when kvm_enabled().

This breaks when moving type registration to before command line
parsing (so that QOM types can be used for CPU and machine).

Since the QOM classes are lazy-initialized anyway and kvmclock_create()
has another kvm_enabled() check, simply drop the KVM check in
kvmclock_register_types().

kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
---
 hw/kvm/clock.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

Comments

Avi Kivity March 5, 2012, 9:23 a.m. UTC | #1
On 03/04/2012 10:32 PM, Andreas Färber wrote:
> Currently, the "kvmclock" type is only registered when kvm_enabled().
>
> This breaks when moving type registration to before command line
> parsing (so that QOM types can be used for CPU and machine).
>
> Since the QOM classes are lazy-initialized anyway and kvmclock_create()
> has another kvm_enabled() check, simply drop the KVM check in
> kvmclock_register_types().
>
> kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.

Patch looks good.
Andreas Färber March 10, 2012, 1:35 a.m. UTC | #2
Am 05.03.2012 10:23, schrieb Avi Kivity:
> On 03/04/2012 10:32 PM, Andreas Färber wrote:
>> Currently, the "kvmclock" type is only registered when kvm_enabled().
>>
>> This breaks when moving type registration to before command line
>> parsing (so that QOM types can be used for CPU and machine).
>>
>> Since the QOM classes are lazy-initialized anyway and kvmclock_create()
>> has another kvm_enabled() check, simply drop the KVM check in
>> kvmclock_register_types().
>>
>> kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.
> 
> Patch looks good.

Ping for series.

Avi, do you want to sign this patch off through uq/master? Or should I
make the above a Reviewed-by (and remove the Cc:) within this series?

Andreas
Avi Kivity March 12, 2012, 10:36 a.m. UTC | #3
On 03/10/2012 03:35 AM, Andreas Färber wrote:
> Am 05.03.2012 10:23, schrieb Avi Kivity:
> > On 03/04/2012 10:32 PM, Andreas Färber wrote:
> >> Currently, the "kvmclock" type is only registered when kvm_enabled().
> >>
> >> This breaks when moving type registration to before command line
> >> parsing (so that QOM types can be used for CPU and machine).
> >>
> >> Since the QOM classes are lazy-initialized anyway and kvmclock_create()
> >> has another kvm_enabled() check, simply drop the KVM check in
> >> kvmclock_register_types().
> >>
> >> kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.
> > 
> > Patch looks good.
>
> Ping for series.
>
> Avi, do you want to sign this patch off through uq/master? Or should I
> make the above a Reviewed-by (and remove the Cc:) within this series?
>

Reviewed-by: please.
diff mbox

Patch

diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c
index 2157340..446bd62 100644
--- a/hw/kvm/clock.c
+++ b/hw/kvm/clock.c
@@ -121,9 +121,7 @@  void kvmclock_create(void)
 
 static void kvmclock_register_types(void)
 {
-    if (kvm_enabled()) {
     type_register_static(&kvmclock_info);
-    }
 }
 
 type_init(kvmclock_register_types)