From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3E4Q-0005Vi-0k for qemu-devel@nongnu.org; Sat, 27 Jul 2013 19:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3E4K-0001X9-5X for qemu-devel@nongnu.org; Sat, 27 Jul 2013 19:38:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47641 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3E4J-0001X5-VL for qemu-devel@nongnu.org; Sat, 27 Jul 2013 19:38:36 -0400 Message-ID: <51F459F4.3030703@suse.de> Date: Sun, 28 Jul 2013 01:38:28 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1374681580-17439-1-git-send-email-mst@redhat.com> <1374681580-17439-14-git-send-email-mst@redhat.com> In-Reply-To: <1374681580-17439-14-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 13/14] hpet: add API to find it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Gerd Hoffmann Am 24.07.2013 18:02, schrieb Michael S. Tsirkin: > Add API to find HPET using QOM. >=20 > Signed-off-by: Michael S. Tsirkin > --- > hw/timer/hpet.c | 5 +++++ > include/hw/timer/hpet.h | 2 ++ > 2 files changed, 7 insertions(+) >=20 > 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 *kl= ass, void *data) > dc->props =3D hpet_device_properties; > } > =20 > +bool hpet_find(void) > +{ > + return object_resolve_path_type("", "hpet", NULL); > +} > + > static const TypeInfo hpet_device_info =3D { > .name =3D TYPE_HPET, > .parent =3D TYPE_SYS_BUS_DEVICE, "hpet" is being open-coded just above the new TYPE_HPET. http://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3D02f9a6f5da74251e1e5685ae= 57643d45c3fb6c30 But since you're doing it and the code is really trivial, you could also inline it into ACPI code to spare us this single-use function. > 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; > =20 > extern struct hpet_fw_config hpet_cfg; > + > +bool hpet_find(void); > #endif We could just as well move TYPE_HPET here to allow reuse from ACPI code. Not having done above conversion patch myself, I did not notice there was a header candidate. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg