From patchwork Wed Jul 24 16:02:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 261446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3C0B92C00A9 for ; Thu, 25 Jul 2013 02:02:33 +1000 (EST) Received: from localhost ([::1]:59745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V21WJ-00041X-54 for incoming@patchwork.ozlabs.org; Wed, 24 Jul 2013 12:02:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V21Uw-0002PO-JM for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V21Uq-0002RE-HF for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:01:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V21Uq-0002R5-6Z for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:01:00 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6OG0wi8012068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Jul 2013 12:00:58 -0400 Received: from redhat.com (vpn-201-81.tlv.redhat.com [10.35.201.81]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id r6OG0uSO017391 for ; Wed, 24 Jul 2013 12:00:57 -0400 Date: Wed, 24 Jul 2013 19:02:20 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1374681580-17439-14-git-send-email-mst@redhat.com> References: <1374681580-17439-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1374681580-17439-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 13/14] hpet: add API to find it 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 Add API to find HPET using QOM. Signed-off-by: Michael S. Tsirkin --- hw/timer/hpet.c | 5 +++++ include/hw/timer/hpet.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 648b383..11bf401 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("", "hpet", NULL); +} + static const TypeInfo hpet_device_info = { .name = TYPE_HPET, .parent = TYPE_SYS_BUS_DEVICE, 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