kvmclock: Always register type

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.

Reviewed-by: please.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Andreas Färber 2012-03-04 21:32:34 +01:00 committed by Anthony Liguori
parent cb72b75824
commit 03f48b0797

View File

@ -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)