qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] kvmclock: Always register type
@ 2012-02-17  1:32 Andreas Färber
  2012-02-17  9:33 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Färber @ 2012-02-17  1:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jan Kiszka, Marcelo Tosatti, Andreas Färber

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>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
---
 hw/kvm/clock.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] kvmclock: Always register type
  2012-02-17  1:32 [Qemu-devel] [PATCH] kvmclock: Always register type Andreas Färber
@ 2012-02-17  9:33 ` Jan Kiszka
  2012-02-17 12:19   ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2012-02-17  9:33 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Marcelo Tosatti, qemu-devel@nongnu.org

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

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

uq/master stuff or do other changes need it earlier?

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] kvmclock: Always register type
  2012-02-17  9:33 ` Jan Kiszka
@ 2012-02-17 12:19   ` Andreas Färber
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2012-02-17 12:19 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Marcelo Tosatti, qemu-devel@nongnu.org

Am 17.02.2012 10:33, schrieb Jan Kiszka:
> On 2012-02-17 02:32, 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.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> Cc: Jan Kiszka <jan.kiszka@siemens.com>
>> Cc: Marcelo Tosatti <mtosatti@redhat.com>
>> ---
>>  hw/kvm/clock.c |    2 --
>>  1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> 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)
> 
> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
> 
> uq/master stuff or do other changes need it earlier?

Yes, uq/master will be fine. Thanks.

I'll prepend it to my qom-cpu branch for now, but since that's getting
rather large for my taste (50+), I'm pushing independent bits out early.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-17 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17  1:32 [Qemu-devel] [PATCH] kvmclock: Always register type Andreas Färber
2012-02-17  9:33 ` Jan Kiszka
2012-02-17 12:19   ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).