From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT7Cm-0004fu-Rc for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT7Cg-000132-Rc for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:34:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT7Cg-00012u-Kk for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:34:14 -0400 Date: Mon, 7 Oct 2013 12:36:37 +0300 From: "Michael S. Tsirkin" Message-ID: <1381138458-6848-24-git-send-email-mst@redhat.com> References: <1381138458-6848-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1381138458-6848-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH v9 23/27] hpet: add API to find it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori Cc: pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, kraxel@redhat.com Add API to find HPET using QOM. Reviewed-by: Gerd Hoffmann Tested-by: Gerd Hoffmann Signed-off-by: Michael S. Tsirkin --- include/hw/timer/hpet.h | 2 ++ hw/timer/hpet.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h index 757f79f..ab44bd3 100644 --- a/include/hw/timer/hpet.h +++ b/include/hw/timer/hpet.h @@ -71,4 +71,6 @@ struct hpet_fw_config } QEMU_PACKED; extern struct hpet_fw_config hpet_cfg; + +bool hpet_find(void); #endif diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index fcd22ae..2eb75ea 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -757,6 +757,11 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->props = hpet_device_properties; } +bool hpet_find(void) +{ + return object_resolve_path_type("", TYPE_HPET, NULL); +} + static const TypeInfo hpet_device_info = { .name = TYPE_HPET, .parent = TYPE_SYS_BUS_DEVICE, -- MST