From patchwork Fri Feb 17 01:32:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 141721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BAA9D1007D5 for ; Fri, 17 Feb 2012 12:32:23 +1100 (EST) Received: from localhost ([::1]:36301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyCgO-0007XO-HD for incoming@patchwork.ozlabs.org; Thu, 16 Feb 2012 20:32:20 -0500 Received: from eggs.gnu.org ([140.186.70.92]:32913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyCgJ-0007XH-93 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 20:32:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyCgI-0006Th-6I for qemu-devel@nongnu.org; Thu, 16 Feb 2012 20:32:15 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58014 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyCgI-0006TX-1d for qemu-devel@nongnu.org; Thu, 16 Feb 2012 20:32:14 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 93EDB919A3; Fri, 17 Feb 2012 02:32:12 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 17 Feb 2012 02:32:08 +0100 Message-Id: <1329442328-13318-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Jan Kiszka , Marcelo Tosatti , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH] kvmclock: Always register type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Cc: Jan Kiszka Cc: Marcelo Tosatti Reviewed-by: Jan Kiszka --- 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)